Index: include/clang/AST/Comment.h =================================================================== --- include/clang/AST/Comment.h +++ include/clang/AST/Comment.h @@ -354,7 +354,7 @@ SourceRange getCommandNameRange() const { return SourceRange(getBeginLoc().getLocWithOffset(-1), - getLocEnd()); + getEndLoc()); } RenderKind getRenderKind() const { @@ -569,7 +569,7 @@ ParagraphCommentBits.IsWhitespaceValid = false; setSourceRange(SourceRange(Content.front()->getBeginLoc(), - Content.back()->getLocEnd())); + Content.back()->getEndLoc())); setLocation(Content.front()->getBeginLoc()); } @@ -704,7 +704,7 @@ void setParagraph(ParagraphComment *PC) { Paragraph = PC; - SourceLocation NewLocEnd = PC->getLocEnd(); + SourceLocation NewLocEnd = PC->getEndLoc(); if (NewLocEnd.isValid()) setSourceRange(SourceRange(getBeginLoc(), NewLocEnd)); } @@ -980,7 +980,7 @@ } SourceRange getTextRange() const { - return SourceRange(TextBegin, getLocEnd()); + return SourceRange(TextBegin, getEndLoc()); } }; @@ -1108,7 +1108,7 @@ return; setSourceRange(SourceRange(Blocks.front()->getBeginLoc(), - Blocks.back()->getLocEnd())); + Blocks.back()->getEndLoc())); setLocation(Blocks.front()->getBeginLoc()); } Index: include/clang/AST/Decl.h =================================================================== --- include/clang/AST/Decl.h +++ include/clang/AST/Decl.h @@ -4232,11 +4232,11 @@ return RBraceLoc; // No braces: get the end location of the (only) declaration in context // (if present). - return decls_empty() ? getLocation() : decls_begin()->getLocEnd(); + return decls_empty() ? getLocation() : decls_begin()->getEndLoc(); } SourceRange getSourceRange() const override LLVM_READONLY { - return SourceRange(getLocation(), getLocEnd()); + return SourceRange(getLocation(), getEndLoc()); } static bool classof(const Decl *D) { return classofKind(D->getKind()); } Index: include/clang/AST/DeclCXX.h =================================================================== --- include/clang/AST/DeclCXX.h +++ include/clang/AST/DeclCXX.h @@ -2892,11 +2892,11 @@ return getRBraceLoc(); // No braces: get the end location of the (only) declaration in context // (if present). - return decls_empty() ? getLocation() : decls_begin()->getLocEnd(); + return decls_empty() ? getLocation() : decls_begin()->getEndLoc(); } SourceRange getSourceRange() const override LLVM_READONLY { - return SourceRange(ExternLoc, getLocEnd()); + return SourceRange(ExternLoc, getEndLoc()); } static bool classof(const Decl *D) { return classofKind(D->getKind()); } Index: include/clang/AST/DeclFriend.h =================================================================== --- include/clang/AST/DeclFriend.h +++ include/clang/AST/DeclFriend.h @@ -158,7 +158,7 @@ if (DD->getOuterLocStart() != DD->getInnerLocStart()) return DD->getSourceRange(); } - return SourceRange(getFriendLoc(), ND->getLocEnd()); + return SourceRange(getFriendLoc(), ND->getEndLoc()); } else if (TypeSourceInfo *TInfo = getFriendType()) { SourceLocation StartL = Index: include/clang/AST/DeclObjC.h =================================================================== --- include/clang/AST/DeclObjC.h +++ include/clang/AST/DeclObjC.h @@ -323,7 +323,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY; SourceRange getSourceRange() const override LLVM_READONLY { - return SourceRange(getLocation(), getLocEnd()); + return SourceRange(getLocation(), getEndLoc()); } SourceLocation getSelectorStartLoc() const { Index: include/clang/AST/DeclarationName.h =================================================================== --- include/clang/AST/DeclarationName.h +++ include/clang/AST/DeclarationName.h @@ -559,7 +559,7 @@ /// getSourceRange - The range of the declaration name. SourceRange getSourceRange() const LLVM_READONLY { - return SourceRange(getBeginLoc(), getLocEnd()); + return SourceRange(getBeginLoc(), getEndLoc()); } SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } Index: include/clang/AST/Expr.h =================================================================== --- include/clang/AST/Expr.h +++ include/clang/AST/Expr.h @@ -910,7 +910,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return SourceExpr ? SourceExpr->getLocEnd() : Loc; + return SourceExpr ? SourceExpr->getEndLoc() : Loc; } SourceLocation getExprLoc() const LLVM_READONLY { if (SourceExpr) return SourceExpr->getExprLoc(); @@ -1551,7 +1551,7 @@ SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getBeginLoc() const LLVM_READONLY { return Val->getBeginLoc(); } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return Val->getLocEnd(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Val->getEndLoc(); } static bool classof(const Stmt *T) { return T->getStmtClass() == ImaginaryLiteralClass; @@ -1898,7 +1898,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return isPostfix() ? Loc : Val->getLocEnd(); + return isPostfix() ? Loc : Val->getEndLoc(); } SourceLocation getExprLoc() const LLVM_READONLY { return Loc; } @@ -2804,7 +2804,7 @@ // FIXME: Init should never be null. if (!Init) return SourceLocation(); - return Init->getLocEnd(); + return Init->getEndLoc(); } static bool classof(const Stmt *T) { @@ -2981,7 +2981,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getSubExpr()->getLocEnd(); + return getSubExpr()->getEndLoc(); } static bool classof(const Stmt *T) { @@ -3085,7 +3085,7 @@ SourceLocation getBeginLoc() const LLVM_READONLY { return LPLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getSubExpr()->getLocEnd(); + return getSubExpr()->getEndLoc(); } static bool classof(const Stmt *T) { @@ -3169,7 +3169,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getRHS()->getLocEnd(); + return getRHS()->getEndLoc(); } /// getOpcodeStr - Turn an Opcode enum value into the punctuation char it @@ -3454,7 +3454,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getRHS()->getLocEnd(); + return getRHS()->getEndLoc(); } static bool classof(const Stmt *T) { @@ -3544,7 +3544,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getFalseExpr()->getLocEnd(); + return getFalseExpr()->getEndLoc(); } static bool classof(const Stmt *T) { @@ -4445,7 +4445,7 @@ return Kind == FieldDesignator ? getFieldLoc() : getRBracketLoc(); } SourceRange getSourceRange() const LLVM_READONLY { - return SourceRange(getBeginLoc(), getLocEnd()); + return SourceRange(getBeginLoc(), getEndLoc()); } }; @@ -4688,7 +4688,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getCommonExpr()->getLocEnd(); + return getCommonExpr()->getEndLoc(); } child_range children() { @@ -5048,7 +5048,7 @@ SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getBeginLoc() const LLVM_READONLY { return getCaretLocation(); } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return getBody()->getLocEnd(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getBody()->getEndLoc(); } /// getFunctionType - Return the underlying function type for this block. const FunctionProtoType *getFunctionType() const; @@ -5250,7 +5250,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getSyntacticForm()->getLocEnd(); + return getSyntacticForm()->getEndLoc(); } child_range children() { Index: include/clang/AST/ExprCXX.h =================================================================== --- include/clang/AST/ExprCXX.h +++ include/clang/AST/ExprCXX.h @@ -628,7 +628,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return SubExpr->getLocEnd(); + return SubExpr->getEndLoc(); } /// Retrieve the source range of the expression. @@ -765,7 +765,7 @@ MSPropertyRefExpr(EmptyShell Empty) : Expr(MSPropertyRefExprClass, Empty) {} SourceRange getSourceRange() const LLVM_READONLY { - return SourceRange(getBeginLoc(), getLocEnd()); + return SourceRange(getBeginLoc(), getEndLoc()); } bool isImplicitAccess() const { @@ -1046,7 +1046,7 @@ SourceLocation getEndLoc() const LLVM_READONLY { if (!getSubExpr()) return ThrowLoc; - return getSubExpr()->getLocEnd(); + return getSubExpr()->getEndLoc(); } static bool classof(const Stmt *T) { @@ -1255,7 +1255,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return SubExpr->getLocEnd();} + SourceLocation getEndLoc() const LLVM_READONLY { return SubExpr->getEndLoc();} // Implement isa/cast/dyncast/etc. static bool classof(const Stmt *T) { @@ -2181,7 +2181,7 @@ SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY {return Argument->getLocEnd();} + SourceLocation getEndLoc() const LLVM_READONLY {return Argument->getEndLoc();} static bool classof(const Stmt *T) { return T->getStmtClass() == CXXDeleteExprClass; @@ -2884,7 +2884,7 @@ SourceLocation getEndLoc() const LLVM_READONLY { if (hasExplicitTemplateArgs()) return getRAngleLoc(); - return getNameInfo().getLocEnd(); + return getNameInfo().getEndLoc(); } child_range children() { @@ -3115,7 +3115,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return SubExpr->getLocEnd();} + SourceLocation getEndLoc() const LLVM_READONLY { return SubExpr->getEndLoc();} // Implement isa/cast/dyncast/etc. static bool classof(const Stmt *T) { @@ -3242,7 +3242,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { if (!RParenLoc.isValid() && NumArgs > 0) - return getArg(NumArgs - 1)->getLocEnd(); + return getArg(NumArgs - 1)->getEndLoc(); return RParenLoc; } @@ -3625,7 +3625,7 @@ SourceLocation getEndLoc() const LLVM_READONLY { if (hasExplicitTemplateArgs()) return getRAngleLoc(); - return getMemberNameInfo().getLocEnd(); + return getMemberNameInfo().getEndLoc(); } static bool classof(const Stmt *T) { @@ -4201,7 +4201,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getTemporary()->getLocEnd(); + return getTemporary()->getEndLoc(); } static bool classof(const Stmt *T) { @@ -4375,7 +4375,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getCommonExpr()->getLocEnd(); + return getCommonExpr()->getEndLoc(); } child_range children() { @@ -4463,7 +4463,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getOperand()->getLocEnd(); + return getOperand()->getEndLoc(); } child_range children() { return child_range(SubExprs, SubExprs + 2); } Index: include/clang/AST/ExprObjC.h =================================================================== --- include/clang/AST/ExprObjC.h +++ include/clang/AST/ExprObjC.h @@ -70,7 +70,7 @@ SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return String->getLocEnd(); } + SourceLocation getEndLoc() const LLVM_READONLY { return String->getEndLoc(); } // Iterators child_range children() { return child_range(&String, &String+1); } @@ -1502,7 +1502,7 @@ } SourceLocation getBaseLocEnd() const LLVM_READONLY { - return getBase()->getLocEnd(); + return getBase()->getEndLoc(); } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } @@ -1580,7 +1580,7 @@ return Operand->getBeginLoc(); } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return Operand->getLocEnd();} + SourceLocation getEndLoc() const LLVM_READONLY { return Operand->getEndLoc();} SourceLocation getExprLoc() const LLVM_READONLY { return getSubExpr()->getExprLoc(); @@ -1639,7 +1639,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getSubExpr()->getLocEnd(); + return getSubExpr()->getEndLoc(); } static bool classof(const Stmt *T) { Index: include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h =================================================================== --- include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h +++ include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h @@ -100,7 +100,7 @@ for (++I; I != E; ++I) { Decl *Sibling = *I; if (!SM.isBeforeInTranslationUnit(Sibling->getBeginLoc(), - Child->getLocEnd())) + Child->getEndLoc())) break; if (!BaseType::canIgnoreChildDeclWhileTraversingDeclContext(Sibling)) LexicallyNestedDeclarations.push_back(Sibling); Index: include/clang/AST/Stmt.h =================================================================== --- include/clang/AST/Stmt.h +++ include/clang/AST/Stmt.h @@ -816,7 +816,7 @@ while (const auto *CS2 = dyn_cast(CS->getSubStmt())) CS = CS2; - return CS->getSubStmt()->getLocEnd(); + return CS->getSubStmt()->getEndLoc(); } static bool classof(const Stmt *T) { @@ -852,7 +852,7 @@ SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getLocEnd();} + SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc();} static bool classof(const Stmt *T) { return T->getStmtClass() == DefaultStmtClass; @@ -864,8 +864,8 @@ inline SourceLocation SwitchCase::getEndLoc() const { if (const auto *CS = dyn_cast(this)) - return CS->getLocEnd(); - return cast(this)->getLocEnd(); + return CS->getEndLoc(); + return cast(this)->getEndLoc(); } /// LabelStmt - Represents a label, which has a substatement. For example: @@ -898,7 +898,7 @@ SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getBeginLoc() const LLVM_READONLY { return IdentLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getLocEnd();} + SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc();} child_range children() { return child_range(&SubStmt, &SubStmt+1); } @@ -955,7 +955,7 @@ SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getBeginLoc() const LLVM_READONLY { return AttrLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getLocEnd();} + SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc();} child_range children() { return child_range(&SubStmt, &SubStmt + 1); } @@ -1028,9 +1028,9 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { if (SubExprs[ELSE]) - return SubExprs[ELSE]->getLocEnd(); + return SubExprs[ELSE]->getEndLoc(); else - return SubExprs[THEN]->getLocEnd(); + return SubExprs[THEN]->getEndLoc(); } // Iterators over subexpressions. The iterators will include iterating @@ -1124,7 +1124,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return SubExprs[BODY] ? SubExprs[BODY]->getLocEnd() : SubExprs[COND]->getLocEnd(); + return SubExprs[BODY] ? SubExprs[BODY]->getEndLoc() : SubExprs[COND]->getEndLoc(); } // Iterators @@ -1182,7 +1182,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return SubExprs[BODY]->getLocEnd(); + return SubExprs[BODY]->getEndLoc(); } static bool classof(const Stmt *T) { @@ -1306,7 +1306,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return SubExprs[BODY]->getLocEnd(); + return SubExprs[BODY]->getEndLoc(); } static bool classof(const Stmt *T) { @@ -1390,7 +1390,7 @@ SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getBeginLoc() const LLVM_READONLY { return GotoLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return Target->getLocEnd(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Target->getEndLoc(); } static bool classof(const Stmt *T) { return T->getStmtClass() == IndirectGotoStmtClass; @@ -1502,7 +1502,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return RetExpr ? RetExpr->getLocEnd() : RetLoc; + return RetExpr ? RetExpr->getEndLoc() : RetLoc; } static bool classof(const Stmt *T) { @@ -1976,7 +1976,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getExceptLoc() const { return Loc; } - SourceLocation getEndLoc() const { return getBlock()->getLocEnd(); } + SourceLocation getEndLoc() const { return getBlock()->getEndLoc(); } Expr *getFilterExpr() const { return reinterpret_cast(Children[FILTER_EXPR]); @@ -2015,7 +2015,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getFinallyLoc() const { return Loc; } - SourceLocation getEndLoc() const { return Block->getLocEnd(); } + SourceLocation getEndLoc() const { return Block->getEndLoc(); } CompoundStmt *getBlock() const { return cast(Block); } @@ -2055,7 +2055,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getTryLoc() const { return TryLoc; } - SourceLocation getEndLoc() const { return Children[HANDLER]->getLocEnd(); } + SourceLocation getEndLoc() const { return Children[HANDLER]->getEndLoc(); } bool getIsCXXTry() const { return IsCXXTry; } @@ -2315,7 +2315,7 @@ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getCapturedStmt()->getLocEnd(); + return getCapturedStmt()->getEndLoc(); } SourceRange getSourceRange() const LLVM_READONLY { Index: include/clang/AST/StmtCXX.h =================================================================== --- include/clang/AST/StmtCXX.h +++ include/clang/AST/StmtCXX.h @@ -45,7 +45,7 @@ SourceLocation getBeginLoc() const LLVM_READONLY { return CatchLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return HandlerBlock->getLocEnd(); + return HandlerBlock->getEndLoc(); } SourceLocation getCatchLoc() const { return CatchLoc; } @@ -94,7 +94,7 @@ SourceLocation getTryLoc() const { return TryLoc; } SourceLocation getEndLoc() const { - return getStmts()[NumHandlers]->getLocEnd(); + return getStmts()[NumHandlers]->getEndLoc(); } CompoundStmt *getTryBlock() { @@ -201,7 +201,7 @@ SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return SubExprs[BODY]->getLocEnd(); + return SubExprs[BODY]->getEndLoc(); } static bool classof(const Stmt *T) { @@ -288,7 +288,7 @@ SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getLocEnd();} + SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc();} child_range children() { return child_range(&SubStmt, &SubStmt+1); @@ -413,7 +413,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getBody() ? getBody()->getLocEnd() : getPromiseDecl()->getLocEnd(); + return getBody() ? getBody()->getEndLoc() : getPromiseDecl()->getEndLoc(); } child_range children() { @@ -477,7 +477,7 @@ SourceLocation getBeginLoc() const LLVM_READONLY { return CoreturnLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getOperand() ? getOperand()->getLocEnd() : getBeginLoc(); + return getOperand() ? getOperand()->getEndLoc() : getBeginLoc(); } child_range children() { Index: include/clang/AST/StmtDataCollectors.td =================================================================== --- include/clang/AST/StmtDataCollectors.td +++ include/clang/AST/StmtDataCollectors.td @@ -4,7 +4,7 @@ // This ensures that non-macro-generated code isn't identical to // macro-generated code. addData(data_collection::getMacroStack(S->getBeginLoc(), Context)); - addData(data_collection::getMacroStack(S->getLocEnd(), Context)); + addData(data_collection::getMacroStack(S->getEndLoc(), Context)); }]; } Index: include/clang/AST/StmtObjC.h =================================================================== --- include/clang/AST/StmtObjC.h +++ include/clang/AST/StmtObjC.h @@ -59,7 +59,7 @@ SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return SubExprs[BODY]->getLocEnd(); + return SubExprs[BODY]->getEndLoc(); } static bool classof(const Stmt *T) { @@ -109,7 +109,7 @@ SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getBeginLoc() const LLVM_READONLY { return AtCatchLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return Body->getLocEnd(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Body->getEndLoc(); } bool hasEllipsis() const { return getCatchParamDecl() == nullptr; } @@ -141,7 +141,7 @@ SourceLocation getBeginLoc() const LLVM_READONLY { return AtFinallyLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return AtFinallyStmt->getLocEnd(); + return AtFinallyStmt->getEndLoc(); } SourceLocation getAtFinallyLoc() const { return AtFinallyLoc; } @@ -307,7 +307,7 @@ SourceLocation getBeginLoc() const LLVM_READONLY { return AtSynchronizedLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getSynchBody()->getLocEnd(); + return getSynchBody()->getEndLoc(); } static bool classof(const Stmt *T) { @@ -343,7 +343,7 @@ SourceLocation getBeginLoc() const LLVM_READONLY { return AtThrowLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return Throw ? Throw->getLocEnd() : AtThrowLoc; + return Throw ? Throw->getEndLoc() : AtThrowLoc; } static bool classof(const Stmt *T) { @@ -372,7 +372,7 @@ SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getLocEnd();} + SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc();} SourceLocation getAtLoc() const { return AtLoc; } void setAtLoc(SourceLocation Loc) { AtLoc = Loc; } Index: include/clang/Sema/Initialization.h =================================================================== --- include/clang/Sema/Initialization.h +++ include/clang/Sema/Initialization.h @@ -673,8 +673,8 @@ if (!Init) return CreateDefault(Loc); if (!DirectInit) return CreateCopy(Loc, Init->getBeginLoc()); if (isa(Init)) - return CreateDirectList(Loc, Init->getBeginLoc(), Init->getLocEnd()); - return CreateDirect(Loc, Init->getBeginLoc(), Init->getLocEnd()); + return CreateDirectList(Loc, Init->getBeginLoc(), Init->getEndLoc()); + return CreateDirect(Loc, Init->getBeginLoc(), Init->getEndLoc()); } /// Determine the initialization kind. Index: include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h @@ -752,7 +752,7 @@ ProgramStateRef St, const LocationContext *LCtx) : CXXInstanceCall(DD, St, LCtx) { Data = DtorDataTy(Target, IsBaseDestructor).getOpaqueValue(); - Location = Trigger->getLocEnd(); + Location = Trigger->getEndLoc(); } CXXDestructorCall(const CXXDestructorCall &Other) = default; Index: include/clang/Tooling/Refactoring/RecursiveSymbolVisitor.h =================================================================== --- include/clang/Tooling/Refactoring/RecursiveSymbolVisitor.h +++ include/clang/Tooling/Refactoring/RecursiveSymbolVisitor.h @@ -74,7 +74,7 @@ for (unsigned I = 0, E = S->getNumComponents(); I != E; ++I) { const OffsetOfNode &Component = S->getComponent(I); if (Component.getKind() == OffsetOfNode::Field) { - if (!visit(Component.getField(), Component.getLocEnd())) + if (!visit(Component.getField(), Component.getEndLoc())) return false; } // FIXME: Try to resolve dependent field references. Index: lib/ARCMigrate/ObjCMT.cpp =================================================================== --- lib/ARCMigrate/ObjCMT.cpp +++ lib/ARCMigrate/ObjCMT.cpp @@ -261,7 +261,7 @@ if (IsGetter) { // Find space location range between receiver expression and getter method. SourceLocation BegLoc = - ReceiverIsSuper ? Msg->getSuperLoc() : receiver->getLocEnd(); + ReceiverIsSuper ? Msg->getSuperLoc() : receiver->getEndLoc(); BegLoc = PP.getLocForEndOfToken(BegLoc); SourceLocation EndLoc = Msg->getSelectorLoc(0); SourceRange SpaceRange(BegLoc, EndLoc); @@ -291,7 +291,7 @@ if (!RHS) return false; SourceLocation BegLoc = - ReceiverIsSuper ? Msg->getSuperLoc() : receiver->getLocEnd(); + ReceiverIsSuper ? Msg->getSuperLoc() : receiver->getEndLoc(); BegLoc = PP.getLocForEndOfToken(BegLoc); SourceLocation EndLoc = RHS->getBeginLoc(); EndLoc = EndLoc.getLocWithOffset(-1); @@ -722,7 +722,7 @@ ClassString += ')'; SourceRange R(EnumDcl->getBeginLoc(), EnumDcl->getBeginLoc()); commit.replace(R, ClassString); - SourceLocation EndOfEnumDclLoc = EnumDcl->getLocEnd(); + SourceLocation EndOfEnumDclLoc = EnumDcl->getEndLoc(); EndOfEnumDclLoc = trans::findSemiAfterLocation(EndOfEnumDclLoc, NS.getASTContext(), /*IsDecl*/true); if (EndOfEnumDclLoc.isValid()) { @@ -732,7 +732,7 @@ else return false; - SourceLocation EndTypedefDclLoc = TypedefDcl->getLocEnd(); + SourceLocation EndTypedefDclLoc = TypedefDcl->getEndLoc(); EndTypedefDclLoc = trans::findSemiAfterLocation(EndTypedefDclLoc, NS.getASTContext(), /*IsDecl*/true); if (EndTypedefDclLoc.isValid()) { @@ -742,7 +742,7 @@ else return false; - EndOfEnumDclLoc = trans::findLocationAfterSemi(EnumDcl->getLocEnd(), NS.getASTContext(), + EndOfEnumDclLoc = trans::findLocationAfterSemi(EnumDcl->getEndLoc(), NS.getASTContext(), /*IsDecl*/true); if (EndOfEnumDclLoc.isValid()) { SourceLocation BeginOfEnumDclLoc = EnumDcl->getBeginLoc(); @@ -778,9 +778,9 @@ CharSourceRange R = CharSourceRange::getCharRange(EnumDcl->getBeginLoc(), EndLoc); commit.replace(R, ClassString); // This is to remove spaces between '}' and typedef name. - SourceLocation StartTypedefLoc = EnumDcl->getLocEnd(); + SourceLocation StartTypedefLoc = EnumDcl->getEndLoc(); StartTypedefLoc = StartTypedefLoc.getLocWithOffset(+1); - SourceLocation EndTypedefLoc = TypedefDcl->getLocEnd(); + SourceLocation EndTypedefLoc = TypedefDcl->getEndLoc(); commit.remove(SourceRange(StartTypedefLoc, EndTypedefLoc)); } @@ -811,7 +811,7 @@ } if (AllHexdecimalEnumerator && EnumVal) { bool FoundHexdecimalEnumerator = false; - SourceLocation EndLoc = Enumerator->getLocEnd(); + SourceLocation EndLoc = Enumerator->getEndLoc(); Token Tok; if (!PP.getRawToken(EndLoc, Tok, /*IgnoreWhiteSpace=*/true)) if (Tok.isLiteral() && Tok.getLength() > 2) { @@ -1257,7 +1257,7 @@ return; edit::Commit commit(*Editor); - commit.insertBefore(OM->getLocEnd(), " NS_RETURNS_INNER_POINTER"); + commit.insertBefore(OM->getEndLoc(), " NS_RETURNS_INNER_POINTER"); Editor->commit(commit); } @@ -1269,7 +1269,7 @@ !NSAPIObj->isMacroDefined("NS_RETURNS_INNER_POINTER")) return; edit::Commit commit(*Editor); - commit.insertBefore(P->getLocEnd(), " NS_RETURNS_INNER_POINTER "); + commit.insertBefore(P->getEndLoc(), " NS_RETURNS_INNER_POINTER "); Editor->commit(commit); } @@ -1397,7 +1397,7 @@ edit::Commit commit(*Editor); commit.insertBefore(FirstFD->getBeginLoc(), PragmaString); PragmaString = "\n\nCF_IMPLICIT_BRIDGING_DISABLED\n"; - SourceLocation EndLoc = LastFD->getLocEnd(); + SourceLocation EndLoc = LastFD->getEndLoc(); // get location just past end of function location. EndLoc = PP.getLocForEndOfToken(EndLoc); if (isa(LastFD)) { @@ -1472,7 +1472,7 @@ if (AnnotationString) { edit::Commit commit(*Editor); - commit.insertAfterToken(FuncDecl->getLocEnd(), AnnotationString); + commit.insertAfterToken(FuncDecl->getEndLoc(), AnnotationString); Editor->commit(commit); } } @@ -1598,7 +1598,7 @@ if (AnnotationString) { edit::Commit commit(*Editor); - commit.insertBefore(MethodDecl->getLocEnd(), AnnotationString); + commit.insertBefore(MethodDecl->getEndLoc(), AnnotationString); Editor->commit(commit); } } @@ -1636,7 +1636,7 @@ MethodDecl->getMethodFamily() != OMF_release && NSAPIObj->isMacroDefined("NS_CONSUMES_SELF")) { edit::Commit commit(*Editor); - commit.insertBefore(MethodDecl->getLocEnd(), " NS_CONSUMES_SELF"); + commit.insertBefore(MethodDecl->getEndLoc(), " NS_CONSUMES_SELF"); Editor->commit(commit); } @@ -1713,7 +1713,7 @@ continue; if (hasSuperInitCall(MD)) { edit::Commit commit(*Editor); - commit.insert(IFaceM->getLocEnd(), " NS_DESIGNATED_INITIALIZER"); + commit.insert(IFaceM->getEndLoc(), " NS_DESIGNATED_INITIALIZER"); Editor->commit(commit); } } Index: lib/ARCMigrate/TransAutoreleasePool.cpp =================================================================== --- lib/ARCMigrate/TransAutoreleasePool.cpp +++ lib/ARCMigrate/TransAutoreleasePool.cpp @@ -128,7 +128,7 @@ Pass.TA.removeStmt(*scope.End); Stmt::child_iterator retI = scope.End; ++retI; - SourceLocation afterSemi = findLocationAfterSemi((*retI)->getLocEnd(), + SourceLocation afterSemi = findLocationAfterSemi((*retI)->getEndLoc(), Pass.Ctx); assert(afterSemi.isValid() && "Didn't we check before setting IsFollowedBySimpleReturnStmt " @@ -136,7 +136,7 @@ Pass.TA.insertAfterToken(afterSemi, "\n}"); Pass.TA.increaseIndentation( SourceRange(scope.getIndentedRange().getBegin(), - (*retI)->getLocEnd()), + (*retI)->getEndLoc()), scope.CompoundParent->getBeginLoc()); } else { Pass.TA.replaceStmt(*scope.Begin, "@autoreleasepool {"); @@ -241,7 +241,7 @@ Stmt::child_iterator rangeE = Begin; for (Stmt::child_iterator I = rangeS; I != End; ++I) ++rangeE; - return SourceRange((*rangeS)->getBeginLoc(), (*rangeE)->getLocEnd()); + return SourceRange((*rangeS)->getBeginLoc(), (*rangeE)->getEndLoc()); } }; @@ -307,7 +307,7 @@ if (ReturnStmt *retS = dyn_cast(*SI)) if ((retS->getRetValue() == nullptr || isa(retS->getRetValue()->IgnoreParenCasts())) && - findLocationAfterSemi(retS->getLocEnd(), Pass.Ctx).isValid()) { + findLocationAfterSemi(retS->getEndLoc(), Pass.Ctx).isValid()) { scope.IsFollowedBySimpleReturnStmt = true; ++SI; // the return will be included in scope, don't check it. } Index: lib/ARCMigrate/TransProtectedScope.cpp =================================================================== --- lib/ARCMigrate/TransProtectedScope.cpp +++ lib/ARCMigrate/TransProtectedScope.cpp @@ -73,7 +73,7 @@ Curr = Curr->getNextSwitchCase(); } - SourceLocation NextLoc = S->getLocEnd(); + SourceLocation NextLoc = S->getEndLoc(); Curr = S->getSwitchCaseList(); // We iterate over case statements in reverse source-order. while (Curr) { Index: lib/ARCMigrate/TransUnbridgedCasts.cpp =================================================================== --- lib/ARCMigrate/TransUnbridgedCasts.cpp +++ lib/ARCMigrate/TransUnbridgedCasts.cpp @@ -243,7 +243,7 @@ } else { newCast += '('; TA.insert(insertLoc, newCast.str()); - TA.insertAfterToken(E->getLocEnd(), ")"); + TA.insertAfterToken(E->getEndLoc(), ")"); } } } else { @@ -268,7 +268,7 @@ } else { BridgeCall += '('; TA.insert(InsertLoc, BridgeCall); - TA.insertAfterToken(WrapE->getLocEnd(), ")"); + TA.insertAfterToken(WrapE->getEndLoc(), ")"); } } } Index: lib/AST/ASTDumper.cpp =================================================================== --- lib/AST/ASTDumper.cpp +++ lib/AST/ASTDumper.cpp @@ -2032,7 +2032,7 @@ << ClauseName.drop_front() << "Clause"; } dumpPointer(C); - dumpSourceRange(SourceRange(C->getBeginLoc(), C->getLocEnd())); + dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc())); if (C->isImplicit()) OS << " "; for (auto *S : C->children()) Index: lib/AST/ASTImporter.cpp =================================================================== --- lib/AST/ASTImporter.cpp +++ lib/AST/ASTImporter.cpp @@ -2726,7 +2726,7 @@ ToFunction->setVirtualAsWritten(D->isVirtualAsWritten()); ToFunction->setTrivial(D->isTrivial()); ToFunction->setPure(D->isPure()); - ToFunction->setRangeEnd(Importer.Import(D->getLocEnd())); + ToFunction->setRangeEnd(Importer.Import(D->getEndLoc())); // Set the parameters. for (auto *Param : Parameters) { @@ -3393,7 +3393,7 @@ ObjCMethodDecl *ToMethod; if (GetImportedOrCreateDecl( ToMethod, D, Importer.getToContext(), Loc, - Importer.Import(D->getLocEnd()), Name.getObjCSelector(), ResultTy, + Importer.Import(D->getEndLoc()), Name.getObjCSelector(), ResultTy, ReturnTInfo, DC, D->isInstanceMethod(), D->isVariadic(), D->isPropertyAccessor(), D->isImplicit(), D->isDefined(), D->getImplementationControl(), D->hasRelatedResultType())) @@ -5834,7 +5834,7 @@ return new (Importer.getToContext()) ArrayTypeTraitExpr( Importer.Import(E->getBeginLoc()), E->getTrait(), ToQueried, - E->getValue(), Dim, Importer.Import(E->getLocEnd()), T); + E->getValue(), Dim, Importer.Import(E->getEndLoc()), T); } Expr *ASTNodeImporter::VisitExpressionTraitExpr(ExpressionTraitExpr *E) { @@ -5848,7 +5848,7 @@ return new (Importer.getToContext()) ExpressionTraitExpr( Importer.Import(E->getBeginLoc()), E->getTrait(), ToQueried, - E->getValue(), Importer.Import(E->getLocEnd()), T); + E->getValue(), Importer.Import(E->getEndLoc()), T); } Expr *ASTNodeImporter::VisitOpaqueValueExpr(OpaqueValueExpr *E) { @@ -6034,7 +6034,7 @@ case OffsetOfNode::Array: Nodes.push_back(OffsetOfNode(Importer.Import(Node.getBeginLoc()), Node.getArrayExprIndex(), - Importer.Import(Node.getLocEnd()))); + Importer.Import(Node.getEndLoc()))); break; case OffsetOfNode::Base: { @@ -6049,7 +6049,7 @@ if (!FD) return nullptr; Nodes.push_back(OffsetOfNode(Importer.Import(Node.getBeginLoc()), FD, - Importer.Import(Node.getLocEnd()))); + Importer.Import(Node.getEndLoc()))); break; } case OffsetOfNode::Identifier: { @@ -6057,7 +6057,7 @@ if (!ToII) return nullptr; Nodes.push_back(OffsetOfNode(Importer.Import(Node.getBeginLoc()), ToII, - Importer.Import(Node.getLocEnd()))); + Importer.Import(Node.getEndLoc()))); break; } } @@ -6098,7 +6098,7 @@ return new (Importer.getToContext()) CXXNoexceptExpr( T, Operand, CanThrow, - Importer.Import(E->getBeginLoc()), Importer.Import(E->getLocEnd())); + Importer.Import(E->getBeginLoc()), Importer.Import(E->getEndLoc())); } Expr *ASTNodeImporter::VisitCXXThrowExpr(CXXThrowExpr *E) { @@ -6713,7 +6713,7 @@ LE->hasExplicitParameters(), LE->hasExplicitResultType(), InitCaptures, - Importer.Import(LE->getLocEnd()), + Importer.Import(LE->getEndLoc()), LE->containsUnexpandedParameterPack()); } @@ -6893,7 +6893,7 @@ return TypeTraitExpr::Create( Importer.getToContext(), ToType, Importer.Import(E->getBeginLoc()), - E->getTrait(), ToArgs, Importer.Import(E->getLocEnd()), ToValue); + E->getTrait(), ToArgs, Importer.Import(E->getEndLoc()), ToValue); } Expr *ASTNodeImporter::VisitCXXTypeidExpr(CXXTypeidExpr *E) { Index: lib/AST/CommentSema.cpp =================================================================== --- lib/AST/CommentSema.cpp +++ lib/AST/CommentSema.cpp @@ -703,9 +703,9 @@ SmallString<64> TextToInsert(" "); TextToInsert += AttributeSpelling; - Diag(FD->getLocEnd(), + Diag(FD->getEndLoc(), diag::note_add_deprecation_attr) - << FixItHint::CreateInsertion(FD->getLocEnd().getLocWithOffset(1), + << FixItHint::CreateInsertion(FD->getEndLoc().getLocWithOffset(1), TextToInsert); } } Index: lib/AST/Decl.cpp =================================================================== --- lib/AST/Decl.cpp +++ lib/AST/Decl.cpp @@ -1937,7 +1937,7 @@ SourceRange VarDecl::getSourceRange() const { if (const Expr *Init = getInit()) { - SourceLocation InitEnd = Init->getLocEnd(); + SourceLocation InitEnd = Init->getEndLoc(); // If Init is implicit, ignore its source range and fallback on // DeclaratorDecl::getSourceRange() to handle postfix elements. if (InitEnd.isValid() && InitEnd != getLocation()) @@ -2672,7 +2672,7 @@ void FunctionDecl::setBody(Stmt *B) { Body = B; if (B) - EndRangeLoc = B->getLocEnd(); + EndRangeLoc = B->getEndLoc(); } void FunctionDecl::setPure(bool P) { @@ -3749,7 +3749,7 @@ if (!FinalExpr) FinalExpr = getBitWidth(); if (FinalExpr) - return SourceRange(getInnerLocStart(), FinalExpr->getLocEnd()); + return SourceRange(getInnerLocStart(), FinalExpr->getEndLoc()); return DeclaratorDecl::getSourceRange(); } @@ -4182,7 +4182,7 @@ } SourceRange BlockDecl::getSourceRange() const { - return SourceRange(getLocation(), Body? Body->getLocEnd() : getLocation()); + return SourceRange(getLocation(), Body? Body->getEndLoc() : getLocation()); } //===----------------------------------------------------------------------===// @@ -4398,7 +4398,7 @@ SourceRange EnumConstantDecl::getSourceRange() const { SourceLocation End = getLocation(); if (Init) - End = Init->getLocEnd(); + End = Init->getEndLoc(); return SourceRange(getLocation(), End); } Index: lib/AST/DeclObjC.cpp =================================================================== --- lib/AST/DeclObjC.cpp +++ lib/AST/DeclObjC.cpp @@ -933,7 +933,7 @@ SourceLocation ObjCMethodDecl::getEndLoc() const { if (Stmt *Body = getBody()) - return Body->getLocEnd(); + return Body->getEndLoc(); return DeclEndLoc; } Index: lib/AST/DeclOpenMP.cpp =================================================================== --- lib/AST/DeclOpenMP.cpp +++ lib/AST/DeclOpenMP.cpp @@ -104,5 +104,5 @@ SourceRange OMPCapturedExprDecl::getSourceRange() const { assert(hasInit()); - return SourceRange(getInit()->getBeginLoc(), getInit()->getLocEnd()); + return SourceRange(getInit()->getBeginLoc(), getInit()->getEndLoc()); } Index: lib/AST/Expr.cpp =================================================================== --- lib/AST/Expr.cpp +++ lib/AST/Expr.cpp @@ -192,7 +192,7 @@ // Amusing macro metaprogramming hack: check whether a class provides // a more specific implementation of getExprLoc(). // -// See also Stmt.cpp:{getBeginLoc(),getLocEnd()}. +// See also Stmt.cpp:{getBeginLoc(),getEndLoc()}. namespace { /// This implementation is used when a class provides a custom /// implementation of getExprLoc. @@ -455,7 +455,7 @@ SourceLocation DeclRefExpr::getEndLoc() const { if (hasExplicitTemplateArgs()) return getRAngleLoc(); - return getNameInfo().getLocEnd(); + return getNameInfo().getEndLoc(); } PredefinedExpr::PredefinedExpr(SourceLocation L, QualType FNTy, IdentType IT, @@ -1369,11 +1369,11 @@ } SourceLocation CallExpr::getEndLoc() const { if (isa(this)) - return cast(this)->getLocEnd(); + return cast(this)->getEndLoc(); SourceLocation end = getRParenLoc(); if (end.isInvalid() && getNumArgs() > 0 && getArg(getNumArgs() - 1)) - end = getArg(getNumArgs() - 1)->getLocEnd(); + end = getArg(getNumArgs() - 1)->getEndLoc(); return end; } @@ -1548,7 +1548,7 @@ if (hasExplicitTemplateArgs()) EndLoc = getRAngleLoc(); else if (EndLoc.isInvalid()) - EndLoc = getBase()->getLocEnd(); + EndLoc = getBase()->getEndLoc(); return EndLoc; } @@ -2036,7 +2036,7 @@ SourceLocation InitListExpr::getEndLoc() const { if (InitListExpr *SyntacticForm = getSyntacticForm()) - return SyntacticForm->getLocEnd(); + return SyntacticForm->getEndLoc(); SourceLocation End = RBraceLoc; if (End.isInvalid()) { // Find the first non-null initializer from the end. @@ -2044,7 +2044,7 @@ E = InitExprs.rend(); I != E; ++I) { if (Stmt *S = *I) { - End = S->getLocEnd(); + End = S->getEndLoc(); break; } } @@ -2256,7 +2256,7 @@ if (unsigned NumArgs = CE->getNumArgs()) R2 = SourceRange(CE->getArg(0)->getBeginLoc(), - CE->getArg(NumArgs-1)->getLocEnd()); + CE->getArg(NumArgs-1)->getEndLoc()); return true; } } @@ -3844,7 +3844,7 @@ if (size() == 1) return DIE->getDesignator(0)->getSourceRange(); return SourceRange(DIE->getDesignator(0)->getBeginLoc(), - DIE->getDesignator(size()-1)->getLocEnd()); + DIE->getDesignator(size()-1)->getEndLoc()); } SourceLocation DesignatedInitExpr::getBeginLoc() const { @@ -3863,7 +3863,7 @@ } SourceLocation DesignatedInitExpr::getEndLoc() const { - return getInit()->getLocEnd(); + return getInit()->getEndLoc(); } Expr *DesignatedInitExpr::getArrayIndex(const Designator& D) const { @@ -3926,7 +3926,7 @@ } SourceLocation DesignatedInitUpdateExpr::getEndLoc() const { - return getBase()->getLocEnd(); + return getBase()->getEndLoc(); } ParenListExpr::ParenListExpr(const ASTContext& C, SourceLocation lparenloc, Index: lib/AST/ExprCXX.cpp =================================================================== --- lib/AST/ExprCXX.cpp +++ lib/AST/ExprCXX.cpp @@ -458,7 +458,7 @@ SourceLocation CXXConstructExpr::getEndLoc() const { if (isa(this)) - return cast(this)->getLocEnd(); + return cast(this)->getEndLoc(); if (ParenOrBraceRange.isValid()) return ParenOrBraceRange.getEnd(); @@ -467,7 +467,7 @@ for (unsigned I = getNumArgs(); I > 0; --I) { const Expr *Arg = getArg(I-1); if (!Arg->isDefaultArgument()) { - SourceLocation NewEnd = Arg->getLocEnd(); + SourceLocation NewEnd = Arg->getEndLoc(); if (NewEnd.isValid()) { End = NewEnd; break; @@ -483,7 +483,7 @@ if (Kind == OO_PlusPlus || Kind == OO_MinusMinus) { if (getNumArgs() == 1) // Prefix operator - return SourceRange(getOperatorLoc(), getArg(0)->getLocEnd()); + return SourceRange(getOperatorLoc(), getArg(0)->getEndLoc()); else // Postfix operator return SourceRange(getArg(0)->getBeginLoc(), getOperatorLoc()); @@ -494,9 +494,9 @@ } else if (Kind == OO_Subscript) { return SourceRange(getArg(0)->getBeginLoc(), getRParenLoc()); } else if (getNumArgs() == 1) { - return SourceRange(getOperatorLoc(), getArg(0)->getLocEnd()); + return SourceRange(getOperatorLoc(), getArg(0)->getEndLoc()); } else if (getNumArgs() == 2) { - return SourceRange(getArg(0)->getBeginLoc(), getArg(1)->getLocEnd()); + return SourceRange(getArg(0)->getBeginLoc(), getArg(1)->getEndLoc()); } else { return getOperatorLoc(); } @@ -696,7 +696,7 @@ } SourceLocation CXXFunctionalCastExpr::getEndLoc() const { - return RParenLoc.isValid() ? RParenLoc : getSubExpr()->getLocEnd(); + return RParenLoc.isValid() ? RParenLoc : getSubExpr()->getEndLoc(); } UserDefinedLiteral::LiteralOperatorKind @@ -783,7 +783,7 @@ SourceLocation CXXTemporaryObjectExpr::getEndLoc() const { SourceLocation Loc = getParenOrBraceRange().getEnd(); if (Loc.isInvalid() && getNumArgs()) - Loc = getArg(getNumArgs()-1)->getLocEnd(); + Loc = getArg(getNumArgs()-1)->getEndLoc(); return Loc; } Index: lib/AST/ExprConstant.cpp =================================================================== --- lib/AST/ExprConstant.cpp +++ lib/AST/ExprConstant.cpp @@ -4404,7 +4404,7 @@ if (ESR == ESR_Succeeded) { if (Callee->getReturnType()->isVoidType()) return true; - Info.FFDiag(Callee->getLocEnd(), diag::note_constexpr_no_return); + Info.FFDiag(Callee->getEndLoc(), diag::note_constexpr_no_return); } return ESR == ESR_Returned; } Index: lib/AST/RawCommentList.cpp =================================================================== --- lib/AST/RawCommentList.cpp +++ lib/AST/RawCommentList.cpp @@ -316,9 +316,9 @@ (C1.isTrailingComment() && !C2.isTrailingComment() && isOrdinaryKind(C2.getKind()) && commentsStartOnSameColumn(SourceMgr, C1, C2))) && - onlyWhitespaceBetween(SourceMgr, C1.getLocEnd(), C2.getBeginLoc(), + onlyWhitespaceBetween(SourceMgr, C1.getEndLoc(), C2.getBeginLoc(), /*MaxNewlinesAllowed=*/1)) { - SourceRange MergedRange(C1.getBeginLoc(), C2.getLocEnd()); + SourceRange MergedRange(C1.getBeginLoc(), C2.getEndLoc()); *Comments.back() = RawComment(SourceMgr, MergedRange, CommentOpts, true); } else { Comments.push_back(new (Allocator) RawComment(RC)); Index: lib/AST/Stmt.cpp =================================================================== --- lib/AST/Stmt.cpp +++ lib/AST/Stmt.cpp @@ -195,11 +195,11 @@ } typedef SourceLocation getLocEnd_t() const; - template good implements_getLocEnd(getLocEnd_t T::*) { + template good implements_getEndLoc(getLocEnd_t T::*) { return good(); } LLVM_ATTRIBUTE_UNUSED - static bad implements_getLocEnd(getLocEnd_t Stmt::*) { + static bad implements_getEndLoc(getLocEnd_t Stmt::*) { return bad(); } @@ -207,8 +207,8 @@ (void) is_good(implements_children(&type::children)) #define ASSERT_IMPLEMENTS_getBeginLoc(type) \ (void) is_good(implements_getBeginLoc(&type::getBeginLoc)) -#define ASSERT_IMPLEMENTS_getLocEnd(type) \ - (void) is_good(implements_getLocEnd(&type::getLocEnd)) +#define ASSERT_IMPLEMENTS_getEndLoc(type) \ + (void) is_good(implements_getEndLoc(&type::getEndLoc)) } // namespace @@ -220,7 +220,7 @@ #define STMT(type, base) \ ASSERT_IMPLEMENTS_children(type); \ ASSERT_IMPLEMENTS_getBeginLoc(type); \ - ASSERT_IMPLEMENTS_getLocEnd(type); + ASSERT_IMPLEMENTS_getEndLoc(type); #include "clang/AST/StmtNodes.inc" } @@ -258,7 +258,7 @@ SourceRange getSourceRangeImpl(const Stmt *stmt, SourceRange (Stmt::*v)() const) { return SourceRange(static_cast(stmt)->getBeginLoc(), - static_cast(stmt)->getLocEnd()); + static_cast(stmt)->getEndLoc()); } } // namespace @@ -294,7 +294,7 @@ #define ABSTRACT_STMT(type) #define STMT(type, base) \ case Stmt::type##Class: \ - return static_cast(this)->getLocEnd(); + return static_cast(this)->getEndLoc(); #include "clang/AST/StmtNodes.inc" } llvm_unreachable("unknown statement kind"); Index: lib/AST/StmtObjC.cpp =================================================================== --- lib/AST/StmtObjC.cpp +++ lib/AST/StmtObjC.cpp @@ -66,8 +66,8 @@ SourceLocation ObjCAtTryStmt::getEndLoc() const { if (HasFinally) - return getFinallyStmt()->getLocEnd(); + return getFinallyStmt()->getEndLoc(); if (NumCatchStmts) - return getCatchStmt(NumCatchStmts - 1)->getLocEnd(); - return getTryBody()->getLocEnd(); + return getCatchStmt(NumCatchStmts - 1)->getEndLoc(); + return getTryBody()->getEndLoc(); } Index: lib/Analysis/CloneDetection.cpp =================================================================== --- lib/Analysis/CloneDetection.cpp +++ lib/Analysis/CloneDetection.cpp @@ -81,7 +81,7 @@ return front()->getBeginLoc(); } -SourceLocation StmtSequence::getEndLoc() const { return back()->getLocEnd(); } +SourceLocation StmtSequence::getEndLoc() const { return back()->getEndLoc(); } SourceRange StmtSequence::getSourceRange() const { return SourceRange(getBeginLoc(), getEndLoc()); Index: lib/Analysis/Consumed.cpp =================================================================== --- lib/Analysis/Consumed.cpp +++ lib/Analysis/Consumed.cpp @@ -1363,7 +1363,7 @@ case CFGElement::AutomaticObjectDtor: { const CFGAutomaticObjDtor &DTor = B.castAs(); - SourceLocation Loc = DTor.getTriggerStmt()->getLocEnd(); + SourceLocation Loc = DTor.getTriggerStmt()->getEndLoc(); const VarDecl *Var = DTor.getVarDecl(); Visitor.checkCallability(PropagationInfo(Var), Index: lib/Analysis/ThreadSafety.cpp =================================================================== --- lib/Analysis/ThreadSafety.cpp +++ lib/Analysis/ThreadSafety.cpp @@ -2396,7 +2396,7 @@ // Create a dummy expression, auto *VD = const_cast(AD.getVarDecl()); DeclRefExpr DRE(VD, false, VD->getType().getNonReferenceType(), - VK_LValue, AD.getTriggerStmt()->getLocEnd()); + VK_LValue, AD.getTriggerStmt()->getEndLoc()); LocksetBuilder.handleCall(&DRE, DD); break; } Index: lib/CodeGen/CGBlocks.cpp =================================================================== --- lib/CodeGen/CGBlocks.cpp +++ lib/CodeGen/CGBlocks.cpp @@ -1314,7 +1314,7 @@ CurGD = GD; - CurEHLocation = blockInfo.getBlockExpr()->getLocEnd(); + CurEHLocation = blockInfo.getBlockExpr()->getEndLoc(); BlockInfo = &blockInfo; Index: lib/CodeGen/CGClass.cpp =================================================================== --- lib/CodeGen/CGClass.cpp +++ lib/CodeGen/CGClass.cpp @@ -829,7 +829,7 @@ // delegation optimization. if (CtorType == Ctor_Complete && IsConstructorDelegationValid(Ctor) && CGM.getTarget().getCXXABI().hasConstructorVariants()) { - EmitDelegateCXXConstructorCall(Ctor, Ctor_Base, Args, Ctor->getLocEnd()); + EmitDelegateCXXConstructorCall(Ctor, Ctor_Base, Args, Ctor->getEndLoc()); return; } Index: lib/CodeGen/CGException.cpp =================================================================== --- lib/CodeGen/CGException.cpp +++ lib/CodeGen/CGException.cpp @@ -1893,7 +1893,7 @@ FilterExpr->getType()->isSignedIntegerType()); Builder.CreateStore(R, ReturnValue); - FinishFunction(FilterExpr->getLocEnd()); + FinishFunction(FilterExpr->getEndLoc()); return CurFn; } @@ -1907,7 +1907,7 @@ // Emit the original filter expression, convert to i32, and return. EmitStmt(FinallyBlock); - FinishFunction(FinallyBlock->getLocEnd()); + FinishFunction(FinallyBlock->getEndLoc()); return CurFn; } Index: lib/CodeGen/CGObjC.cpp =================================================================== --- lib/CodeGen/CGObjC.cpp +++ lib/CodeGen/CGObjC.cpp @@ -548,7 +548,7 @@ args.append(OMD->param_begin(), OMD->param_end()); CurGD = OMD; - CurEHLocation = OMD->getLocEnd(); + CurEHLocation = OMD->getEndLoc(); StartFunction(OMD, OMD->getReturnType(), Fn, FI, args, OMD->getLocation(), StartLoc); Index: lib/CodeGen/CGOpenMPRuntime.cpp =================================================================== --- lib/CodeGen/CGOpenMPRuntime.cpp +++ lib/CodeGen/CGOpenMPRuntime.cpp @@ -8820,7 +8820,7 @@ llvm::Value *RTLFn = createRuntimeFunction(OMPRTL__kmpc_doacross_init); CGF.EmitRuntimeCall(RTLFn, Args); llvm::Value *FiniArgs[DoacrossCleanupTy::DoacrossFinArgs] = { - emitUpdateLocation(CGF, D.getLocEnd()), getThreadID(CGF, D.getLocEnd())}; + emitUpdateLocation(CGF, D.getEndLoc()), getThreadID(CGF, D.getEndLoc())}; llvm::Value *FiniRTLFn = createRuntimeFunction(OMPRTL__kmpc_doacross_fini); CGF.EHStack.pushCleanup(NormalAndEHCleanup, FiniRTLFn, llvm::makeArrayRef(FiniArgs)); Index: lib/CodeGen/CGStmtOpenMP.cpp =================================================================== --- lib/CodeGen/CGStmtOpenMP.cpp +++ lib/CodeGen/CGStmtOpenMP.cpp @@ -1183,7 +1183,7 @@ // Emit nowait reduction if nowait clause is present or directive is a // parallel directive (it always has implicit barrier). CGM.getOpenMPRuntime().emitReduction( - *this, D.getLocEnd(), Privates, LHSExprs, RHSExprs, ReductionOps, + *this, D.getEndLoc(), Privates, LHSExprs, RHSExprs, ReductionOps, {WithNowait, SimpleReduction, ReductionKind}); } } @@ -1851,7 +1851,7 @@ // Tell the runtime we are done. auto &&CodeGen = [DynamicOrOrdered, &S](CodeGenFunction &CGF) { if (!DynamicOrOrdered) - CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, S.getLocEnd(), + CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, S.getEndLoc(), S.getDirectiveKind()); }; OMPCancelStack.emitExit(*this, S.getDirectiveKind(), CodeGen); @@ -2332,7 +2332,7 @@ EmitBlock(LoopExit.getBlock()); // Tell the runtime we are done. auto &&CodeGen = [&S](CodeGenFunction &CGF) { - CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, S.getLocEnd(), + CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, S.getEndLoc(), S.getDirectiveKind()); }; OMPCancelStack.emitExit(*this, S.getDirectiveKind(), CodeGen); @@ -2565,7 +2565,7 @@ [](CodeGenFunction &) {}); // Tell the runtime we are done. auto &&CodeGen = [&S](CodeGenFunction &CGF) { - CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, S.getLocEnd(), + CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, S.getEndLoc(), S.getDirectiveKind()); }; CGF.OMPCancelStack.emitExit(CGF, S.getDirectiveKind(), CodeGen); Index: lib/CodeGen/CoverageMappingGen.cpp =================================================================== --- lib/CodeGen/CoverageMappingGen.cpp +++ lib/CodeGen/CoverageMappingGen.cpp @@ -213,7 +213,7 @@ /// Get the end of \c S ignoring macro arguments and builtin macros. SourceLocation getEnd(const Stmt *S) { - SourceLocation Loc = S->getLocEnd(); + SourceLocation Loc = S->getEndLoc(); while (SM.isMacroArgExpansion(Loc) || isInBuiltin(Loc)) Loc = SM.getImmediateExpansionRange(Loc).getBegin(); return getPreciseTokenLocEnd(Loc); Index: lib/Edit/RewriteObjCFoundationAPI.cpp =================================================================== --- lib/Edit/RewriteObjCFoundationAPI.cpp +++ lib/Edit/RewriteObjCFoundationAPI.cpp @@ -421,7 +421,7 @@ return true; } SourceRange ArgRange(Msg->getArg(0)->getBeginLoc(), - Msg->getArg(Msg->getNumArgs()-2)->getLocEnd()); + Msg->getArg(Msg->getNumArgs()-2)->getEndLoc()); commit.replaceWithInner(MsgRange, ArgRange); commit.insertWrap("@[", ArgRange, "]"); return true; @@ -551,7 +551,7 @@ // The sentinel and first value are cut off, the value will move after the // key. SourceRange ArgRange(Msg->getArg(1)->getBeginLoc(), - Msg->getArg(SentinelIdx-1)->getLocEnd()); + Msg->getArg(SentinelIdx-1)->getEndLoc()); commit.insertWrap("@{", ArgRange, "}"); commit.replaceWithInner(MsgRange, ArgRange); return true; @@ -592,7 +592,7 @@ // Range of arguments up until and including the last key. // The first value is cut off, the value will move after the key. SourceRange ArgRange(Keys.front()->getBeginLoc(), - Keys.back()->getLocEnd()); + Keys.back()->getEndLoc()); commit.insertWrap("@{", ArgRange, "}"); commit.replaceWithInner(MsgRange, ArgRange); return true; Index: lib/Frontend/Rewrite/RewriteModernObjC.cpp =================================================================== --- lib/Frontend/Rewrite/RewriteModernObjC.cpp +++ lib/Frontend/Rewrite/RewriteModernObjC.cpp @@ -933,7 +933,7 @@ startGetterSetterLoc = startLoc.getLocWithOffset(semiBuf-startBuf+1); } else - startGetterSetterLoc = IMD ? IMD->getLocEnd() : CID->getLocEnd(); + startGetterSetterLoc = IMD ? IMD->getEndLoc() : CID->getEndLoc(); if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic) return; // FIXME: is this correct? @@ -1110,7 +1110,7 @@ if (Method->isImplicit()) return; SourceLocation LocStart = Method->getBeginLoc(); - SourceLocation LocEnd = Method->getLocEnd(); + SourceLocation LocEnd = Method->getEndLoc(); if (SM->getExpansionLineNumber(LocEnd) > SM->getExpansionLineNumber(LocStart)) { @@ -1372,7 +1372,7 @@ for (auto *I : IMD ? IMD->property_impls() : CID->property_impls()) RewritePropertyImplDecl(I, IMD, CID); - InsertText(IMD ? IMD->getLocEnd() : CID->getLocEnd(), "// "); + InsertText(IMD ? IMD->getEndLoc() : CID->getEndLoc(), "// "); } void RewriteModernObjC::RewriteInterfaceDecl(ObjCInterfaceDecl *ClassDecl) { @@ -1880,7 +1880,7 @@ buf += "\n\tid sync_exit;"; buf += "\n\t} _sync_exit(_sync_obj);\n"; - // We can't use S->getSynchExpr()->getLocEnd() to find the end location, since + // We can't use S->getSynchExpr()->getEndLoc() to find the end location, since // the sync expression is typically a message expression that's already // been rewritten! (which implies the SourceLocation's are invalid). SourceLocation RParenExprLoc = S->getSynchBody()->getBeginLoc(); @@ -1893,7 +1893,7 @@ assert (*LBraceLocBuf == '{'); ReplaceText(RParenExprLoc, (LBraceLocBuf - SM->getCharacterData(RParenExprLoc) + 1), buf); - SourceLocation startRBraceLoc = S->getSynchBody()->getLocEnd(); + SourceLocation startRBraceLoc = S->getSynchBody()->getEndLoc(); assert((*SM->getCharacterData(startRBraceLoc) == '}') && "bogus @synchronized block"); @@ -2021,7 +2021,7 @@ Write_RethrowObject(buf); ReplaceText(startFinalBodyLoc, 1, buf); - SourceLocation endFinalBodyLoc = body->getLocEnd(); + SourceLocation endFinalBodyLoc = body->getEndLoc(); ReplaceText(endFinalBodyLoc, 1, "}\n}"); // Now check for any return/continue/go statements within the @try. WarnAboutReturnGotoStmts(S->getTryBody()); @@ -2052,7 +2052,7 @@ assert((*wBuf == 'w') && "@throw: can't find 'w'"); ReplaceText(startLoc, wBuf-startBuf+1, buf); - SourceLocation endLoc = S->getLocEnd(); + SourceLocation endLoc = S->getEndLoc(); const char *endBuf = SM->getCharacterData(endLoc); const char *semiBuf = strchr(endBuf, ';'); assert((*semiBuf == ';') && "@throw: can't find ';'"); @@ -2171,7 +2171,7 @@ EndLoc = ECE->getRParenLoc(); } else { Loc = E->getBeginLoc(); - EndLoc = E->getLocEnd(); + EndLoc = E->getEndLoc(); } // This will defend against trying to rewrite synthesized expressions. if (Loc.isInvalid() || EndLoc.isInvalid()) @@ -2302,7 +2302,7 @@ ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString); } else { - SourceLocation X = ND->getLocEnd(); + SourceLocation X = ND->getEndLoc(); X = SM->getExpansionLoc(X); const char *endBuf = SM->getCharacterData(X); ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString); @@ -2626,7 +2626,7 @@ FunctionDecl *MsgSendFlavor = MsgSendFunctionDecl; SourceLocation StartLoc = Exp->getBeginLoc(); - SourceLocation EndLoc = Exp->getLocEnd(); + SourceLocation EndLoc = Exp->getEndLoc(); // Synthesize a call to objc_msgSend(). SmallVector MsgExprs; @@ -2710,7 +2710,7 @@ FunctionDecl *MsgSendFlavor = MsgSendFunctionDecl; SourceLocation StartLoc = Exp->getBeginLoc(); - SourceLocation EndLoc = Exp->getLocEnd(); + SourceLocation EndLoc = Exp->getEndLoc(); // Build the expression: __NSContainer_literal(int, ...).arr QualType IntQT = Context->IntTy; @@ -2833,7 +2833,7 @@ FunctionDecl *MsgSendFlavor = MsgSendFunctionDecl; SourceLocation StartLoc = Exp->getBeginLoc(); - SourceLocation EndLoc = Exp->getLocEnd(); + SourceLocation EndLoc = Exp->getEndLoc(); // Build the expression: __NSContainer_literal(int, ...).arr QualType IntQT = Context->IntTy; @@ -3564,7 +3564,7 @@ Stmt *RewriteModernObjC::RewriteMessageExpr(ObjCMessageExpr *Exp) { Stmt *ReplacingStmt = SynthMessageExpr(Exp, Exp->getBeginLoc(), - Exp->getLocEnd()); + Exp->getEndLoc()); // Now do the actual rewrite. ReplaceStmt(Exp, ReplacingStmt); @@ -5036,7 +5036,7 @@ // Use variable's location which is good for this case. DeclLoc = ND->getLocation(); const char *startBuf = SM->getCharacterData(DeclLoc); - SourceLocation X = ND->getLocEnd(); + SourceLocation X = ND->getEndLoc(); X = SM->getExpansionLoc(X); const char *endBuf = SM->getCharacterData(X); std::string Name(ND->getNameAsString()); @@ -5538,7 +5538,7 @@ #if 0 // Before we rewrite it, put the original message expression in a comment. SourceLocation startLoc = MessExpr->getBeginLoc(); - SourceLocation endLoc = MessExpr->getLocEnd(); + SourceLocation endLoc = MessExpr->getEndLoc(); const char *startBuf = SM->getCharacterData(startLoc); const char *endBuf = SM->getCharacterData(endLoc); Index: lib/Frontend/Rewrite/RewriteObjC.cpp =================================================================== --- lib/Frontend/Rewrite/RewriteObjC.cpp +++ lib/Frontend/Rewrite/RewriteObjC.cpp @@ -946,7 +946,7 @@ if (Method->isImplicit()) return; SourceLocation LocStart = Method->getBeginLoc(); - SourceLocation LocEnd = Method->getLocEnd(); + SourceLocation LocEnd = Method->getEndLoc(); if (SM->getExpansionLineNumber(LocEnd) > SM->getExpansionLineNumber(LocStart)) { @@ -1191,7 +1191,7 @@ for (auto *I : IMD ? IMD->property_impls() : CID->property_impls()) RewritePropertyImplDecl(I, IMD, CID); - InsertText(IMD ? IMD->getLocEnd() : CID->getLocEnd(), "// "); + InsertText(IMD ? IMD->getEndLoc() : CID->getEndLoc(), "// "); } void RewriteObjC::RewriteInterfaceDecl(ObjCInterfaceDecl *ClassDecl) { @@ -1651,7 +1651,7 @@ const char *lparenBuf = startBuf; while (*lparenBuf != '(') lparenBuf++; ReplaceText(startLoc, lparenBuf-startBuf+1, buf); - // We can't use S->getSynchExpr()->getLocEnd() to find the end location, since + // We can't use S->getSynchExpr()->getEndLoc() to find the end location, since // the sync expression is typically a message expression that's already // been rewritten! (which implies the SourceLocation's are invalid). SourceLocation endLoc = S->getSynchBody()->getBeginLoc(); @@ -1667,7 +1667,7 @@ buf += "objc_exception_try_enter(&_stack);\n"; buf += "if (!_setjmp(_stack.buf)) /* @try block continue */\n"; ReplaceText(rparenLoc, 1, buf); - startLoc = S->getSynchBody()->getLocEnd(); + startLoc = S->getSynchBody()->getEndLoc(); startBuf = SM->getCharacterData(startLoc); assert((*startBuf == '}') && "bogus @synchronized block"); @@ -1798,7 +1798,7 @@ ReplaceText(startLoc, 4, buf); - startLoc = S->getTryBody()->getLocEnd(); + startLoc = S->getTryBody()->getEndLoc(); startBuf = SM->getCharacterData(startLoc); assert((*startBuf == '}') && "bogus @try block"); @@ -1881,7 +1881,7 @@ } // Complete the catch list... if (lastCatchBody) { - SourceLocation bodyLoc = lastCatchBody->getLocEnd(); + SourceLocation bodyLoc = lastCatchBody->getEndLoc(); assert(*SM->getCharacterData(bodyLoc) == '}' && "bogus @catch body location"); @@ -1897,7 +1897,7 @@ InsertText(bodyLoc, buf); // Set lastCurlyLoc - lastCurlyLoc = lastCatchBody->getLocEnd(); + lastCurlyLoc = lastCatchBody->getEndLoc(); } if (ObjCAtFinallyStmt *finalStmt = S->getFinallyStmt()) { startLoc = finalStmt->getBeginLoc(); @@ -1908,7 +1908,7 @@ Stmt *body = finalStmt->getFinallyBody(); SourceLocation startLoc = body->getBeginLoc(); - SourceLocation endLoc = body->getLocEnd(); + SourceLocation endLoc = body->getEndLoc(); assert(*SM->getCharacterData(startLoc) == '{' && "bogus @finally body location"); assert(*SM->getCharacterData(endLoc) == '}' && @@ -1920,7 +1920,7 @@ InsertText(endLoc, " if (_rethrow) objc_exception_throw(_rethrow);\n"); // Set lastCurlyLoc - lastCurlyLoc = body->getLocEnd(); + lastCurlyLoc = body->getEndLoc(); // Now check for any return/continue/go statements within the @try. WarnAboutReturnGotoStmts(S->getTryBody()); @@ -2083,7 +2083,7 @@ EndLoc = ECE->getRParenLoc(); } else { Loc = E->getBeginLoc(); - EndLoc = E->getLocEnd(); + EndLoc = E->getEndLoc(); } // This will defend against trying to rewrite synthesized expressions. if (Loc.isInvalid() || EndLoc.isInvalid()) @@ -2210,7 +2210,7 @@ ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString); } else { - SourceLocation X = ND->getLocEnd(); + SourceLocation X = ND->getEndLoc(); X = SM->getExpansionLoc(X); const char *endBuf = SM->getCharacterData(X); ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString); @@ -3009,7 +3009,7 @@ Stmt *RewriteObjC::RewriteMessageExpr(ObjCMessageExpr *Exp) { Stmt *ReplacingStmt = SynthMessageExpr(Exp, Exp->getBeginLoc(), - Exp->getLocEnd()); + Exp->getEndLoc()); // Now do the actual rewrite. ReplaceStmt(Exp, ReplacingStmt); @@ -4179,7 +4179,7 @@ // Use variable's location which is good for this case. DeclLoc = ND->getLocation(); const char *startBuf = SM->getCharacterData(DeclLoc); - SourceLocation X = ND->getLocEnd(); + SourceLocation X = ND->getEndLoc(); X = SM->getExpansionLoc(X); const char *endBuf = SM->getCharacterData(X); std::string Name(ND->getNameAsString()); @@ -4633,7 +4633,7 @@ #if 0 // Before we rewrite it, put the original message expression in a comment. SourceLocation startLoc = MessExpr->getBeginLoc(); - SourceLocation endLoc = MessExpr->getLocEnd(); + SourceLocation endLoc = MessExpr->getEndLoc(); const char *startBuf = SM->getCharacterData(startLoc); const char *endBuf = SM->getCharacterData(endLoc); @@ -5874,7 +5874,7 @@ IV->getBase()); // Don't forget the parens to enforce the proper binding. ParenExpr *PE = new (Context) ParenExpr(IV->getBase()->getBeginLoc(), - IV->getBase()->getLocEnd(), castExpr); + IV->getBase()->getEndLoc(), castExpr); // Cannot delete IV->getBase(), since PE points to it. // Replace the old base with the cast. This is important when doing // embedded rewrites. For example, [newInv->_container addObject:0]. Index: lib/Index/IndexBody.cpp =================================================================== --- lib/Index/IndexBody.cpp +++ lib/Index/IndexBody.cpp @@ -432,7 +432,7 @@ for (unsigned I = 0, E = S->getNumComponents(); I != E; ++I) { const OffsetOfNode &Component = S->getComponent(I); if (Component.getKind() == OffsetOfNode::Field) - IndexCtx.handleReference(Component.getField(), Component.getLocEnd(), + IndexCtx.handleReference(Component.getField(), Component.getEndLoc(), Parent, ParentDC, SymbolRoleSet(), {}); // FIXME: Try to resolve dependent field references. } Index: lib/Parse/ParseDecl.cpp =================================================================== --- lib/Parse/ParseDecl.cpp +++ lib/Parse/ParseDecl.cpp @@ -2841,7 +2841,7 @@ return false; const PrintingPolicy &PPol = Actions.getASTContext().getPrintingPolicy(); - Diag(PP.getLocForEndOfToken(DS.getRepAsDecl()->getLocEnd()), + Diag(PP.getLocForEndOfToken(DS.getRepAsDecl()->getEndLoc()), diag::err_expected_after) << DeclSpec::getSpecifierName(DS.getTypeSpecType(), PPol) << tok::semi; @@ -5363,7 +5363,7 @@ // Sema will have to catch (syntactically invalid) pointers into global // scope. It has to catch pointers into namespace scope anyway. D.AddTypeInfo(DeclaratorChunk::getMemberPointer( - SS, DS.getTypeQualifiers(), DS.getLocEnd()), + SS, DS.getTypeQualifiers(), DS.getEndLoc()), std::move(DS.getAttributes()), /* Don't replace range end. */ SourceLocation()); return; @@ -6693,7 +6693,7 @@ if (NeedParens) { // Create a DeclaratorChunk for the inserted parens. - SourceLocation EndLoc = PP.getLocForEndOfToken(D.getLocEnd()); + SourceLocation EndLoc = PP.getLocForEndOfToken(D.getEndLoc()); D.AddTypeInfo(DeclaratorChunk::getParen(SuggestParenLoc, EndLoc), SourceLocation()); } @@ -6709,11 +6709,11 @@ if (!D.getIdentifier() && !NeedParens) return; - SourceLocation EndBracketLoc = TempDeclarator.getLocEnd(); + SourceLocation EndBracketLoc = TempDeclarator.getEndLoc(); // Generate the move bracket error message. SourceRange BracketRange(StartBracketLoc, EndBracketLoc); - SourceLocation EndLoc = PP.getLocForEndOfToken(D.getLocEnd()); + SourceLocation EndLoc = PP.getLocForEndOfToken(D.getEndLoc()); if (NeedParens) { Diag(EndLoc, diag::err_brackets_go_after_unqualified_id) Index: lib/Parse/ParseExprCXX.cpp =================================================================== --- lib/Parse/ParseExprCXX.cpp +++ lib/Parse/ParseExprCXX.cpp @@ -1675,7 +1675,7 @@ Expr *InitList = Init.get(); return Actions.ActOnCXXTypeConstructExpr( TypeRep, InitList->getBeginLoc(), MultiExprArg(&InitList, 1), - InitList->getLocEnd(), /*ListInitialization=*/true); + InitList->getEndLoc(), /*ListInitialization=*/true); } else { BalancedDelimiterTracker T(*this, tok::l_paren); T.consumeOpen(); @@ -1687,7 +1687,7 @@ if (ParseExpressionList(Exprs, CommaLocs, [&] { Actions.CodeCompleteConstructor(getCurScope(), TypeRep.get()->getCanonicalTypeInternal(), - DS.getLocEnd(), Exprs); + DS.getEndLoc(), Exprs); })) { SkipUntil(tok::r_paren, StopAtSemi); return ExprError(); @@ -2821,7 +2821,7 @@ DeclaratorInfo).get(); Actions.CodeCompleteConstructor(getCurScope(), TypeRep.get()->getCanonicalTypeInternal(), - DeclaratorInfo.getLocEnd(), + DeclaratorInfo.getEndLoc(), ConstructorArgs); })) { SkipUntil(tok::semi, StopAtSemi | StopBeforeMatch); Index: lib/Sema/AnalysisBasedWarnings.cpp =================================================================== --- lib/Sema/AnalysisBasedWarnings.cpp +++ lib/Sema/AnalysisBasedWarnings.cpp @@ -651,7 +651,7 @@ // Short circuit for compilation speed. if (CD.checkDiagnostics(Diags, ReturnsVoid, HasNoReturn)) return; - SourceLocation LBrace = Body->getBeginLoc(), RBrace = Body->getLocEnd(); + SourceLocation LBrace = Body->getBeginLoc(), RBrace = Body->getEndLoc(); auto EmitDiag = [&](SourceLocation Loc, unsigned DiagID) { if (IsCoroutine) S.Diag(Loc, DiagID) << FSI->CoroutinePromise->getType(); @@ -748,10 +748,10 @@ return false; // Don't suggest a fixit inside macros. - if (VD->getLocEnd().isMacroID()) + if (VD->getEndLoc().isMacroID()) return false; - SourceLocation Loc = S.getLocForEndOfToken(VD->getLocEnd()); + SourceLocation Loc = S.getLocForEndOfToken(VD->getEndLoc()); // Suggest possible initialization (if any). std::string Init = S.getFixItZeroInitializerForType(VariableTy, Loc); @@ -774,9 +774,9 @@ CharSourceRange::getCharRange(If->getBeginLoc(), Then->getBeginLoc())); if (Else) { - SourceLocation ElseKwLoc = S.getLocForEndOfToken(Then->getLocEnd()); + SourceLocation ElseKwLoc = S.getLocForEndOfToken(Then->getEndLoc()); Fixit2 = FixItHint::CreateRemoval( - SourceRange(ElseKwLoc, Else->getLocEnd())); + SourceRange(ElseKwLoc, Else->getEndLoc())); } } else { // If condition is always false, remove all but the 'else'. @@ -2145,7 +2145,7 @@ // Check for thread safety violations if (P.enableThreadSafetyAnalysis) { SourceLocation FL = AC.getDecl()->getLocation(); - SourceLocation FEL = AC.getDecl()->getLocEnd(); + SourceLocation FEL = AC.getDecl()->getEndLoc(); threadSafety::ThreadSafetyReporter Reporter(S, FL, FEL); if (!Diags.isIgnored(diag::warn_thread_safety_beta, D->getBeginLoc())) Reporter.setIssueBetaWarnings(true); Index: lib/Sema/SemaCast.cpp =================================================================== --- lib/Sema/SemaCast.cpp +++ lib/Sema/SemaCast.cpp @@ -2716,7 +2716,7 @@ Expr *CastExpr) { CastOperation Op(*this, CastTypeInfo->getType(), CastExpr); Op.DestRange = CastTypeInfo->getTypeLoc().getSourceRange(); - Op.OpRange = SourceRange(LPLoc, CastExpr->getLocEnd()); + Op.OpRange = SourceRange(LPLoc, CastExpr->getEndLoc()); if (getLangOpts().CPlusPlus) { Op.CheckCXXCStyleCast(/*FunctionalStyle=*/ false, @@ -2744,7 +2744,7 @@ assert(LPLoc.isValid() && "List-initialization shouldn't get here."); CastOperation Op(*this, Type, CastExpr); Op.DestRange = CastTypeInfo->getTypeLoc().getSourceRange(); - Op.OpRange = SourceRange(Op.DestRange.getBegin(), CastExpr->getLocEnd()); + Op.OpRange = SourceRange(Op.DestRange.getBegin(), CastExpr->getEndLoc()); Op.CheckCXXCStyleCast(/*FunctionalStyle=*/true, /*ListInit=*/false); if (Op.SrcExpr.isInvalid()) Index: lib/Sema/SemaChecking.cpp =================================================================== --- lib/Sema/SemaChecking.cpp +++ lib/Sema/SemaChecking.cpp @@ -112,13 +112,13 @@ if (argCount == desiredArgCount) return false; if (argCount < desiredArgCount) - return S.Diag(call->getLocEnd(), diag::err_typecheck_call_too_few_args) + return S.Diag(call->getEndLoc(), diag::err_typecheck_call_too_few_args) << 0 /*function call*/ << desiredArgCount << argCount << call->getSourceRange(); // Highlight all the excess arguments. SourceRange range(call->getArg(desiredArgCount)->getBeginLoc(), - call->getArg(argCount - 1)->getLocEnd()); + call->getArg(argCount - 1)->getEndLoc()); return S.Diag(range.getBegin(), diag::err_typecheck_call_too_many_args) << 0 /*function call*/ << desiredArgCount << argCount @@ -156,7 +156,7 @@ static bool SemaBuiltinMSVCAnnotation(Sema &S, CallExpr *TheCall) { // We need at least one argument. if (TheCall->getNumArgs() < 1) { - S.Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args_at_least) + S.Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args_at_least) << 0 << 1 << TheCall->getNumArgs() << TheCall->getCallee()->getSourceRange(); return true; @@ -4312,7 +4312,7 @@ ++AdjustedNumArgs; // Check we have the right number of arguments. if (TheCall->getNumArgs() < AdjustedNumArgs) { - Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args) + Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args) << 0 << AdjustedNumArgs << TheCall->getNumArgs() << TheCall->getCallee()->getSourceRange(); return ExprError(); @@ -4631,7 +4631,7 @@ // Ensure that we have at least one argument to do type inference from. if (TheCall->getNumArgs() < 1) { - Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args_at_least) + Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args_at_least) << 0 << 1 << TheCall->getNumArgs() << TheCall->getCallee()->getSourceRange(); return ExprError(); @@ -4908,14 +4908,14 @@ // Now that we know how many fixed arguments we expect, first check that we // have at least that many. if (TheCall->getNumArgs() < 1+NumFixed) { - Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args_at_least) + Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args_at_least) << 0 << 1+NumFixed << TheCall->getNumArgs() << TheCall->getCallee()->getSourceRange(); return ExprError(); } if (WarnAboutSemanticsChange) { - Diag(TheCall->getLocEnd(), diag::warn_sync_fetch_and_nand_semantics_change) + Diag(TheCall->getEndLoc(), diag::warn_sync_fetch_and_nand_semantics_change) << TheCall->getCallee()->getSourceRange(); } @@ -5207,12 +5207,12 @@ << 0 /*function call*/ << 2 << TheCall->getNumArgs() << Fn->getSourceRange() << SourceRange(TheCall->getArg(2)->getBeginLoc(), - (*(TheCall->arg_end()-1))->getLocEnd()); + (*(TheCall->arg_end()-1))->getEndLoc()); return true; } if (TheCall->getNumArgs() < 2) { - return Diag(TheCall->getLocEnd(), + return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args_at_least) << 0 /*function call*/ << 2 << TheCall->getNumArgs(); } @@ -5281,7 +5281,7 @@ Expr *Func = Call->getCallee(); if (Call->getNumArgs() < 3) - return Diag(Call->getLocEnd(), + return Diag(Call->getEndLoc(), diag::err_typecheck_call_too_few_args_at_least) << 0 /*function call*/ << 3 << Call->getNumArgs(); @@ -5328,14 +5328,14 @@ /// friends. This is declared to take (...), so we have to check everything. bool Sema::SemaBuiltinUnorderedCompare(CallExpr *TheCall) { if (TheCall->getNumArgs() < 2) - return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args) + return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args) << 0 << 2 << TheCall->getNumArgs()/*function call*/; if (TheCall->getNumArgs() > 2) return Diag(TheCall->getArg(2)->getBeginLoc(), diag::err_typecheck_call_too_many_args) << 0 /*function call*/ << 2 << TheCall->getNumArgs() << SourceRange(TheCall->getArg(2)->getBeginLoc(), - (*(TheCall->arg_end()-1))->getLocEnd()); + (*(TheCall->arg_end()-1))->getEndLoc()); ExprResult OrigArg0 = TheCall->getArg(0); ExprResult OrigArg1 = TheCall->getArg(1); @@ -5361,7 +5361,7 @@ return Diag(OrigArg0.get()->getBeginLoc(), diag::err_typecheck_call_invalid_ordered_compare) << OrigArg0.get()->getType() << OrigArg1.get()->getType() - << SourceRange(OrigArg0.get()->getBeginLoc(), OrigArg1.get()->getLocEnd()); + << SourceRange(OrigArg0.get()->getBeginLoc(), OrigArg1.get()->getEndLoc()); return false; } @@ -5372,14 +5372,14 @@ /// value. bool Sema::SemaBuiltinFPClassification(CallExpr *TheCall, unsigned NumArgs) { if (TheCall->getNumArgs() < NumArgs) - return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args) + return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args) << 0 << NumArgs << TheCall->getNumArgs()/*function call*/; if (TheCall->getNumArgs() > NumArgs) return Diag(TheCall->getArg(NumArgs)->getBeginLoc(), diag::err_typecheck_call_too_many_args) << 0 /*function call*/ << NumArgs << TheCall->getNumArgs() << SourceRange(TheCall->getArg(NumArgs)->getBeginLoc(), - (*(TheCall->arg_end()-1))->getLocEnd()); + (*(TheCall->arg_end()-1))->getEndLoc()); Expr *OrigArg = TheCall->getArg(NumArgs-1); @@ -5424,13 +5424,13 @@ bool Sema::SemaBuiltinVSX(CallExpr *TheCall) { unsigned ExpectedNumArgs = 3; if (TheCall->getNumArgs() < ExpectedNumArgs) - return Diag(TheCall->getLocEnd(), + return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args_at_least) << 0 /*function call*/ << ExpectedNumArgs << TheCall->getNumArgs() << TheCall->getSourceRange(); if (TheCall->getNumArgs() > ExpectedNumArgs) - return Diag(TheCall->getLocEnd(), + return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_many_args_at_most) << 0 /*function call*/ << ExpectedNumArgs << TheCall->getNumArgs() << TheCall->getSourceRange(); @@ -5442,7 +5442,7 @@ diag::err_vsx_builtin_nonconstant_argument) << 3 /* argument index */ << TheCall->getDirectCallee() << SourceRange(TheCall->getArg(2)->getBeginLoc(), - TheCall->getArg(2)->getLocEnd()); + TheCall->getArg(2)->getEndLoc()); QualType Arg1Ty = TheCall->getArg(0)->getType(); QualType Arg2Ty = TheCall->getArg(1)->getType(); @@ -5454,7 +5454,7 @@ return Diag(BuiltinLoc, diag::err_vec_builtin_non_vector) << TheCall->getDirectCallee() << SourceRange(TheCall->getArg(0)->getBeginLoc(), - TheCall->getArg(1)->getLocEnd()); + TheCall->getArg(1)->getEndLoc()); } // Check the first two arguments are the same type. @@ -5462,7 +5462,7 @@ return Diag(BuiltinLoc, diag::err_vec_builtin_incompatible_vector) << TheCall->getDirectCallee() << SourceRange(TheCall->getArg(0)->getBeginLoc(), - TheCall->getArg(1)->getLocEnd()); + TheCall->getArg(1)->getEndLoc()); } // When default clang type checking is turned off and the customized type @@ -5477,7 +5477,7 @@ // This is declared to take (...), so we have to check everything. ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) { if (TheCall->getNumArgs() < 2) - return ExprError(Diag(TheCall->getLocEnd(), + return ExprError(Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args_at_least) << 0 /*function call*/ << 2 << TheCall->getNumArgs() << TheCall->getSourceRange()); @@ -5498,7 +5498,7 @@ diag::err_vec_builtin_non_vector) << TheCall->getDirectCallee() << SourceRange(TheCall->getArg(0)->getBeginLoc(), - TheCall->getArg(1)->getLocEnd())); + TheCall->getArg(1)->getEndLoc())); numElements = LHSType->getAs()->getNumElements(); unsigned numResElements = TheCall->getNumArgs() - 2; @@ -5513,13 +5513,13 @@ diag::err_vec_builtin_incompatible_vector) << TheCall->getDirectCallee() << SourceRange(TheCall->getArg(1)->getBeginLoc(), - TheCall->getArg(1)->getLocEnd())); + TheCall->getArg(1)->getEndLoc())); } else if (!Context.hasSameUnqualifiedType(LHSType, RHSType)) { return ExprError(Diag(TheCall->getBeginLoc(), diag::err_vec_builtin_incompatible_vector) << TheCall->getDirectCallee() << SourceRange(TheCall->getArg(0)->getBeginLoc(), - TheCall->getArg(1)->getLocEnd())); + TheCall->getArg(1)->getEndLoc())); } else if (numElements != numResElements) { QualType eltType = LHSType->getAs()->getElementType(); resType = Context.getVectorType(eltType, numResElements, @@ -5597,7 +5597,7 @@ unsigned NumArgs = TheCall->getNumArgs(); if (NumArgs > 3) - return Diag(TheCall->getLocEnd(), + return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_many_args_at_most) << 0 /*function call*/ << 3 << NumArgs << TheCall->getSourceRange(); @@ -5668,7 +5668,7 @@ unsigned NumArgs = TheCall->getNumArgs(); if (NumArgs > 3) - return Diag(TheCall->getLocEnd(), + return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_many_args_at_most) << 0 /*function call*/ << 3 << NumArgs << TheCall->getSourceRange(); @@ -5708,12 +5708,12 @@ unsigned NumArgs = TheCall->getNumArgs(); unsigned NumRequiredArgs = IsSizeCall ? 1 : 2; if (NumArgs < NumRequiredArgs) { - return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args) + return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args) << 0 /* function call */ << NumRequiredArgs << NumArgs << TheCall->getSourceRange(); } if (NumArgs >= NumRequiredArgs + 0x100) { - return Diag(TheCall->getLocEnd(), + return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_many_args_at_most) << 0 /* function call */ << (NumRequiredArgs + 0xff) << NumArgs << TheCall->getSourceRange(); @@ -5751,7 +5751,7 @@ return true; CharUnits ArgSize = Context.getTypeSizeInChars(Arg.get()->getType()); if (ArgSize.getQuantity() >= 0x100) { - return Diag(Arg.get()->getLocEnd(), diag::err_os_log_argument_too_big) + return Diag(Arg.get()->getEndLoc(), diag::err_os_log_argument_too_big) << i << (int)ArgSize.getQuantity() << 0xff << TheCall->getSourceRange(); } @@ -5956,7 +5956,7 @@ bool Sema::SemaBuiltinLongjmp(CallExpr *TheCall) { if (!Context.getTargetInfo().hasSjLjLowering()) return Diag(TheCall->getBeginLoc(), diag::err_builtin_longjmp_unsupported) - << SourceRange(TheCall->getBeginLoc(), TheCall->getLocEnd()); + << SourceRange(TheCall->getBeginLoc(), TheCall->getEndLoc()); Expr *Arg = TheCall->getArg(1); llvm::APSInt Result; @@ -5967,7 +5967,7 @@ if (Result != 1) return Diag(TheCall->getBeginLoc(), diag::err_builtin_longjmp_invalid_val) - << SourceRange(Arg->getBeginLoc(), Arg->getLocEnd()); + << SourceRange(Arg->getBeginLoc(), Arg->getEndLoc()); return false; } @@ -5977,7 +5977,7 @@ bool Sema::SemaBuiltinSetjmp(CallExpr *TheCall) { if (!Context.getTargetInfo().hasSjLjLowering()) return Diag(TheCall->getBeginLoc(), diag::err_builtin_setjmp_unsupported) - << SourceRange(TheCall->getBeginLoc(), TheCall->getLocEnd()); + << SourceRange(TheCall->getBeginLoc(), TheCall->getEndLoc()); return false; } @@ -6127,7 +6127,7 @@ } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } - SourceLocation getEndLoc() const LLVM_READONLY { return FExpr->getLocEnd(); } + SourceLocation getEndLoc() const LLVM_READONLY { return FExpr->getEndLoc(); } }; } // namespace @@ -7278,7 +7278,7 @@ if (Method->getMinRequiredArguments() == 0 && AT.matchesType(S.Context, Method->getReturnType())) { // FIXME: Suggest parens if the expression needs them. - SourceLocation EndLoc = S.getLocForEndOfToken(E->getLocEnd()); + SourceLocation EndLoc = S.getLocForEndOfToken(E->getEndLoc()); S.Diag(E->getBeginLoc(), diag::note_printf_c_str) << "c_str()" << FixItHint::CreateInsertion(EndLoc, ".c_str()"); @@ -7757,7 +7757,7 @@ Hints.push_back(FixItHint::CreateInsertion(E->getBeginLoc(), CastFix.str())); - SourceLocation After = S.getLocForEndOfToken(E->getLocEnd()); + SourceLocation After = S.getLocForEndOfToken(E->getEndLoc()); Hints.push_back(FixItHint::CreateInsertion(After, ")")); } @@ -8590,7 +8590,7 @@ << SizeRange << FnName; S.Diag(FnLoc, diag::note_memsize_comparison_paren) << FnName << FixItHint::CreateInsertion( - S.getLocForEndOfToken(Size->getLHS()->getLocEnd()), ")") + S.getLocForEndOfToken(Size->getLHS()->getEndLoc()), ")") << FixItHint::CreateRemoval(RParenLoc); S.Diag(SizeRange.getBegin(), diag::note_memsize_comparison_cast_silence) << FixItHint::CreateInsertion(SizeRange.getBegin(), "(size_t)(") @@ -11312,7 +11312,7 @@ return; } Diag(E->getExprLoc(), diag::note_function_to_function_call) - << FixItHint::CreateInsertion(getLocForEndOfToken(E->getLocEnd()), "()"); + << FixItHint::CreateInsertion(getLocForEndOfToken(E->getEndLoc()), "()"); } /// Diagnoses "dangerous" implicit conversions within the given Index: lib/Sema/SemaDecl.cpp =================================================================== --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -1735,7 +1735,7 @@ static void GenerateFixForUnusedDecl(const NamedDecl *D, ASTContext &Ctx, FixItHint &Hint) { if (isa(D)) { - SourceLocation AfterColon = Lexer::findLocationAfterToken(D->getLocEnd(), + SourceLocation AfterColon = Lexer::findLocationAfterToken(D->getEndLoc(), tok::colon, Ctx.getSourceManager(), Ctx.getLangOpts(), true); if (AfterColon.isInvalid()) return; @@ -8002,7 +8002,7 @@ return CXXDeductionGuideDecl::Create(SemaRef.Context, DC, D.getBeginLoc(), isExplicit, NameInfo, R, TInfo, - D.getLocEnd()); + D.getEndLoc()); } else if (DC->isRecord()) { // If the name of the function is the same as the name of the record, // then this must be an invalid constructor that has a return type. @@ -12421,7 +12421,7 @@ // passed by reference. if (T->isObjCObjectType()) { SourceLocation TypeEndLoc = - getLocForEndOfToken(TSInfo->getTypeLoc().getLocEnd()); + getLocForEndOfToken(TSInfo->getTypeLoc().getEndLoc()); Diag(NameLoc, diag::err_object_cannot_be_passed_returned_by_value) << 1 << T << FixItHint::CreateInsertion(TypeEndLoc, "*"); @@ -13070,7 +13070,7 @@ computeNRVO(Body, getCurFunction()); } if (getCurFunction()->ObjCShouldCallSuper) { - Diag(MD->getLocEnd(), diag::warn_objc_missing_super_call) + Diag(MD->getEndLoc(), diag::warn_objc_missing_super_call) << MD->getSelector().getAsString(); getCurFunction()->ObjCShouldCallSuper = false; } Index: lib/Sema/SemaDeclAttr.cpp =================================================================== --- lib/Sema/SemaDeclAttr.cpp +++ lib/Sema/SemaDeclAttr.cpp @@ -7075,7 +7075,7 @@ StringRef Suffix; static AttributeInsertion createInsertionAfter(const NamedDecl *D) { - return {" ", D->getLocEnd(), ""}; + return {" ", D->getEndLoc(), ""}; } static AttributeInsertion createInsertionAfter(SourceLocation Loc) { return {" ", Loc, ""}; @@ -7605,19 +7605,19 @@ bool VisitObjCMessageExpr(ObjCMessageExpr *Msg) { if (ObjCMethodDecl *D = Msg->getMethodDecl()) DiagnoseDeclAvailability( - D, SourceRange(Msg->getSelectorStartLoc(), Msg->getLocEnd())); + D, SourceRange(Msg->getSelectorStartLoc(), Msg->getEndLoc())); return true; } bool VisitDeclRefExpr(DeclRefExpr *DRE) { DiagnoseDeclAvailability(DRE->getDecl(), - SourceRange(DRE->getBeginLoc(), DRE->getLocEnd())); + SourceRange(DRE->getBeginLoc(), DRE->getEndLoc())); return true; } bool VisitMemberExpr(MemberExpr *ME) { DiagnoseDeclAvailability(ME->getMemberDecl(), - SourceRange(ME->getBeginLoc(), ME->getLocEnd())); + SourceRange(ME->getBeginLoc(), ME->getEndLoc())); return true; } @@ -7714,7 +7714,7 @@ SM.getExpansionLoc(StmtOfUse->getBeginLoc()); SourceLocation StmtEndLoc = SM.getExpansionRange( - (LastStmtOfUse ? LastStmtOfUse : StmtOfUse)->getLocEnd()) + (LastStmtOfUse ? LastStmtOfUse : StmtOfUse)->getEndLoc()) .getEnd(); if (SM.getFileID(IfInsertionLoc) != SM.getFileID(StmtEndLoc)) return; Index: lib/Sema/SemaDeclCXX.cpp =================================================================== --- lib/Sema/SemaDeclCXX.cpp +++ lib/Sema/SemaDeclCXX.cpp @@ -3640,7 +3640,7 @@ FD->getInClassInitStyle() == ICIS_ListInit ? InitializationKind::CreateDirectList(InitExpr->getBeginLoc(), InitExpr->getBeginLoc(), - InitExpr->getLocEnd()) + InitExpr->getEndLoc()) : InitializationKind::CreateCopy(InitExpr->getBeginLoc(), InitLoc); InitializationSequence Seq(*this, Entity, Kind, InitExpr); Init = Seq.Perform(*this, Entity, Kind, InitExpr); @@ -3990,7 +3990,7 @@ nullptr); InitializationKind Kind = InitList ? InitializationKind::CreateDirectList( - IdLoc, Init->getBeginLoc(), Init->getLocEnd()) + IdLoc, Init->getBeginLoc(), Init->getEndLoc()) : InitializationKind::CreateDirect(IdLoc, InitRange.getBegin(), InitRange.getEnd()); @@ -4043,7 +4043,7 @@ QualType(ClassDecl->getTypeForDecl(), 0)); InitializationKind Kind = InitList ? InitializationKind::CreateDirectList( - NameLoc, Init->getBeginLoc(), Init->getLocEnd()) + NameLoc, Init->getBeginLoc(), Init->getEndLoc()) : InitializationKind::CreateDirect(NameLoc, InitRange.getBegin(), InitRange.getEnd()); InitializationSequence InitSeq(*this, DelegationEntity, Kind, Args); @@ -8437,7 +8437,7 @@ // If we can provide a correct fix-it hint, do so. if (After.isInvalid() && ConvTSI) { SourceLocation InsertLoc = - getLocForEndOfToken(ConvTSI->getTypeLoc().getLocEnd()); + getLocForEndOfToken(ConvTSI->getTypeLoc().getEndLoc()); DB << FixItHint::CreateInsertion(InsertLoc, " ") << FixItHint::CreateInsertionFromRange( InsertLoc, CharSourceRange::getTokenRange(Before)) @@ -10231,7 +10231,7 @@ } else { // Convert 'using X::Y;' to 'typedef X::Y Y;'. SourceLocation InsertLoc = - getLocForEndOfToken(NameInfo.getLocEnd()); + getLocForEndOfToken(NameInfo.getEndLoc()); Diag(InsertLoc, diag::note_using_decl_class_member_workaround) << 1 // typedef declaration << FixItHint::CreateReplacement(UsingLoc, "typedef") @@ -10866,8 +10866,8 @@ return; } - SourceLocation Loc = Constructor->getLocEnd().isValid() - ? Constructor->getLocEnd() + SourceLocation Loc = Constructor->getEndLoc().isValid() + ? Constructor->getEndLoc() : Constructor->getLocation(); Constructor->setBody(new (Context) CompoundStmt(Loc)); Constructor->markUsed(Context); @@ -11149,8 +11149,8 @@ return; } - SourceLocation Loc = Destructor->getLocEnd().isValid() - ? Destructor->getLocEnd() + SourceLocation Loc = Destructor->getEndLoc().isValid() + ? Destructor->getEndLoc() : Destructor->getLocation(); Destructor->setBody(new (Context) CompoundStmt(Loc)); Destructor->markUsed(Context); @@ -11821,8 +11821,8 @@ } // Our location for everything implicitly-generated. - SourceLocation Loc = CopyAssignOperator->getLocEnd().isValid() - ? CopyAssignOperator->getLocEnd() + SourceLocation Loc = CopyAssignOperator->getEndLoc().isValid() + ? CopyAssignOperator->getEndLoc() : CopyAssignOperator->getLocation(); // Builds a DeclRefExpr for the "other" object. @@ -12177,8 +12177,8 @@ "Bad argument type of defaulted move assignment"); // Our location for everything implicitly-generated. - SourceLocation Loc = MoveAssignOperator->getLocEnd().isValid() - ? MoveAssignOperator->getLocEnd() + SourceLocation Loc = MoveAssignOperator->getEndLoc().isValid() + ? MoveAssignOperator->getEndLoc() : MoveAssignOperator->getLocation(); // Builds a reference to the "other" object. @@ -12462,8 +12462,8 @@ if (SetCtorInitializers(CopyConstructor, /*AnyErrors=*/false)) { CopyConstructor->setInvalidDecl(); } else { - SourceLocation Loc = CopyConstructor->getLocEnd().isValid() - ? CopyConstructor->getLocEnd() + SourceLocation Loc = CopyConstructor->getEndLoc().isValid() + ? CopyConstructor->getEndLoc() : CopyConstructor->getLocation(); Sema::CompoundScopeRAII CompoundScope(*this); CopyConstructor->setBody( @@ -12585,8 +12585,8 @@ if (SetCtorInitializers(MoveConstructor, /*AnyErrors=*/false)) { MoveConstructor->setInvalidDecl(); } else { - SourceLocation Loc = MoveConstructor->getLocEnd().isValid() - ? MoveConstructor->getLocEnd() + SourceLocation Loc = MoveConstructor->getEndLoc().isValid() + ? MoveConstructor->getEndLoc() : MoveConstructor->getLocation(); Sema::CompoundScopeRAII CompoundScope(*this); MoveConstructor->setBody(ActOnCompoundStmt( @@ -12889,7 +12889,7 @@ RecordDecl *OutermostClass = ParentRD->getOuterLexicalRecordContext(); Diag(Loc, diag::err_in_class_initializer_not_yet_parsed) << OutermostClass << Field; - Diag(Field->getLocEnd(), diag::note_in_class_initializer_not_yet_parsed); + Diag(Field->getEndLoc(), diag::note_in_class_initializer_not_yet_parsed); // Recover by marking the field invalid, unless we're in a SFINAE context. if (!isSFINAEContext()) Field->setInvalidDecl(); Index: lib/Sema/SemaDeclObjC.cpp =================================================================== --- lib/Sema/SemaDeclObjC.cpp +++ lib/Sema/SemaDeclObjC.cpp @@ -653,7 +653,7 @@ } IDecl->setSuperClass(SuperClassTInfo); - IDecl->setEndOfDefinitionLoc(SuperClassTInfo->getTypeLoc().getLocEnd()); + IDecl->setEndOfDefinitionLoc(SuperClassTInfo->getTypeLoc().getEndLoc()); } } @@ -828,7 +828,7 @@ if (newTypeParams->size() > prevTypeParams->size()) { diagLoc = newTypeParams->begin()[prevTypeParams->size()]->getLocation(); } else { - diagLoc = S.getLocForEndOfToken(newTypeParams->back()->getLocEnd()); + diagLoc = S.getLocForEndOfToken(newTypeParams->back()->getEndLoc()); } S.Diag(diagLoc, diag::err_objc_type_param_arity_mismatch) Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -387,7 +387,7 @@ // 'nil' for ObjC methods, where it's much more likely that the // variadic arguments form a list of object pointers. SourceLocation MissingNilLoc - = getLocForEndOfToken(sentinelExpr->getLocEnd()); + = getLocForEndOfToken(sentinelExpr->getEndLoc()); std::string NullValue; if (calleeType == CT_Method && PP.isMacroDefined("nil")) NullValue = "nil"; @@ -501,7 +501,7 @@ &S.Context.Idents.get("object_setClass"), SourceLocation(), S.LookupOrdinaryName); if (ObjectSetClass) { - SourceLocation RHSLocEnd = S.getLocForEndOfToken(RHS->getLocEnd()); + SourceLocation RHSLocEnd = S.getLocForEndOfToken(RHS->getEndLoc()); S.Diag(OIRE->getExprLoc(), diag::warn_objc_isa_assign) << FixItHint::CreateInsertion(OIRE->getBeginLoc(), "object_setClass(") << FixItHint::CreateReplacement(SourceRange(OIRE->getOpLoc(), @@ -520,7 +520,7 @@ FixItHint::CreateInsertion(OIRE->getBeginLoc(), "object_getClass(") << FixItHint::CreateReplacement( SourceRange(OIRE->getOpLoc(), - OIRE->getLocEnd()), ")"); + OIRE->getEndLoc()), ")"); else S.Diag(OIRE->getLocation(), diag::warn_objc_isa_use); } @@ -898,7 +898,7 @@ ExprResult Call = ActOnCallExpr(TUScope, TrapFn.get(), E->getBeginLoc(), None, - E->getLocEnd()); + E->getEndLoc()); if (Call.isInvalid()) return ExprError(); @@ -4846,7 +4846,7 @@ << FnKind << FDecl->getParamDecl(0) << static_cast(Args.size()) << Fn->getSourceRange() << SourceRange(Args[NumParams]->getBeginLoc(), - Args.back()->getLocEnd()); + Args.back()->getEndLoc()); else Diag(Args[NumParams]->getBeginLoc(), MinArgs == NumParams @@ -4855,7 +4855,7 @@ << FnKind << NumParams << static_cast(Args.size()) << Fn->getSourceRange() << SourceRange(Args[NumParams]->getBeginLoc(), - Args.back()->getLocEnd()); + Args.back()->getEndLoc()); // Emit the location of the prototype. if (!TC && FDecl && !FDecl->getBuiltinID() && !IsExecConfig) @@ -5320,7 +5320,7 @@ Diag(Fn->getBeginLoc(), diag::err_pseudo_dtor_call_with_args) << FixItHint::CreateRemoval( SourceRange(ArgExprs.front()->getBeginLoc(), - ArgExprs.back()->getLocEnd())); + ArgExprs.back()->getEndLoc())); } return new (Context) @@ -7222,11 +7222,11 @@ SuggestParentheses(Self, OpLoc, Self.PDiag(diag::note_precedence_silence) << BinaryOperator::getOpcodeStr(CondOpcode), - SourceRange(Condition->getBeginLoc(), Condition->getLocEnd())); + SourceRange(Condition->getBeginLoc(), Condition->getEndLoc())); SuggestParentheses(Self, OpLoc, Self.PDiag(diag::note_precedence_conditional_first), - SourceRange(CondRHS->getBeginLoc(), RHSExpr->getLocEnd())); + SourceRange(CondRHS->getBeginLoc(), RHSExpr->getEndLoc())); } /// Compute the nullability of a conditional expression. @@ -8923,13 +8923,13 @@ return; } - SourceRange DiagRange(LHSExpr->getBeginLoc(), RHSExpr->getLocEnd()); + SourceRange DiagRange(LHSExpr->getBeginLoc(), RHSExpr->getEndLoc()); Self.Diag(OpLoc, diag::warn_string_plus_int) << DiagRange << IndexExpr->IgnoreImpCasts()->getType(); // Only print a fixit for "str" + int, not for int + "str". if (IndexExpr == RHSExpr) { - SourceLocation EndLoc = Self.getLocForEndOfToken(RHSExpr->getLocEnd()); + SourceLocation EndLoc = Self.getLocForEndOfToken(RHSExpr->getEndLoc()); Self.Diag(OpLoc, diag::note_string_plus_scalar_silence) << FixItHint::CreateInsertion(LHSExpr->getBeginLoc(), "&") << FixItHint::CreateReplacement(SourceRange(OpLoc), "[") @@ -8964,7 +8964,7 @@ return; ASTContext &Ctx = Self.getASTContext(); - SourceRange DiagRange(LHSExpr->getBeginLoc(), RHSExpr->getLocEnd()); + SourceRange DiagRange(LHSExpr->getBeginLoc(), RHSExpr->getEndLoc()); const QualType CharType = CharExpr->getType(); if (!CharType->isAnyCharacterType() && @@ -8979,7 +8979,7 @@ // Only print a fixit for str + char, not for char + str. if (isa(RHSExpr->IgnoreImpCasts())) { - SourceLocation EndLoc = Self.getLocForEndOfToken(RHSExpr->getLocEnd()); + SourceLocation EndLoc = Self.getLocForEndOfToken(RHSExpr->getEndLoc()); Self.Diag(OpLoc, diag::note_string_plus_scalar_silence) << FixItHint::CreateInsertion(LHSExpr->getBeginLoc(), "&") << FixItHint::CreateReplacement(SourceRange(OpLoc), "[") @@ -9654,7 +9654,7 @@ if (BinaryOperator::isEqualityOp(Opc) && hasIsEqualMethod(S, LHS.get(), RHS.get())) { SourceLocation Start = LHS.get()->getBeginLoc(); - SourceLocation End = S.getLocForEndOfToken(RHS.get()->getLocEnd()); + SourceLocation End = S.getLocForEndOfToken(RHS.get()->getEndLoc()); CharSourceRange OpRange = CharSourceRange::getCharRange(Loc, S.getLocForEndOfToken(Loc)); @@ -9687,7 +9687,7 @@ // First note suggest !(x < y) SourceLocation FirstOpen = SubExpr->getBeginLoc(); - SourceLocation FirstClose = RHS.get()->getLocEnd(); + SourceLocation FirstClose = RHS.get()->getEndLoc(); FirstClose = S.getLocForEndOfToken(FirstClose); if (FirstClose.isInvalid()) FirstOpen = SourceLocation(); @@ -9698,7 +9698,7 @@ // Second note suggests (!x) < y SourceLocation SecondOpen = LHS.get()->getBeginLoc(); - SourceLocation SecondClose = LHS.get()->getLocEnd(); + SourceLocation SecondClose = LHS.get()->getEndLoc(); SecondClose = S.getLocForEndOfToken(SecondClose); if (SecondClose.isInvalid()) SecondOpen = SourceLocation(); @@ -10627,8 +10627,8 @@ // Suggest replacing "Foo() && kNonZero" with "Foo()" Diag(Loc, diag::note_logical_instead_of_bitwise_remove_constant) << FixItHint::CreateRemoval( - SourceRange(getLocForEndOfToken(LHS.get()->getLocEnd()), - RHS.get()->getLocEnd())); + SourceRange(getLocForEndOfToken(LHS.get()->getEndLoc()), + RHS.get()->getEndLoc())); } } @@ -11274,7 +11274,7 @@ << FixItHint::CreateInsertion(LHS->getBeginLoc(), LangOpts.CPlusPlus ? "static_cast(" : "(void)(") - << FixItHint::CreateInsertion(PP.getLocForEndOfToken(LHS->getLocEnd()), + << FixItHint::CreateInsertion(PP.getLocForEndOfToken(LHS->getEndLoc()), ")"); } @@ -12006,7 +12006,7 @@ // The meaning of x = {v} [...] is that of x = T(v) [...]. The meaning // of x = {} is x = T(). InitializationKind Kind = InitializationKind::CreateDirectList( - RHSExpr->getBeginLoc(), RHSExpr->getBeginLoc(), RHSExpr->getLocEnd()); + RHSExpr->getBeginLoc(), RHSExpr->getBeginLoc(), RHSExpr->getEndLoc()); InitializedEntity Entity = InitializedEntity::InitializeTemporary(LHSExpr->getType()); InitializationSequence InitSeq(*this, Entity, Kind, RHSExpr); @@ -12035,7 +12035,7 @@ // OpenCLC v2.0 s6.13.11.1 allows atomic variables to be initialized by // the ATOMIC_VAR_INIT macro. if (LHSTy->isAtomicType() || RHSTy->isAtomicType()) { - SourceRange SR(LHSExpr->getBeginLoc(), RHSExpr->getLocEnd()); + SourceRange SR(LHSExpr->getBeginLoc(), RHSExpr->getEndLoc()); if (BO_Assign == Opc) Diag(OpLoc, diag::err_opencl_atomic_init) << 0 << SR; else @@ -12197,7 +12197,7 @@ &Context.Idents.get("object_setClass"), SourceLocation(), LookupOrdinaryName); if (ObjectSetClass && isa(LHS.get())) { - SourceLocation RHSLocEnd = getLocForEndOfToken(RHS.get()->getLocEnd()); + SourceLocation RHSLocEnd = getLocForEndOfToken(RHS.get()->getEndLoc()); Diag(LHS.get()->getExprLoc(), diag::warn_objc_isa_assign) << FixItHint::CreateInsertion(LHS.get()->getBeginLoc(), "object_setClass(") << FixItHint::CreateReplacement(SourceRange(OISA->getOpLoc(), OpLoc), ",") << @@ -12260,11 +12260,11 @@ SourceRange DiagRange = isLeftComp ? SourceRange(LHSExpr->getBeginLoc(), OpLoc) - : SourceRange(OpLoc, RHSExpr->getLocEnd()); + : SourceRange(OpLoc, RHSExpr->getEndLoc()); StringRef OpStr = isLeftComp ? LHSBO->getOpcodeStr() : RHSBO->getOpcodeStr(); SourceRange ParensRange = isLeftComp ? - SourceRange(LHSBO->getRHS()->getBeginLoc(), RHSExpr->getLocEnd()) - : SourceRange(LHSExpr->getBeginLoc(), RHSBO->getLHS()->getLocEnd()); + SourceRange(LHSBO->getRHS()->getBeginLoc(), RHSExpr->getEndLoc()) + : SourceRange(LHSExpr->getBeginLoc(), RHSBO->getLHS()->getEndLoc()); Self.Diag(OpLoc, diag::warn_precedence_bitwise_rel) << DiagRange << BinaryOperator::getOpcodeStr(Opc) << OpStr; @@ -12401,7 +12401,7 @@ SuggestParentheses(S, OpLoc, S.PDiag(diag::note_evaluate_comparison_first), SourceRange(OCE->getArg(1)->getBeginLoc(), - RHSExpr->getLocEnd())); + RHSExpr->getEndLoc())); } /// DiagnoseBinOpPrecedence - Emit warnings for expressions with tricky Index: lib/Sema/SemaExprCXX.cpp =================================================================== --- lib/Sema/SemaExprCXX.cpp +++ lib/Sema/SemaExprCXX.cpp @@ -1692,7 +1692,7 @@ if (ParenListExpr *List = dyn_cast_or_null(Initializer)) DirectInitRange = List->getSourceRange(); - return BuildCXXNew(SourceRange(StartLoc, D.getLocEnd()), UseGlobal, + return BuildCXXNew(SourceRange(StartLoc, D.getEndLoc()), UseGlobal, PlacementLParen, PlacementArgs, PlacementRParen, @@ -1797,7 +1797,7 @@ : initStyle == CXXNewExpr::ListInit ? InitializationKind::CreateDirectList(TypeRange.getBegin(), Initializer->getBeginLoc(), - Initializer->getLocEnd()) + Initializer->getEndLoc()) : InitializationKind::CreateDirect(TypeRange.getBegin(), DirectInitRange.getBegin(), DirectInitRange.getEnd()); @@ -2081,7 +2081,7 @@ // dialect distinction. if (ArraySize && !isLegalArrayNewInitializer(initStyle, Initializer)) { SourceRange InitRange(Inits[0]->getBeginLoc(), - Inits[NumInits - 1]->getLocEnd()); + Inits[NumInits - 1]->getEndLoc()); Diag(StartLoc, diag::err_new_array_init_args) << InitRange; return ExprError(); } @@ -2588,7 +2588,7 @@ SourceRange R = PlaceArgs.empty() ? SourceRange() : SourceRange(PlaceArgs.front()->getBeginLoc(), - PlaceArgs.back()->getLocEnd()); + PlaceArgs.back()->getEndLoc()); Diag(StartLoc, diag::err_placement_new_non_placement_delete) << R; if (!OperatorDelete->isImplicit()) Diag(OperatorDelete->getLocation(), diag::note_previous_decl) @@ -5423,7 +5423,7 @@ CXXCastPath BasePath; if (CheckDerivedToBaseConversion(LHSType, Class, Loc, SourceRange(LHS.get()->getBeginLoc(), - RHS.get()->getLocEnd()), + RHS.get()->getEndLoc()), &BasePath)) return QualType(); @@ -7164,7 +7164,7 @@ CXXMemberCallExpr *CE = new (Context) CXXMemberCallExpr(Context, ME, None, ResultType, VK, - Exp.get()->getLocEnd()); + Exp.get()->getEndLoc()); if (CheckFunctionCall(Method, CE, Method->getType()->castAs())) Index: lib/Sema/SemaExprObjC.cpp =================================================================== --- lib/Sema/SemaExprObjC.cpp +++ lib/Sema/SemaExprObjC.cpp @@ -1035,7 +1035,7 @@ Diag(Element.EllipsisLoc, diag::err_pack_expansion_without_parameter_packs) << SourceRange(Element.Key->getBeginLoc(), - Element.Value->getLocEnd()); + Element.Value->getEndLoc()); return ExprError(); } @@ -1698,7 +1698,7 @@ << 2 /*method*/ << NumNamedArgs << static_cast(Args.size()) << Method->getSourceRange() << SourceRange(Args[NumNamedArgs]->getBeginLoc(), - Args.back()->getLocEnd()); + Args.back()->getEndLoc()); } } @@ -4067,7 +4067,7 @@ ExpressionString += RelatedClass->getNameAsString(); ExpressionString += " "; ExpressionString += ClassMethod->getSelector().getAsString(); - SourceLocation SrcExprEndLoc = getLocForEndOfToken(SrcExpr->getLocEnd()); + SourceLocation SrcExprEndLoc = getLocForEndOfToken(SrcExpr->getEndLoc()); // Provide a fixit: [RelatedClass ClassMethod SrcExpr] Diag(Loc, diag::err_objc_bridged_related_known_method) << SrcType << DestType << ClassMethod->getSelector() << false @@ -4094,7 +4094,7 @@ if (Diagnose) { std::string ExpressionString; SourceLocation SrcExprEndLoc = - getLocForEndOfToken(SrcExpr->getLocEnd()); + getLocForEndOfToken(SrcExpr->getEndLoc()); if (InstanceMethod->isPropertyAccessor()) if (const ObjCPropertyDecl *PDecl = InstanceMethod->findPropertyDecl()) { Index: lib/Sema/SemaInit.cpp =================================================================== --- lib/Sema/SemaInit.cpp +++ lib/Sema/SemaInit.cpp @@ -519,7 +519,7 @@ if (!ILE->getInit(Init)) { ExprResult BaseInit = FillWithNoInit ? new (SemaRef.Context) NoInitExpr(Base.getType()) - : PerformEmptyInit(SemaRef, ILE->getLocEnd(), BaseEntity, + : PerformEmptyInit(SemaRef, ILE->getEndLoc(), BaseEntity, /*VerifyOnly*/ false, TreatUnavailableAsInvalid); if (BaseInit.isInvalid()) { @@ -545,7 +545,7 @@ InitListExpr *ILE, bool &RequiresSecondPass, bool FillWithNoInit) { - SourceLocation Loc = ILE->getLocEnd(); + SourceLocation Loc = ILE->getEndLoc(); unsigned NumInits = ILE->getNumInits(); InitializedEntity MemberEntity = InitializedEntity::InitializeMember(Field, &ParentEntity); @@ -765,7 +765,7 @@ if (FillWithNoInit) Filler = new (SemaRef.Context) NoInitExpr(ElementType); else { - ExprResult ElementInit = PerformEmptyInit(SemaRef, ILE->getLocEnd(), + ExprResult ElementInit = PerformEmptyInit(SemaRef, ILE->getEndLoc(), ElementEntity, /*VerifyOnly*/false, TreatUnavailableAsInvalid); @@ -963,7 +963,7 @@ StructuredSubobjectInitList->getBeginLoc(), "{") << FixItHint::CreateInsertion( SemaRef.getLocForEndOfToken( - StructuredSubobjectInitList->getLocEnd()), + StructuredSubobjectInitList->getEndLoc()), "}"); } } @@ -1513,7 +1513,7 @@ if (VerifyOnly) CheckEmptyInitializable( InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity), - IList->getLocEnd()); + IList->getEndLoc()); return; } @@ -1560,7 +1560,7 @@ // Don't attempt to go past the end of the init list if (Index >= IList->getNumInits()) { if (VerifyOnly) - CheckEmptyInitializable(ElementEntity, IList->getLocEnd()); + CheckEmptyInitializable(ElementEntity, IList->getEndLoc()); break; } @@ -1782,7 +1782,7 @@ Entity.isVariableLengthArrayNew()) CheckEmptyInitializable(InitializedEntity::InitializeElement( SemaRef.Context, 0, Entity), - IList->getLocEnd()); + IList->getEndLoc()); } } @@ -1867,7 +1867,7 @@ if (VerifyOnly) CheckEmptyInitializable( InitializedEntity::InitializeMember(*Field, &Entity), - IList->getLocEnd()); + IList->getEndLoc()); else StructuredList->setInitializedFieldInUnion(*Field); break; @@ -1881,7 +1881,7 @@ // If we have any base classes, they are initialized prior to the fields. for (auto &Base : Bases) { Expr *Init = Index < IList->getNumInits() ? IList->getInit(Index) : nullptr; - SourceLocation InitLoc = Init ? Init->getBeginLoc() : IList->getLocEnd(); + SourceLocation InitLoc = Init ? Init->getBeginLoc() : IList->getEndLoc(); // Designated inits always initialize fields, so if we see one, all // remaining base classes have no explicit initializer. @@ -2005,7 +2005,7 @@ if (!Field->isUnnamedBitfield() && !Field->hasInClassInitializer()) CheckEmptyInitializable( InitializedEntity::InitializeMember(*Field, &Entity), - IList->getLocEnd()); + IList->getEndLoc()); } } @@ -2186,7 +2186,7 @@ getStructuredSubobjectInit(IList, Index, CurrentObjectType, StructuredList, StructuredIndex, SourceRange(D->getBeginLoc(), - DIE->getLocEnd())); + DIE->getEndLoc())); else if (InitListExpr *Result = dyn_cast(ExistingInit)) StructuredList = Result; else { @@ -2197,7 +2197,7 @@ DesignatedInitUpdateExpr *DIUE = new (SemaRef.Context) DesignatedInitUpdateExpr(SemaRef.Context, D->getBeginLoc(), ExistingInit, - DIE->getLocEnd()); + DIE->getEndLoc()); StructuredList->updateInit(SemaRef.Context, StructuredIndex, DIUE); StructuredList = DIUE->getUpdater(); } @@ -2224,7 +2224,7 @@ // subobject [0], overwriting previous initializers. SemaRef.Diag(D->getBeginLoc(), diag::warn_subobject_initializer_overrides) - << SourceRange(D->getBeginLoc(), DIE->getLocEnd()); + << SourceRange(D->getBeginLoc(), DIE->getEndLoc()); SemaRef.Diag(ExistingInit->getBeginLoc(), diag::note_previous_initializer) @@ -2398,7 +2398,7 @@ SemaRef.Diag(NextD->getBeginLoc(), diag::err_designator_into_flexible_array_member) << SourceRange(NextD->getBeginLoc(), - DIE->getLocEnd()); + DIE->getEndLoc()); SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member) << *Field; } @@ -3507,11 +3507,11 @@ return false; VarDecl *VD = cast(Entity.getDecl()); - if (VD->getInit() || VD->getLocEnd().isMacroID()) + if (VD->getInit() || VD->getEndLoc().isMacroID()) return false; QualType VariableTy = VD->getType().getCanonicalType(); - SourceLocation Loc = S.getLocForEndOfToken(VD->getLocEnd()); + SourceLocation Loc = S.getLocForEndOfToken(VD->getEndLoc()); std::string Init = S.getFixItZeroInitializerForType(VariableTy, Loc); if (!Init.empty()) { Sequence.AddZeroInitializationStep(Entity.getType()); @@ -3583,7 +3583,7 @@ InitializedEntity HiddenArray = InitializedEntity::InitializeTemporary(ArrayType); InitializationKind Kind = InitializationKind::CreateDirectList( - List->getExprLoc(), List->getBeginLoc(), List->getLocEnd()); + List->getExprLoc(), List->getBeginLoc(), List->getEndLoc()); TryListInitialization(S, HiddenArray, Kind, List, Sequence, TreatUnavailableAsInvalid); if (Sequence) @@ -7160,7 +7160,7 @@ ETy->isAtomicType() && !HasGlobalAS && Entity.getKind() == InitializedEntity::EK_Variable && Args.size() > 0) { S.Diag(Args[0]->getBeginLoc(), diag::err_opencl_atomic_init) << 1 << - SourceRange(Entity.getDecl()->getBeginLoc(), Args[0]->getLocEnd()); + SourceRange(Entity.getDecl()->getBeginLoc(), Args[0]->getEndLoc()); return ExprError(); } @@ -8039,7 +8039,7 @@ (void)Diagnosed; } else // FIXME: diagnostic below could be better! S.Diag(Kind.getLocation(), diag::err_reference_has_multiple_inits) - << SourceRange(Args.front()->getBeginLoc(), Args.back()->getLocEnd()); + << SourceRange(Args.front()->getBeginLoc(), Args.back()->getEndLoc()); break; case FK_ParenthesizedListInitForReference: S.Diag(Kind.getLocation(), diag::err_list_init_in_parens) @@ -8250,10 +8250,10 @@ auto *InitList = dyn_cast(Args[0]); if (InitList && InitList->getNumInits() >= 1) { - R = SourceRange(InitList->getInit(0)->getLocEnd(), InitList->getLocEnd()); + R = SourceRange(InitList->getInit(0)->getEndLoc(), InitList->getEndLoc()); } else { assert(Args.size() > 1 && "Expected multiple initializers!"); - R = SourceRange(Args.front()->getLocEnd(), Args.back()->getLocEnd()); + R = SourceRange(Args.front()->getEndLoc(), Args.back()->getEndLoc()); } R.setBegin(S.getLocForEndOfToken(R.getBegin())); @@ -8286,7 +8286,7 @@ SourceRange ArgsRange; if (Args.size()) ArgsRange = SourceRange(Args.front()->getBeginLoc(), - Args.back()->getLocEnd()); + Args.back()->getEndLoc()); if (Failure == FK_ListConstructorOverloadFailed) { assert(Args.size() == 1 && @@ -8874,7 +8874,7 @@ << PostInit->getSourceRange() << FixItHint::CreateInsertion(PostInit->getBeginLoc(), OS.str()) << FixItHint::CreateInsertion( - S.getLocForEndOfToken(PostInit->getLocEnd()), ")"); + S.getLocForEndOfToken(PostInit->getEndLoc()), ")"); } //===----------------------------------------------------------------------===// Index: lib/Sema/SemaLambda.cpp =================================================================== --- lib/Sema/SemaLambda.cpp +++ lib/Sema/SemaLambda.cpp @@ -762,7 +762,7 @@ InitializationKind Kind = IsDirectInit ? (CXXDirectInit ? InitializationKind::CreateDirect( - Loc, Init->getBeginLoc(), Init->getLocEnd()) + Loc, Init->getBeginLoc(), Init->getEndLoc()) : InitializationKind::CreateDirectList(Loc)) : InitializationKind::CreateCopy(Loc, Init->getBeginLoc()); @@ -1308,7 +1308,7 @@ ConvTSI, /*isInline=*/true, /*isExplicit=*/false, /*isConstexpr=*/S.getLangOpts().CPlusPlus17, - CallOperator->getBody()->getLocEnd()); + CallOperator->getBody()->getEndLoc()); Conversion->setAccess(AS_public); Conversion->setImplicit(true); @@ -1350,7 +1350,7 @@ CallOperator->getTypeSourceInfo(), SC_Static, /*IsInline=*/true, /*IsConstexpr=*/false, - CallOperator->getBody()->getLocEnd()); + CallOperator->getBody()->getEndLoc()); for (unsigned I = 0, N = CallOperator->getNumParams(); I != N; ++I) InvokerParams[I]->setOwningFunction(Invoke); Invoke->setParams(InvokerParams); @@ -1399,7 +1399,7 @@ S.Context.getTrivialTypeSourceInfo(ConvTy, Loc), /*isInline=*/true, /*isExplicit=*/false, /*isConstexpr=*/false, - CallOperator->getBody()->getLocEnd()); + CallOperator->getBody()->getEndLoc()); Conversion->setAccess(AS_public); Conversion->setImplicit(true); Class->addDecl(Conversion); @@ -1442,7 +1442,7 @@ Scope *CurScope) { LambdaScopeInfo LSI = *cast(FunctionScopes.back()); ActOnFinishFunctionBody(LSI.CallOperator, Body); - return BuildLambdaExpr(StartLoc, Body->getLocEnd(), &LSI); + return BuildLambdaExpr(StartLoc, Body->getEndLoc(), &LSI); } static LambdaCaptureDefault Index: lib/Sema/SemaObjCProperty.cpp =================================================================== --- lib/Sema/SemaObjCProperty.cpp +++ lib/Sema/SemaObjCProperty.cpp @@ -609,7 +609,7 @@ } if (T->isObjCObjectType()) { - SourceLocation StarLoc = TInfo->getTypeLoc().getLocEnd(); + SourceLocation StarLoc = TInfo->getTypeLoc().getEndLoc(); StarLoc = getLocForEndOfToken(StarLoc); Diag(FD.D.getIdentifierLoc(), diag::err_statically_allocated_object) << FixItHint::CreateInsertion(StarLoc, "*"); @@ -2235,7 +2235,7 @@ if (getterRedecl->getDeclContext() != PD->getDeclContext()) continue; noteLoc = getterRedecl->getLocation(); - fixItLoc = getterRedecl->getLocEnd(); + fixItLoc = getterRedecl->getEndLoc(); } Preprocessor &PP = getPreprocessor(); Index: lib/Sema/SemaOpenMP.cpp =================================================================== --- lib/Sema/SemaOpenMP.cpp +++ lib/Sema/SemaOpenMP.cpp @@ -2697,13 +2697,13 @@ ? SC->getFirstScheduleModifierLoc() : SC->getSecondScheduleModifierLoc(), diag::err_omp_schedule_nonmonotonic_ordered) - << SourceRange(OC->getBeginLoc(), OC->getLocEnd()); + << SourceRange(OC->getBeginLoc(), OC->getEndLoc()); ErrorFound = true; } if (!LCs.empty() && OC && OC->getNumForLoops()) { for (const OMPLinearClause *C : LCs) { Diag(C->getBeginLoc(), diag::err_omp_linear_ordered) - << SourceRange(OC->getBeginLoc(), OC->getLocEnd()); + << SourceRange(OC->getBeginLoc(), OC->getEndLoc()); } ErrorFound = true; } @@ -6126,7 +6126,7 @@ C->getClauseKind() == OMPC_capture) { if (AtomicKind != OMPC_unknown) { Diag(C->getBeginLoc(), diag::err_omp_atomic_several_clauses) - << SourceRange(C->getBeginLoc(), C->getLocEnd()); + << SourceRange(C->getBeginLoc(), C->getEndLoc()); Diag(AtomicKindLoc, diag::note_omp_atomic_previous_clause) << getOpenMPClauseName(AtomicKind); } else { @@ -6929,7 +6929,7 @@ if (ReductionClause && NogroupClause) { S.Diag(ReductionClause->getBeginLoc(), diag::err_omp_reduction_with_nogroup) << SourceRange(NogroupClause->getBeginLoc(), - NogroupClause->getLocEnd()); + NogroupClause->getEndLoc()); return true; } return false; Index: lib/Sema/SemaOverload.cpp =================================================================== --- lib/Sema/SemaOverload.cpp +++ lib/Sema/SemaOverload.cpp @@ -5589,7 +5589,7 @@ << FixItHint::CreateInsertion(From->getBeginLoc(), "static_cast<" + TypeStr + ">(") << FixItHint::CreateInsertion( - SemaRef.getLocForEndOfToken(From->getLocEnd()), ")"); + SemaRef.getLocForEndOfToken(From->getEndLoc()), ")"); Converter.noteExplicitConv(SemaRef, Conversion, ConvTy); // If we aren't in a SFINAE context, build a call to the Index: lib/Sema/SemaStmt.cpp =================================================================== --- lib/Sema/SemaStmt.cpp +++ lib/Sema/SemaStmt.cpp @@ -556,7 +556,7 @@ CommaVisitor(*this).Visit(CondExpr); if (!elseStmt) - DiagnoseEmptyStmtBody(CondExpr->getLocEnd(), thenStmt, + DiagnoseEmptyStmtBody(CondExpr->getEndLoc(), thenStmt, diag::warn_empty_if_body); return BuildIfStmt(IfLoc, IsConstexpr, InitStmt, Cond, thenStmt, ElseLoc, @@ -1028,7 +1028,7 @@ if (LoVal > HiVal) { Diag(CR->getLHS()->getBeginLoc(), diag::warn_case_empty_range) << SourceRange(CR->getLHS()->getBeginLoc(), - Hi->getLocEnd()); + Hi->getEndLoc()); CaseRanges.erase(CaseRanges.begin()+i); --i; --e; @@ -1209,7 +1209,7 @@ } if (BodyStmt) - DiagnoseEmptyStmtBody(CondExpr->getLocEnd(), BodyStmt, + DiagnoseEmptyStmtBody(CondExpr->getEndLoc(), BodyStmt, diag::warn_empty_switch_body); // FIXME: If the case list was broken is some way, we don't have a good system Index: lib/Sema/SemaTemplate.cpp =================================================================== --- lib/Sema/SemaTemplate.cpp +++ lib/Sema/SemaTemplate.cpp @@ -1764,7 +1764,7 @@ return buildDeductionGuide(TemplateParams, CD->isExplicit(), NewTInfo, CD->getBeginLoc(), CD->getLocation(), - CD->getLocEnd()); + CD->getEndLoc()); } /// Build a deduction guide with the specified parameter types. @@ -5630,7 +5630,7 @@ std::string Code = "static_cast<" + ParamType.getAsString() + ">("; S.Diag(Arg->getExprLoc(), diag::err_template_arg_untyped_null_constant) << ParamType << FixItHint::CreateInsertion(Arg->getBeginLoc(), Code) - << FixItHint::CreateInsertion(S.getLocForEndOfToken(Arg->getLocEnd()), + << FixItHint::CreateInsertion(S.getLocForEndOfToken(Arg->getEndLoc()), ")"); S.Diag(Param->getLocation(), diag::note_template_param_here); return NPV_NullPointer; Index: lib/Sema/SemaTemplateInstantiate.cpp =================================================================== --- lib/Sema/SemaTemplateInstantiate.cpp +++ lib/Sema/SemaTemplateInstantiate.cpp @@ -1708,7 +1708,7 @@ Proto->getExtProtoInfo().ExceptionSpec; SmallVector ExceptionStorage; - if (SubstExceptionSpec(New->getTypeSourceInfo()->getTypeLoc().getLocEnd(), + if (SubstExceptionSpec(New->getTypeSourceInfo()->getTypeLoc().getEndLoc(), ESI, ExceptionStorage, Args)) // On error, recover by dropping the exception specification. ESI.Type = EST_None; @@ -2303,7 +2303,7 @@ Diag(PointOfInstantiation, diag::err_in_class_initializer_not_yet_parsed) << OutermostClass << Pattern; - Diag(Pattern->getLocEnd(), diag::note_in_class_initializer_not_yet_parsed); + Diag(Pattern->getEndLoc(), diag::note_in_class_initializer_not_yet_parsed); Instantiation->setInvalidDecl(); return true; } Index: lib/Sema/SemaTemplateInstantiateDecl.cpp =================================================================== --- lib/Sema/SemaTemplateInstantiateDecl.cpp +++ lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1945,26 +1945,26 @@ Constructor->isExplicit(), Constructor->isInlineSpecified(), false, Constructor->isConstexpr()); - Method->setRangeEnd(Constructor->getLocEnd()); + Method->setRangeEnd(Constructor->getEndLoc()); } else if (CXXDestructorDecl *Destructor = dyn_cast(D)) { Method = CXXDestructorDecl::Create(SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo, Destructor->isInlineSpecified(), false); - Method->setRangeEnd(Destructor->getLocEnd()); + Method->setRangeEnd(Destructor->getEndLoc()); } else if (CXXConversionDecl *Conversion = dyn_cast(D)) { Method = CXXConversionDecl::Create(SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo, Conversion->isInlineSpecified(), Conversion->isExplicit(), Conversion->isConstexpr(), - Conversion->getLocEnd()); + Conversion->getEndLoc()); } else { StorageClass SC = D->isStatic() ? SC_Static : SC_None; Method = CXXMethodDecl::Create(SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo, SC, D->isInlineSpecified(), - D->isConstexpr(), D->getLocEnd()); + D->isConstexpr(), D->getEndLoc()); } if (D->isInlined()) Index: lib/Sema/SemaTemplateVariadic.cpp =================================================================== --- lib/Sema/SemaTemplateVariadic.cpp +++ lib/Sema/SemaTemplateVariadic.cpp @@ -1126,7 +1126,7 @@ S.Diag(E->getExprLoc(), diag::err_fold_expression_bad_operand) << E->getSourceRange() << FixItHint::CreateInsertion(E->getBeginLoc(), "(") - << FixItHint::CreateInsertion(E->getLocEnd(), ")"); + << FixItHint::CreateInsertion(E->getEndLoc(), ")"); } } Index: lib/Sema/SemaType.cpp =================================================================== --- lib/Sema/SemaType.cpp +++ lib/Sema/SemaType.cpp @@ -3304,7 +3304,7 @@ // valid (when there is no initializer and we're not in a condition). S.Diag(D.getBeginLoc(), diag::note_function_style_cast_add_parentheses) << FixItHint::CreateInsertion(D.getBeginLoc(), "(") - << FixItHint::CreateInsertion(S.getLocForEndOfToken(D.getLocEnd()), ")"); + << FixItHint::CreateInsertion(S.getLocForEndOfToken(D.getEndLoc()), ")"); S.Diag(Paren.Loc, diag::note_remove_parens_for_variable_declaration) << FixItHint::CreateRemoval(Paren.Loc) << FixItHint::CreateRemoval(Paren.EndLoc); @@ -4184,7 +4184,7 @@ if (auto *attr = inferPointerNullability( pointerKind, D.getDeclSpec().getTypeSpecTypeLoc(), - D.getDeclSpec().getLocEnd(), + D.getDeclSpec().getEndLoc(), D.getMutableDeclSpec().getAttributes())) { T = Context.getAttributedType( AttributedType::getNullabilityAttrKind(*inferNullability),T,T); @@ -4476,10 +4476,10 @@ SourceLocation DiagLoc, FixitLoc; if (TInfo) { DiagLoc = TInfo->getTypeLoc().getBeginLoc(); - FixitLoc = S.getLocForEndOfToken(TInfo->getTypeLoc().getLocEnd()); + FixitLoc = S.getLocForEndOfToken(TInfo->getTypeLoc().getEndLoc()); } else { DiagLoc = D.getDeclSpec().getTypeSpecTypeLoc(); - FixitLoc = S.getLocForEndOfToken(D.getDeclSpec().getLocEnd()); + FixitLoc = S.getLocForEndOfToken(D.getDeclSpec().getEndLoc()); } S.Diag(DiagLoc, diag::err_object_cannot_be_passed_returned_by_value) << 0 << T @@ -5299,7 +5299,7 @@ // FIXME. We should have DS.getTypeSpecTypeEndLoc(). But, it requires // addition field. What we have is good enough for dispay of location // of 'fixit' on interface name. - TL.setNameEndLoc(DS.getLocEnd()); + TL.setNameEndLoc(DS.getEndLoc()); } void VisitObjCObjectTypeLoc(ObjCObjectTypeLoc TL) { TypeSourceInfo *RepTInfo = nullptr; Index: lib/Sema/TreeTransform.h =================================================================== --- lib/Sema/TreeTransform.h +++ lib/Sema/TreeTransform.h @@ -3395,7 +3395,7 @@ // If this was list initialization, revert to syntactic list form. if (Construct->isListInitialization()) return getDerived().RebuildInitList(Construct->getBeginLoc(), NewArgs, - Construct->getLocEnd()); + Construct->getEndLoc()); // Build a ParenListExpr to represent anything else. SourceRange Parens = Construct->getParenOrBraceRange(); @@ -7708,7 +7708,7 @@ return getDerived().RebuildOMPExecutableDirective( D->getDirectiveKind(), DirName, CancelRegion, TClauses, - AssociatedStmt.get(), D->getBeginLoc(), D->getLocEnd()); + AssociatedStmt.get(), D->getBeginLoc(), D->getEndLoc()); } template @@ -8245,7 +8245,7 @@ return nullptr; return getDerived().RebuildOMPIfClause( C->getNameModifier(), Cond.get(), C->getBeginLoc(), C->getLParenLoc(), - C->getNameModifierLoc(), C->getColonLoc(), C->getLocEnd()); + C->getNameModifierLoc(), C->getColonLoc(), C->getEndLoc()); } template @@ -8254,7 +8254,7 @@ if (Cond.isInvalid()) return nullptr; return getDerived().RebuildOMPFinalClause(Cond.get(), C->getBeginLoc(), - C->getLParenLoc(), C->getLocEnd()); + C->getLParenLoc(), C->getEndLoc()); } template @@ -8264,7 +8264,7 @@ if (NumThreads.isInvalid()) return nullptr; return getDerived().RebuildOMPNumThreadsClause( - NumThreads.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + NumThreads.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8274,7 +8274,7 @@ if (E.isInvalid()) return nullptr; return getDerived().RebuildOMPSafelenClause( - E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8284,7 +8284,7 @@ if (E.isInvalid()) return nullptr; return getDerived().RebuildOMPSimdlenClause( - E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8294,7 +8294,7 @@ if (E.isInvalid()) return nullptr; return getDerived().RebuildOMPCollapseClause( - E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8302,7 +8302,7 @@ TreeTransform::TransformOMPDefaultClause(OMPDefaultClause *C) { return getDerived().RebuildOMPDefaultClause( C->getDefaultKind(), C->getDefaultKindKwLoc(), C->getBeginLoc(), - C->getLParenLoc(), C->getLocEnd()); + C->getLParenLoc(), C->getEndLoc()); } template @@ -8310,7 +8310,7 @@ TreeTransform::TransformOMPProcBindClause(OMPProcBindClause *C) { return getDerived().RebuildOMPProcBindClause( C->getProcBindKind(), C->getProcBindKindKwLoc(), C->getBeginLoc(), - C->getLParenLoc(), C->getLocEnd()); + C->getLParenLoc(), C->getEndLoc()); } template @@ -8323,7 +8323,7 @@ C->getFirstScheduleModifier(), C->getSecondScheduleModifier(), C->getScheduleKind(), E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getFirstScheduleModifierLoc(), C->getSecondScheduleModifierLoc(), - C->getScheduleKindLoc(), C->getCommaLoc(), C->getLocEnd()); + C->getScheduleKindLoc(), C->getCommaLoc(), C->getEndLoc()); } template @@ -8335,7 +8335,7 @@ if (E.isInvalid()) return nullptr; } - return getDerived().RebuildOMPOrderedClause(C->getBeginLoc(), C->getLocEnd(), + return getDerived().RebuildOMPOrderedClause(C->getBeginLoc(), C->getEndLoc(), C->getLParenLoc(), E.get()); } @@ -8425,7 +8425,7 @@ Vars.push_back(EVar.get()); } return getDerived().RebuildOMPPrivateClause( - Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8440,7 +8440,7 @@ Vars.push_back(EVar.get()); } return getDerived().RebuildOMPFirstprivateClause( - Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8455,7 +8455,7 @@ Vars.push_back(EVar.get()); } return getDerived().RebuildOMPLastprivateClause( - Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8470,7 +8470,7 @@ Vars.push_back(EVar.get()); } return getDerived().RebuildOMPSharedClause(Vars, C->getBeginLoc(), - C->getLParenLoc(), C->getLocEnd()); + C->getLParenLoc(), C->getEndLoc()); } template @@ -8517,7 +8517,7 @@ } return getDerived().RebuildOMPReductionClause( Vars, C->getBeginLoc(), C->getLParenLoc(), C->getColonLoc(), - C->getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions); + C->getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions); } template @@ -8562,7 +8562,7 @@ } return getDerived().RebuildOMPTaskReductionClause( Vars, C->getBeginLoc(), C->getLParenLoc(), C->getColonLoc(), - C->getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions); + C->getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions); } template @@ -8607,7 +8607,7 @@ } return getDerived().RebuildOMPInReductionClause( Vars, C->getBeginLoc(), C->getLParenLoc(), C->getColonLoc(), - C->getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions); + C->getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions); } template @@ -8626,7 +8626,7 @@ return nullptr; return getDerived().RebuildOMPLinearClause( Vars, Step.get(), C->getBeginLoc(), C->getLParenLoc(), C->getModifier(), - C->getModifierLoc(), C->getColonLoc(), C->getLocEnd()); + C->getModifierLoc(), C->getColonLoc(), C->getEndLoc()); } template @@ -8645,7 +8645,7 @@ return nullptr; return getDerived().RebuildOMPAlignedClause( Vars, Alignment.get(), C->getBeginLoc(), C->getLParenLoc(), - C->getColonLoc(), C->getLocEnd()); + C->getColonLoc(), C->getEndLoc()); } template @@ -8660,7 +8660,7 @@ Vars.push_back(EVar.get()); } return getDerived().RebuildOMPCopyinClause(Vars, C->getBeginLoc(), - C->getLParenLoc(), C->getLocEnd()); + C->getLParenLoc(), C->getEndLoc()); } template @@ -8675,7 +8675,7 @@ Vars.push_back(EVar.get()); } return getDerived().RebuildOMPCopyprivateClause( - Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8689,7 +8689,7 @@ Vars.push_back(EVar.get()); } return getDerived().RebuildOMPFlushClause(Vars, C->getBeginLoc(), - C->getLParenLoc(), C->getLocEnd()); + C->getLParenLoc(), C->getEndLoc()); } template @@ -8705,7 +8705,7 @@ } return getDerived().RebuildOMPDependClause( C->getDependencyKind(), C->getDependencyLoc(), C->getColonLoc(), Vars, - C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8715,7 +8715,7 @@ if (E.isInvalid()) return nullptr; return getDerived().RebuildOMPDeviceClause( - E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8731,7 +8731,7 @@ return getDerived().RebuildOMPMapClause( C->getMapTypeModifier(), C->getMapType(), C->isImplicitMapType(), C->getMapLoc(), C->getColonLoc(), Vars, C->getBeginLoc(), - C->getLParenLoc(), C->getLocEnd()); + C->getLParenLoc(), C->getEndLoc()); } template @@ -8741,7 +8741,7 @@ if (E.isInvalid()) return nullptr; return getDerived().RebuildOMPNumTeamsClause( - E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8751,7 +8751,7 @@ if (E.isInvalid()) return nullptr; return getDerived().RebuildOMPThreadLimitClause( - E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8761,7 +8761,7 @@ if (E.isInvalid()) return nullptr; return getDerived().RebuildOMPPriorityClause( - E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8771,7 +8771,7 @@ if (E.isInvalid()) return nullptr; return getDerived().RebuildOMPGrainsizeClause( - E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8781,7 +8781,7 @@ if (E.isInvalid()) return nullptr; return getDerived().RebuildOMPNumTasksClause( - E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8790,7 +8790,7 @@ if (E.isInvalid()) return nullptr; return getDerived().RebuildOMPHintClause(E.get(), C->getBeginLoc(), - C->getLParenLoc(), C->getLocEnd()); + C->getLParenLoc(), C->getEndLoc()); } template @@ -8801,7 +8801,7 @@ return nullptr; return getDerived().RebuildOMPDistScheduleClause( C->getDistScheduleKind(), E.get(), C->getBeginLoc(), C->getLParenLoc(), - C->getDistScheduleKindLoc(), C->getCommaLoc(), C->getLocEnd()); + C->getDistScheduleKindLoc(), C->getCommaLoc(), C->getEndLoc()); } template @@ -8821,7 +8821,7 @@ Vars.push_back(EVar.get()); } return getDerived().RebuildOMPToClause(Vars, C->getBeginLoc(), - C->getLParenLoc(), C->getLocEnd()); + C->getLParenLoc(), C->getEndLoc()); } template @@ -8835,7 +8835,7 @@ Vars.push_back(EVar.get()); } return getDerived().RebuildOMPFromClause(Vars, C->getBeginLoc(), - C->getLParenLoc(), C->getLocEnd()); + C->getLParenLoc(), C->getEndLoc()); } template @@ -8850,7 +8850,7 @@ Vars.push_back(EVar.get()); } return getDerived().RebuildOMPUseDevicePtrClause( - Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } template @@ -8865,7 +8865,7 @@ Vars.push_back(EVar.get()); } return getDerived().RebuildOMPIsDevicePtrClause( - Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd()); + Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc()); } //===----------------------------------------------------------------------===// @@ -9259,7 +9259,7 @@ return E; return getDerived().RebuildOMPArraySectionExpr( - Base.get(), E->getBase()->getLocEnd(), LowerBound.get(), E->getColonLoc(), + Base.get(), E->getBase()->getEndLoc(), LowerBound.get(), E->getColonLoc(), Length.get(), E->getRBracketLoc()); } @@ -9513,7 +9513,7 @@ // derivable from the initializer. return getDerived().RebuildCompoundLiteralExpr(E->getLParenLoc(), NewT, - /*FIXME:*/E->getInitializer()->getLocEnd(), + /*FIXME:*/E->getInitializer()->getEndLoc(), Init.get()); } @@ -9530,7 +9530,7 @@ // FIXME: Bad source location SourceLocation FakeOperatorLoc = - SemaRef.getLocForEndOfToken(E->getBase()->getLocEnd()); + SemaRef.getLocForEndOfToken(E->getBase()->getEndLoc()); return getDerived().RebuildExtVectorElementExpr(Base.get(), FakeOperatorLoc, E->getAccessorLoc(), E->getAccessor()); @@ -9818,7 +9818,7 @@ // FIXME: Poor location information SourceLocation FakeLParenLoc = SemaRef.getLocForEndOfToken( - static_cast(Object.get())->getLocEnd()); + static_cast(Object.get())->getEndLoc()); // Transform the call arguments. SmallVector Args; @@ -9828,7 +9828,7 @@ return getDerived().RebuildCallExpr(Object.get(), FakeLParenLoc, Args, - E->getLocEnd()); + E->getEndLoc()); } #define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \ @@ -10011,7 +10011,7 @@ return getDerived().RebuildCXXTypeidExpr(E->getType(), E->getBeginLoc(), TInfo, - E->getLocEnd()); + E->getEndLoc()); } // We don't know whether the subexpression is potentially evaluated until @@ -10033,7 +10033,7 @@ return getDerived().RebuildCXXTypeidExpr(E->getType(), E->getBeginLoc(), SubExpr.get(), - E->getLocEnd()); + E->getEndLoc()); } template @@ -10052,7 +10052,7 @@ return getDerived().RebuildCXXUuidofExpr(E->getType(), E->getBeginLoc(), TInfo, - E->getLocEnd()); + E->getEndLoc()); } EnterExpressionEvaluationContext Unevaluated( @@ -10069,7 +10069,7 @@ return getDerived().RebuildCXXUuidofExpr(E->getType(), E->getBeginLoc(), SubExpr.get(), - E->getLocEnd()); + E->getEndLoc()); } template @@ -10654,7 +10654,7 @@ return getDerived().RebuildTypeTrait(E->getTrait(), E->getBeginLoc(), Args, - E->getLocEnd()); + E->getEndLoc()); } template @@ -10684,7 +10684,7 @@ E->getBeginLoc(), T, SubExpr.get(), - E->getLocEnd()); + E->getEndLoc()); } template @@ -10703,7 +10703,7 @@ } return getDerived().RebuildExpressionTrait( - E->getTrait(), E->getBeginLoc(), SubExpr.get(), E->getLocEnd()); + E->getTrait(), E->getBeginLoc(), SubExpr.get(), E->getEndLoc()); } template @@ -10912,7 +10912,7 @@ // prepared to handle list-initialization without a child InitListExpr. SourceLocation LParenLoc = T->getTypeLoc().getEndLoc(); return getDerived().RebuildCXXTemporaryObjectExpr( - T, LParenLoc, Args, E->getLocEnd(), + T, LParenLoc, Args, E->getEndLoc(), /*ListInitialization=*/LParenLoc.isInvalid()); } @@ -10996,7 +10996,7 @@ // Build the call operator. CXXMethodDecl *NewCallOperator = getSema().startLambdaDefinition( Class, E->getIntroducerRange(), NewCallOpTSI, - E->getCallOperator()->getLocEnd(), + E->getCallOperator()->getEndLoc(), NewCallOpTSI->getTypeLoc().castAs().getParams(), E->getCallOperator()->isConstexpr()); @@ -11173,7 +11173,7 @@ /*IsInstantiation*/ true); SavedContext.pop(); - return getSema().BuildLambdaExpr(E->getBeginLoc(), Body.get()->getLocEnd(), + return getSema().BuildLambdaExpr(E->getBeginLoc(), Body.get()->getEndLoc(), &LSICopy); } @@ -11621,7 +11621,7 @@ return getDerived().RebuildCXXFoldExpr( E->getBeginLoc(), LHS.get(), E->getOperator(), E->getEllipsisLoc(), - RHS.get(), E->getLocEnd()); + RHS.get(), E->getEndLoc()); } // The transform has determined that we should perform an elementwise @@ -11642,7 +11642,7 @@ Result = getDerived().RebuildCXXFoldExpr( E->getBeginLoc(), Out.get(), E->getOperator(), E->getEllipsisLoc(), - Result.get(), E->getLocEnd()); + Result.get(), E->getEndLoc()); if (Result.isInvalid()) return true; } @@ -11661,7 +11661,7 @@ LeftFold ? Result.get() : Out.get(), E->getOperator(), E->getEllipsisLoc(), LeftFold ? Out.get() : Result.get(), - E->getLocEnd()); + E->getEndLoc()); } else if (Result.isUsable()) { // We've got down to a single element; build a binary operator. Result = getDerived().RebuildBinaryOperator( @@ -11687,7 +11687,7 @@ Result = getDerived().RebuildCXXFoldExpr( E->getBeginLoc(), Result.get(), E->getOperator(), E->getEllipsisLoc(), - Out.get(), E->getLocEnd()); + Out.get(), E->getEndLoc()); if (Result.isInvalid()) return true; } @@ -11776,7 +11776,7 @@ Optional OrigNumExpansions = OrigElement.NumExpansions; Optional NumExpansions = OrigNumExpansions; SourceRange PatternRange(OrigElement.Key->getBeginLoc(), - OrigElement.Value->getLocEnd()); + OrigElement.Value->getEndLoc()); if (getDerived().TryExpandParameterPacks(OrigElement.EllipsisLoc, PatternRange, Unexpanded, Index: lib/Serialization/ASTReader.cpp =================================================================== --- lib/Serialization/ASTReader.cpp +++ lib/Serialization/ASTReader.cpp @@ -9673,7 +9673,7 @@ if (NumBases == 0) return SourceRange(); auto bases = DD->bases(); return SourceRange(bases[0].getBeginLoc(), - bases[NumBases - 1].getLocEnd()); + bases[NumBases - 1].getEndLoc()); }; if (FirstNumBases != SecondNumBases) { Index: lib/Serialization/ASTWriterDecl.cpp =================================================================== --- lib/Serialization/ASTWriterDecl.cpp +++ lib/Serialization/ASTWriterDecl.cpp @@ -550,7 +550,7 @@ Record.push_back(D->IsMultiVersion); Record.push_back(D->IsLateTemplateParsed); Record.push_back(D->getLinkageInternal()); - Record.AddSourceLocation(D->getLocEnd()); + Record.AddSourceLocation(D->getEndLoc()); Record.push_back(D->getODRHash()); @@ -665,7 +665,7 @@ Record.push_back(D->hasRelatedResultType()); Record.AddTypeRef(D->getReturnType()); Record.AddTypeSourceInfo(D->getReturnTypeSourceInfo()); - Record.AddSourceLocation(D->getLocEnd()); + Record.AddSourceLocation(D->getEndLoc()); Record.push_back(D->param_size()); for (const auto *P : D->parameters()) Record.AddDeclRef(P); @@ -1343,7 +1343,7 @@ ArrayRef IdentifierLocs = D->getIdentifierLocs(); Record.push_back(!IdentifierLocs.empty()); if (IdentifierLocs.empty()) { - Record.AddSourceLocation(D->getLocEnd()); + Record.AddSourceLocation(D->getEndLoc()); Record.push_back(1); } else { for (unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I) Index: lib/Serialization/ASTWriterStmt.cpp =================================================================== --- lib/Serialization/ASTWriterStmt.cpp +++ lib/Serialization/ASTWriterStmt.cpp @@ -1824,7 +1824,7 @@ Record.push_back(C->getClauseKind()); Visit(C); Record.AddSourceLocation(C->getBeginLoc()); - Record.AddSourceLocation(C->getLocEnd()); + Record.AddSourceLocation(C->getEndLoc()); } void OMPClauseWriter::VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C) { @@ -2279,7 +2279,7 @@ //===----------------------------------------------------------------------===// void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) { Record.AddSourceLocation(E->getBeginLoc()); - Record.AddSourceLocation(E->getLocEnd()); + Record.AddSourceLocation(E->getEndLoc()); OMPClauseWriter ClauseWriter(Record); for (unsigned i = 0; i < E->getNumClauses(); ++i) { ClauseWriter.writeClause(E->getClause(i)); Index: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp =================================================================== --- lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -1944,7 +1944,7 @@ // Use heuristics to determine if Ex is a macro expending to a literal and // if so, use the macro's name. SourceLocation LocStart = Ex->getBeginLoc(); - SourceLocation LocEnd = Ex->getLocEnd(); + SourceLocation LocEnd = Ex->getEndLoc(); if (LocStart.isMacroID() && LocEnd.isMacroID() && (isa(Ex) || isa(Ex) || Index: lib/StaticAnalyzer/Core/CheckerHelpers.cpp =================================================================== --- lib/StaticAnalyzer/Core/CheckerHelpers.cpp +++ lib/StaticAnalyzer/Core/CheckerHelpers.cpp @@ -24,7 +24,7 @@ if (S->getBeginLoc().isMacroID()) return true; - if (S->getLocEnd().isMacroID()) + if (S->getEndLoc().isMacroID()) return true; for (const Stmt *Child : S->children()) Index: lib/StaticAnalyzer/Core/PathDiagnostic.cpp =================================================================== --- lib/StaticAnalyzer/Core/PathDiagnostic.cpp +++ lib/StaticAnalyzer/Core/PathDiagnostic.cpp @@ -536,7 +536,7 @@ static SourceLocation getValidSourceLocation(const Stmt* S, LocationOrAnalysisDeclContext LAC, bool UseEnd = false) { - SourceLocation L = UseEnd ? S->getLocEnd() : S->getBeginLoc(); + SourceLocation L = UseEnd ? S->getEndLoc() : S->getBeginLoc(); assert(!LAC.isNull() && "A valid LocationContext or AnalysisDeclContext should " "be passed to PathDiagnosticLocation upon creation."); @@ -564,11 +564,11 @@ if (Body) L = Body->getBeginLoc(); else - L = ADC->getDecl()->getLocEnd(); + L = ADC->getDecl()->getEndLoc(); break; } - L = UseEnd ? Parent->getLocEnd() : Parent->getBeginLoc(); + L = UseEnd ? Parent->getEndLoc() : Parent->getBeginLoc(); } while (!L.isValid()); } Index: lib/Tooling/Refactoring/Extract/Extract.cpp =================================================================== --- lib/Tooling/Refactoring/Extract/Extract.cpp +++ lib/Tooling/Refactoring/Extract/Extract.cpp @@ -103,7 +103,7 @@ // Compute the source range of the code that should be extracted. SourceRange ExtractedRange(Code[0]->getBeginLoc(), - Code[Code.size() - 1]->getLocEnd()); + Code[Code.size() - 1]->getEndLoc()); // FIXME (Alex L): Add code that accounts for macro locations. ASTContext &AST = Context.getASTContext(); Index: lib/Tooling/Refactoring/Rename/USRFinder.cpp =================================================================== --- lib/Tooling/Refactoring/Rename/USRFinder.cpp +++ lib/Tooling/Refactoring/Rename/USRFinder.cpp @@ -84,7 +84,7 @@ // looking for the point cannot be inside of this decl. Don't even look at it. for (auto *CurrDecl : Context.getTranslationUnitDecl()->decls()) { SourceLocation StartLoc = CurrDecl->getBeginLoc(); - SourceLocation EndLoc = CurrDecl->getLocEnd(); + SourceLocation EndLoc = CurrDecl->getEndLoc(); if (StartLoc.isValid() && EndLoc.isValid() && SM.isBeforeInTranslationUnit(StartLoc, Point) != SM.isBeforeInTranslationUnit(EndLoc, Point)) Index: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp =================================================================== --- lib/Tooling/Refactoring/Rename/USRLocFinder.cpp +++ lib/Tooling/Refactoring/Rename/USRLocFinder.cpp @@ -260,7 +260,7 @@ // restrict the end of location to just before the `<` character. SourceLocation EndLoc = Expr->hasExplicitTemplateArgs() ? Expr->getLAngleLoc().getLocWithOffset(-1) - : Expr->getLocEnd(); + : Expr->getEndLoc(); if (const auto *MD = llvm::dyn_cast(Decl)) { if (isInUSRSet(MD)) { @@ -576,7 +576,7 @@ // Hanlde using declarations explicitly as "using a::Foo" don't trigger // typeLoc for "a::Foo". for (const auto *Using : Finder.getUsingDecls()) - Replace(Using->getBeginLoc(), Using->getLocEnd(), "using " + NewName.str()); + Replace(Using->getBeginLoc(), Using->getEndLoc(), "using " + NewName.str()); return AtomicChanges; } Index: tools/libclang/CIndex.cpp =================================================================== --- tools/libclang/CIndex.cpp +++ tools/libclang/CIndex.cpp @@ -1050,7 +1050,7 @@ SourceLocation L_B = B->getBeginLoc(); return L_A != L_B ? SM.isBeforeInTranslationUnit(L_A, L_B) : - SM.isBeforeInTranslationUnit(A->getLocEnd(), B->getLocEnd()); + SM.isBeforeInTranslationUnit(A->getEndLoc(), B->getEndLoc()); }); // Now visit the decls.