Index: clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp =================================================================== --- clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp +++ clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp @@ -710,7 +710,7 @@ const ast_matchers::MatchFinder::MatchResult &Result, const NamedDecl *FwdDecl) { SourceLocation Start = FwdDecl->getBeginLoc(); - SourceLocation End = FwdDecl->getLocEnd(); + SourceLocation End = FwdDecl->getEndLoc(); const SourceManager &SM = *Result.SourceManager; SourceLocation AfterSemi = Lexer::findLocationAfterToken( End, tok::semi, SM, Result.Context->getLangOpts(), @@ -911,7 +911,7 @@ const ast_matchers::MatchFinder::MatchResult &Result, const UsingDecl *UsingDeclaration) { SourceLocation Start = UsingDeclaration->getBeginLoc(); - SourceLocation End = UsingDeclaration->getLocEnd(); + SourceLocation End = UsingDeclaration->getEndLoc(); if (Start.isInvalid() || End.isInvalid()) return; Index: clang-tools-extra/trunk/clang-move/ClangMove.cpp =================================================================== --- clang-tools-extra/trunk/clang-move/ClangMove.cpp +++ clang-tools-extra/trunk/clang-move/ClangMove.cpp @@ -292,7 +292,7 @@ // If the expansion range is a character range, this is the location of // the first character past the end. Otherwise it's the location of the // first character in the final token in the range. - auto EndExpansionLoc = SM.getExpansionRange(D->getLocEnd()).getEnd(); + auto EndExpansionLoc = SM.getExpansionRange(D->getEndLoc()).getEnd(); std::pair LocInfo = SM.getDecomposedLoc(EndExpansionLoc); // Try to load the file buffer. bool InvalidTemp = false; @@ -327,8 +327,8 @@ getLocForEndOfDecl(D)); // Expand to comments that are associated with the Decl. if (const auto *Comment = D->getASTContext().getRawCommentForDeclNoCache(D)) { - if (SM.isBeforeInTranslationUnit(Full.getEnd(), Comment->getLocEnd())) - Full.setEnd(Comment->getLocEnd()); + if (SM.isBeforeInTranslationUnit(Full.getEnd(), Comment->getEndLoc())) + Full.setEnd(Comment->getEndLoc()); // FIXME: Don't delete a preceding comment, if there are no other entities // it could refer to. if (SM.isBeforeInTranslationUnit(Comment->getBeginLoc(), Full.getBegin())) Index: clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp @@ -64,7 +64,7 @@ return; SourceLocation EndLoc = - Lexer::getLocForEndOfToken(SM.getFileLoc(FlagArg->getLocEnd()), 0, SM, + Lexer::getLocForEndOfToken(SM.getFileLoc(FlagArg->getEndLoc()), 0, SM, Result.Context->getLangOpts()); diag(EndLoc, "%0 should use %1 where possible") Index: clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp @@ -243,7 +243,7 @@ CharSourceRange BeforeArgument = makeFileCharRange(ArgBeginLoc, Args[I]->getBeginLoc()); - ArgBeginLoc = Args[I]->getLocEnd(); + ArgBeginLoc = Args[I]->getEndLoc(); std::vector> Comments; if (BeforeArgument.isValid()) { @@ -251,7 +251,7 @@ } else { // Fall back to parsing back from the start of the argument. CharSourceRange ArgsRange = makeFileCharRange( - Args[I]->getBeginLoc(), Args[NumArgs - 1]->getLocEnd()); + Args[I]->getBeginLoc(), Args[NumArgs - 1]->getEndLoc()); Comments = getCommentsBeforeLoc(Ctx, ArgsRange.getBegin()); } @@ -287,7 +287,7 @@ if (!Callee) return; - checkCallArgs(Result.Context, Callee, Call->getCallee()->getLocEnd(), + checkCallArgs(Result.Context, Callee, Call->getCallee()->getEndLoc(), llvm::makeArrayRef(Call->getArgs(), Call->getNumArgs())); } else { const auto *Construct = cast(E); Index: clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp @@ -81,7 +81,7 @@ if (CtorInitIsWritten) { if (!ParamName.empty()) SafeFixIts.push_back( - FixItHint::CreateInsertion(CExpr->getLocEnd(), ParamName)); + FixItHint::CreateInsertion(CExpr->getEndLoc(), ParamName)); } else { if (Init->getSourceLocation().isMacroID() || Ctor->getLocation().isMacroID() || ShouldNotDoFixit) Index: clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp @@ -67,7 +67,7 @@ CharSourceRange::getTokenRange(EndExpr->getSourceRange()), *Result.SourceManager, getLangOpts()); const SourceLocation EndLoc = Lexer::getLocForEndOfToken( - AlgCall->getLocEnd(), 0, *Result.SourceManager, getLangOpts()); + AlgCall->getEndLoc(), 0, *Result.SourceManager, getLangOpts()); Hint = FixItHint::CreateInsertion(EndLoc, ", " + ReplacementText); } Index: clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp @@ -29,7 +29,7 @@ CharSourceRange CallRange = Lexer::makeFileCharRange(CharSourceRange::getTokenRange( - Callee->getBeginLoc(), Callee->getLocEnd()), + Callee->getBeginLoc(), Callee->getEndLoc()), SM, LangOpts); if (CallRange.isValid()) { Index: clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp @@ -62,7 +62,7 @@ } SourceLocation EndLoc = Lexer::getLocForEndOfToken( - Argument->getLocEnd(), 0, *Result.SourceManager, getLangOpts()); + Argument->getEndLoc(), 0, *Result.SourceManager, getLangOpts()); if (IsOneDigit) { Diag << FixItHint::CreateInsertion(Loc, IsWideCharType ? "L'" : "'") << FixItHint::CreateInsertion(EndLoc, "'"); Index: clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp @@ -51,7 +51,7 @@ SM.getSpellingLineNumber(Token.getLocation()) != SemicolonLine) return; - SourceLocation LocEnd = Semicolon->getLocEnd(); + SourceLocation LocEnd = Semicolon->getEndLoc(); FileID FID = SM.getFileID(LocEnd); llvm::MemoryBuffer *Buffer = SM.getBuffer(FID, LocEnd); Lexer Lexer(SM.getLocForStartOfFile(FID), Ctxt.getLangOpts(), Index: clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp @@ -84,7 +84,7 @@ match(expr(hasDescendant(typeLoc().bind("t"))), *E, *Result.Context); const auto *TL = selectFirst("t", Matches); D << FixItHint::CreateInsertion( - Lexer::getLocForEndOfToken(TL->getLocEnd(), 0, *Result.SourceManager, + Lexer::getLocForEndOfToken(TL->getEndLoc(), 0, *Result.SourceManager, getLangOpts()), Replacement); } Index: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp @@ -74,7 +74,7 @@ assert(Call && "Unhandled binding in the Matcher"); diag(Call->getBeginLoc(), "do not manage memory manually; %0") - << Recommendation << SourceRange(Call->getBeginLoc(), Call->getLocEnd()); + << Recommendation << SourceRange(Call->getBeginLoc(), Call->getEndLoc()); } } // namespace cppcoreguidelines Index: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp @@ -93,7 +93,7 @@ SourceRange(BaseRange.getEnd().getLocWithOffset(1), IndexRange.getBegin().getLocWithOffset(-1)), ", ") - << FixItHint::CreateReplacement(Matched->getLocEnd(), ")"); + << FixItHint::CreateReplacement(Matched->getEndLoc(), ")"); Optional Insertion = Inserter->CreateIncludeInsertion( Result.SourceManager->getMainFileID(), GslHeader, Index: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp @@ -81,7 +81,7 @@ if (!isa(SubExpr)) { CastText.push_back('('); diag_builder << FixItHint::CreateInsertion( - Lexer::getLocForEndOfToken(SubExpr->getLocEnd(), 0, + Lexer::getLocForEndOfToken(SubExpr->getEndLoc(), 0, *Result.SourceManager, getLangOpts()), ")"); } Index: clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp @@ -33,7 +33,7 @@ Result.Nodes.getNodeAs("decl")) { SourceRange DefaultArgRange = D->getDefaultArgRange(); - if (DefaultArgRange.getEnd() != D->getLocEnd()) { + if (DefaultArgRange.getEnd() != D->getEndLoc()) { return; } else if (DefaultArgRange.getBegin().isMacroID()) { diag(D->getBeginLoc(), Index: clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp @@ -135,7 +135,7 @@ if (!isa(SubExpr)) { CastText.push_back('('); Diag << FixItHint::CreateInsertion( - Lexer::getLocForEndOfToken(SubExpr->getLocEnd(), 0, SM, + Lexer::getLocForEndOfToken(SubExpr->getEndLoc(), 0, SM, getLangOpts()), ")"); } Index: clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp @@ -118,7 +118,7 @@ }; SourceRange ExplicitTokenRange = FindToken(*Result.SourceManager, getLangOpts(), - Ctor->getOuterLocStart(), Ctor->getLocEnd(), isKWExplicit); + Ctor->getOuterLocStart(), Ctor->getEndLoc(), isKWExplicit); StringRef ConstructorDescription; if (Ctor->isMoveConstructor()) ConstructorDescription = "move"; Index: clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp @@ -48,7 +48,7 @@ if (VD->getType()->getCanonicalTypeUnqualified() == C->getType()->getCanonicalTypeUnqualified()) { SourceLocation EndLoc = Lexer::getLocForEndOfToken( - VD->getInit()->getLocEnd(), 0, *Result.SourceManager, getLangOpts()); + VD->getInit()->getEndLoc(), 0, *Result.SourceManager, getLangOpts()); Diag << FixItHint::CreateReplacement(TypeRange, "std::string") << FixItHint::CreateInsertion(VD->getInit()->getBeginLoc(), "(") << FixItHint::CreateInsertion(EndLoc, ").str()"); Index: clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp @@ -885,7 +885,7 @@ diag(Loc, "expression always evaluates to 0"); } else if (exprEvaluatesToBitwiseNegatedZero(Opcode, Value)) { SourceRange ConstExprRange(ConstExpr->getBeginLoc(), - ConstExpr->getLocEnd()); + ConstExpr->getEndLoc()); StringRef ConstExprText = Lexer::getSourceText( CharSourceRange::getTokenRange(ConstExprRange), *Result.SourceManager, Result.Context->getLangOpts()); @@ -893,7 +893,7 @@ diag(Loc, "expression always evaluates to '%0'") << ConstExprText; } else if (exprEvaluatesToSymbolic(Opcode, Value)) { - SourceRange SymExprRange(Sym->getBeginLoc(), Sym->getLocEnd()); + SourceRange SymExprRange(Sym->getBeginLoc(), Sym->getEndLoc()); StringRef ExprText = Lexer::getSourceText( CharSourceRange::getTokenRange(SymExprRange), *Result.SourceManager, Index: clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp @@ -129,7 +129,7 @@ FixItHints.push_back(FixItHint::CreateRemoval( SourceRange(AssertExprRoot->getOperatorLoc()))); FixItHints.push_back(FixItHint::CreateRemoval( - SourceRange(AssertMSG->getBeginLoc(), AssertMSG->getLocEnd()))); + SourceRange(AssertMSG->getBeginLoc(), AssertMSG->getEndLoc()))); StaticAssertMSG = (Twine(", \"") + AssertMSG->getString() + "\"").str(); } Index: clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp @@ -36,7 +36,7 @@ FoundDecls[AliasDecl] = CharSourceRange::getCharRange( AliasDecl->getBeginLoc(), Lexer::findLocationAfterToken( - AliasDecl->getLocEnd(), tok::semi, *Result.SourceManager, + AliasDecl->getEndLoc(), tok::semi, *Result.SourceManager, getLangOpts(), /*SkipTrailingWhitespaceAndNewLine=*/true)); return; Index: clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp @@ -46,10 +46,10 @@ if (PrevNode) return CharSourceRange::getTokenRange( - Lexer::getLocForEndOfToken(PrevNode->getLocEnd(), 0, + Lexer::getLocForEndOfToken(PrevNode->getEndLoc(), 0, *Result.SourceManager, Result.Context->getLangOpts()), - Node->getLocEnd()); + Node->getEndLoc()); return CharSourceRange::getTokenRange(Node->getSourceRange()); } Index: clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp @@ -70,7 +70,7 @@ Context.UsingDeclRange = CharSourceRange::getCharRange( Using->getBeginLoc(), Lexer::findLocationAfterToken( - Using->getLocEnd(), tok::semi, *Result.SourceManager, getLangOpts(), + Using->getEndLoc(), tok::semi, *Result.SourceManager, getLangOpts(), /*SkipTrailingWhitespaceAndNewLine=*/true)); for (const auto *UsingShadow : Using->shadows()) { const auto *TargetDecl = UsingShadow->getTargetDecl()->getCanonicalDecl(); Index: clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp @@ -59,7 +59,7 @@ } B.Tokens = Lexer::getSourceText( - CharSourceRange::getTokenRange(E->getBeginLoc(), E->getLocEnd()), + CharSourceRange::getTokenRange(E->getBeginLoc(), E->getEndLoc()), *Result.SourceManager, Result.Context->getLangOpts()); SmallVector Matches; Index: clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp @@ -201,7 +201,7 @@ SourceLocation ResetCallStart = Reset->getExprLoc(); SourceLocation ExprStart = Expr->getBeginLoc(); SourceLocation ExprEnd = - Lexer::getLocForEndOfToken(Expr->getLocEnd(), 0, SM, getLangOpts()); + Lexer::getLocForEndOfToken(Expr->getEndLoc(), 0, SM, getLangOpts()); bool InMacro = ExprStart.isMacroID(); Index: clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp @@ -207,7 +207,7 @@ TypeLoc ValueTL = RefTL.getPointeeLoc(); auto TypeRange = CharSourceRange::getTokenRange(ParmDecl->getBeginLoc(), - ParamTL.getLocEnd()); + ParamTL.getEndLoc()); std::string ValueStr = Lexer::getSourceText(CharSourceRange::getTokenRange( ValueTL.getSourceRange()), SM, getLangOpts()) Index: clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp @@ -105,7 +105,7 @@ const Stmt *Body = Function->getBody(); SourceLocation Start = Function->getBeginLoc(); SourceLocation End = - Body ? Body->getBeginLoc().getLocWithOffset(-1) : Function->getLocEnd(); + Body ? Body->getBeginLoc().getLocWithOffset(-1) : Function->getEndLoc(); removeVoidArgumentTokens(Result, SourceRange(Start, End), "function definition"); } else { Index: clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp @@ -141,7 +141,7 @@ Diag << FixItHint::CreateReplacement(FunctionNameSourceRange, EmplacePrefix); const SourceRange CallParensRange = - MakeCall ? SourceRange(MakeCall->getCallee()->getLocEnd(), + MakeCall ? SourceRange(MakeCall->getCallee()->getEndLoc(), MakeCall->getRParenLoc()) : CtorCall->getParenOrBraceRange(); Index: clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDeleteCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDeleteCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDeleteCheck.cpp @@ -55,7 +55,7 @@ if (const auto *Func = Result.Nodes.getNodeAs(SpecialFunction)) { SourceLocation EndLoc = Lexer::getLocForEndOfToken( - Func->getLocEnd(), 0, *Result.SourceManager, getLangOpts()); + Func->getEndLoc(), 0, *Result.SourceManager, getLangOpts()); // FIXME: Improve FixItHint to make the method public. diag(Func->getLocation(), Index: clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp @@ -215,7 +215,7 @@ } SourceLocation StartLoc = FirstSubExpr->getBeginLoc(); - SourceLocation EndLoc = FirstSubExpr->getLocEnd(); + SourceLocation EndLoc = FirstSubExpr->getEndLoc(); // If the location comes from a macro arg expansion, *all* uses of that // arg must be checked to result in NullTo(Member)Pointer casts. Index: clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp @@ -58,14 +58,14 @@ if (C) { BeginLoc = C->getBeginLoc(); - EndLoc = C->getLocEnd(); + EndLoc = C->getEndLoc(); } else if (const auto *E = Result.Nodes.getNodeAs("call_expr")) { BeginLoc = E->getBeginLoc(); - EndLoc = E->getLocEnd(); + EndLoc = E->getEndLoc(); } else if (const auto *D = Result.Nodes.getNodeAs("decl_ref_expr")) { BeginLoc = D->getBeginLoc(); - EndLoc = D->getLocEnd(); + EndLoc = D->getEndLoc(); WarnOnly = true; } else { const auto *U = Result.Nodes.getNodeAs("using_decl"); Index: clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp @@ -96,7 +96,7 @@ << FindFunc << FixItHint::CreateReplacement( CharSourceRange::getTokenRange(Literal->getBeginLoc(), - Literal->getLocEnd()), + Literal->getEndLoc()), *Replacement); } Index: clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp @@ -26,8 +26,8 @@ CharSourceRange::getCharRange(Call->getBeginLoc(), Arg->getBeginLoc()), SM, LangOpts); CharSourceRange AfterArgumentsRange = Lexer::makeFileCharRange( - CharSourceRange::getCharRange(Call->getLocEnd(), - Call->getLocEnd().getLocWithOffset(1)), + CharSourceRange::getCharRange(Call->getEndLoc(), + Call->getEndLoc().getLocWithOffset(1)), SM, LangOpts); if (BeforeArgumentsRange.isValid() && AfterArgumentsRange.isValid()) { Index: clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp @@ -23,7 +23,7 @@ SourceRange getTypeRange(const ParmVarDecl &Param) { if (Param.getIdentifier() != nullptr) return SourceRange(Param.getBeginLoc(), - Param.getLocEnd().getLocWithOffset(-1)); + Param.getEndLoc().getLocWithOffset(-1)); return Param.getSourceRange(); } @@ -97,7 +97,7 @@ Diag << Param; } - if (Param->getBeginLoc().isMacroID() != Param->getLocEnd().isMacroID()) { + if (Param->getBeginLoc().isMacroID() != Param->getEndLoc().isMacroID()) { // Do not offer a suggestion if the part of the variable declaration comes // from a macro. return; Index: clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp @@ -177,9 +177,9 @@ if (S->getBeginLoc().isMacroID()) return SourceLocation(); - SourceLocation CondEndLoc = S->getCond()->getLocEnd(); + SourceLocation CondEndLoc = S->getCond()->getEndLoc(); if (const DeclStmt *CondVar = S->getConditionVariableDeclStmt()) - CondEndLoc = CondVar->getLocEnd(); + CondEndLoc = CondVar->getEndLoc(); if (!CondEndLoc.isValid()) { return SourceLocation(); Index: clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp @@ -63,7 +63,7 @@ Diag << FixItHint::CreateRemoval(CharSourceRange::getTokenRange( IfWithDelete->getBeginLoc(), - Lexer::getLocForEndOfToken(IfWithDelete->getCond()->getLocEnd(), 0, + Lexer::getLocForEndOfToken(IfWithDelete->getCond()->getEndLoc(), 0, *Result.SourceManager, Result.Context->getLangOpts()))); if (Compound) { Index: clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp @@ -162,8 +162,8 @@ // Count the lines including whitespace and comments. Really simple. if (const Stmt *Body = Func->getBody()) { SourceManager *SM = Result.SourceManager; - if (SM->isWrittenInSameFile(Body->getBeginLoc(), Body->getLocEnd())) { - FI.Lines = SM->getSpellingLineNumber(Body->getLocEnd()) - + if (SM->isWrittenInSameFile(Body->getBeginLoc(), Body->getEndLoc())) { + FI.Lines = SM->getSpellingLineNumber(Body->getEndLoc()) - SM->getSpellingLineNumber(Body->getBeginLoc()); } } Index: clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp @@ -145,7 +145,7 @@ } SourceLocation EndLoc = Lexer::getLocForEndOfToken( - Cast->getLocEnd(), 0, Context.getSourceManager(), Context.getLangOpts()); + Cast->getEndLoc(), 0, Context.getSourceManager(), Context.getLangOpts()); Diag << FixItHint::CreateInsertion(EndLoc, EndLocInsertion); } @@ -189,7 +189,7 @@ if (NeedParens) { SourceLocation EndLoc = Lexer::getLocForEndOfToken( - Cast->getLocEnd(), 0, Context.getSourceManager(), + Cast->getEndLoc(), 0, Context.getSourceManager(), Context.getLangOpts()); Diag << FixItHint::CreateInsertion(EndLoc, ")"); Index: clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp @@ -40,7 +40,7 @@ if (IfLoc.isMacroID() || ElseLoc.isMacroID()) return; - if (SM.getExpansionLineNumber(If->getThen()->getLocEnd()) == + if (SM.getExpansionLineNumber(If->getThen()->getEndLoc()) == SM.getExpansionLineNumber(ElseLoc)) return; Index: clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp @@ -81,7 +81,7 @@ SourceLocation Start; if (Previous != Block->body_rend()) Start = Lexer::findLocationAfterToken( - dyn_cast(*Previous)->getLocEnd(), tok::semi, SM, getLangOpts(), + dyn_cast(*Previous)->getEndLoc(), tok::semi, SM, getLangOpts(), /*SkipTrailingWhitespaceAndNewLine=*/true); if (!Start.isValid()) Start = StmtRange.getBegin(); Index: clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp @@ -385,7 +385,7 @@ const Expr *ReplaceWith, bool Negated) { std::string Replacement = replacementExpression(Result, Negated, ReplaceWith); - SourceRange Range(LHS->getBeginLoc(), RHS->getLocEnd()); + SourceRange Range(LHS->getBeginLoc(), RHS->getEndLoc()); issueDiag(Result, Bool->getBeginLoc(), SimplifyOperatorDiagnostic, Range, Replacement); }; @@ -641,7 +641,7 @@ "return " + replacementExpression(Result, Negated, Condition); issueDiag( Result, Lit->getBeginLoc(), SimplifyConditionalReturnDiagnostic, - SourceRange(If->getBeginLoc(), Ret->getLocEnd()), Replacement); + SourceRange(If->getBeginLoc(), Ret->getEndLoc()), Replacement); return; } Index: clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp @@ -63,7 +63,7 @@ DiagBuilder << FixItHint::CreateInsertion(Member->getBeginLoc(), "(*") << FixItHint::CreateInsertion(Member->getOperatorLoc(), ")"); DiagBuilder << FixItHint::CreateRemoval( - {Member->getOperatorLoc(), Call->getLocEnd()}); + {Member->getOperatorLoc(), Call->getEndLoc()}); } void SimplifySubscriptExprCheck::storeOptions( Index: clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp @@ -52,7 +52,7 @@ return; SourceLocation AfterPtr = Lexer::getLocForEndOfToken( - PtrExpr->getLocEnd(), 0, *Result.SourceManager, getLangOpts()); + PtrExpr->getEndLoc(), 0, *Result.SourceManager, getLangOpts()); diag(DeleteExpr->getBeginLoc(), "prefer '= nullptr' to 'delete x.release()' to reset unique_ptr<> " @@ -60,7 +60,7 @@ << FixItHint::CreateRemoval(CharSourceRange::getCharRange( DeleteExpr->getBeginLoc(), PtrExpr->getBeginLoc())) << FixItHint::CreateReplacement( - CharSourceRange::getTokenRange(AfterPtr, DeleteExpr->getLocEnd()), + CharSourceRange::getTokenRange(AfterPtr, DeleteExpr->getEndLoc()), " = nullptr"); } Index: clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp =================================================================== --- clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp +++ clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp @@ -52,7 +52,7 @@ auto *Cond = If->getCond(); SourceRange Range = Cond->getSourceRange(); if (auto *D = If->getConditionVariable()) { - Range = SourceRange(D->getBeginLoc(), D->getLocEnd()); + Range = SourceRange(D->getBeginLoc(), D->getEndLoc()); } diag(Range.getBegin(), "the cake is a lie") << FixItHint::CreateReplacement( CharSourceRange::getTokenRange(Range), "false");