Author: steveire Date: Thu Aug 9 15:43:02 2018 New Revision: 339401 URL: http://llvm.org/viewvc/llvm-project?rev=339401&view=rev Log: Port getLocEnd -> getEndLoc
Subscribers: nemanjai, ioeric, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D50355 Modified: clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp clang-tools-extra/trunk/clang-move/ClangMove.cpp clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDeleteCheck.cpp clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp Modified: clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp (original) +++ clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp Thu Aug 9 15:43:02 2018 @@ -710,7 +710,7 @@ void ChangeNamespaceTool::moveClassForwa 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 @@ void ChangeNamespaceTool::fixUsingShadow 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; Modified: clang-tools-extra/trunk/clang-move/ClangMove.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-move/ClangMove.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-move/ClangMove.cpp (original) +++ clang-tools-extra/trunk/clang-move/ClangMove.cpp Thu Aug 9 15:43:02 2018 @@ -292,7 +292,7 @@ getLocForEndOfDecl(const clang::Decl *D, // 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<FileID, unsigned> LocInfo = SM.getDecomposedLoc(EndExpansionLoc); // Try to load the file buffer. bool InvalidTemp = false; @@ -327,8 +327,8 @@ getFullRange(const clang::Decl *D, 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())) Modified: clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/android/CloexecCheck.cpp Thu Aug 9 15:43:02 2018 @@ -64,7 +64,7 @@ void CloexecCheck::insertMacroFlag(const 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") Modified: clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp Thu Aug 9 15:43:02 2018 @@ -243,7 +243,7 @@ void ArgumentCommentCheck::checkCallArgs CharSourceRange BeforeArgument = makeFileCharRange(ArgBeginLoc, Args[I]->getBeginLoc()); - ArgBeginLoc = Args[I]->getLocEnd(); + ArgBeginLoc = Args[I]->getEndLoc(); std::vector<std::pair<SourceLocation, StringRef>> Comments; if (BeforeArgument.isValid()) { @@ -251,7 +251,7 @@ void ArgumentCommentCheck::checkCallArgs } 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 @@ void ArgumentCommentCheck::check(const M 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<CXXConstructExpr>(E); Modified: clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/bugprone/CopyConstructorInitCheck.cpp Thu Aug 9 15:43:02 2018 @@ -81,7 +81,7 @@ void CopyConstructorInitCheck::check(con 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) Modified: clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/bugprone/InaccurateEraseCheck.cpp Thu Aug 9 15:43:02 2018 @@ -67,7 +67,7 @@ void InaccurateEraseCheck::check(const M 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); } Modified: clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp Thu Aug 9 15:43:02 2018 @@ -29,7 +29,7 @@ static void replaceMoveWithForward(const CharSourceRange CallRange = Lexer::makeFileCharRange(CharSourceRange::getTokenRange( - Callee->getBeginLoc(), Callee->getLocEnd()), + Callee->getBeginLoc(), Callee->getEndLoc()), SM, LangOpts); if (CallRange.isValid()) { Modified: clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp Thu Aug 9 15:43:02 2018 @@ -62,7 +62,7 @@ void StringIntegerAssignmentCheck::check } 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, "'"); Modified: clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp Thu Aug 9 15:43:02 2018 @@ -51,7 +51,7 @@ void SuspiciousSemicolonCheck::check(con 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(), Modified: clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/bugprone/UnusedRaiiCheck.cpp Thu Aug 9 15:43:02 2018 @@ -84,7 +84,7 @@ void UnusedRaiiCheck::check(const MatchF match(expr(hasDescendant(typeLoc().bind("t"))), *E, *Result.Context); const auto *TL = selectFirst<TypeLoc>("t", Matches); D << FixItHint::CreateInsertion( - Lexer::getLocForEndOfToken(TL->getLocEnd(), 0, *Result.SourceManager, + Lexer::getLocForEndOfToken(TL->getEndLoc(), 0, *Result.SourceManager, getLangOpts()), Replacement); } Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp Thu Aug 9 15:43:02 2018 @@ -74,7 +74,7 @@ void NoMallocCheck::check(const MatchFin 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 Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp Thu Aug 9 15:43:02 2018 @@ -93,7 +93,7 @@ void ProBoundsConstantArrayIndexCheck::c SourceRange(BaseRange.getEnd().getLocWithOffset(1), IndexRange.getBegin().getLocWithOffset(-1)), ", ") - << FixItHint::CreateReplacement(Matched->getLocEnd(), ")"); + << FixItHint::CreateReplacement(Matched->getEndLoc(), ")"); Optional<FixItHint> Insertion = Inserter->CreateIncludeInsertion( Result.SourceManager->getMainFileID(), GslHeader, Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp Thu Aug 9 15:43:02 2018 @@ -81,7 +81,7 @@ void ProTypeCstyleCastCheck::check(const if (!isa<ParenExpr>(SubExpr)) { CastText.push_back('('); diag_builder << FixItHint::CreateInsertion( - Lexer::getLocForEndOfToken(SubExpr->getLocEnd(), 0, + Lexer::getLocForEndOfToken(SubExpr->getEndLoc(), 0, *Result.SourceManager, getLangOpts()), ")"); } Modified: clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp Thu Aug 9 15:43:02 2018 @@ -33,7 +33,7 @@ void DefaultArgumentsCheck::check(const Result.Nodes.getNodeAs<ParmVarDecl>("decl")) { SourceRange DefaultArgRange = D->getDefaultArgRange(); - if (DefaultArgRange.getEnd() != D->getLocEnd()) { + if (DefaultArgRange.getEnd() != D->getEndLoc()) { return; } else if (DefaultArgRange.getBegin().isMacroID()) { diag(D->getBeginLoc(), Modified: clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp Thu Aug 9 15:43:02 2018 @@ -135,7 +135,7 @@ void AvoidCStyleCastsCheck::check(const if (!isa<ParenExpr>(SubExpr)) { CastText.push_back('('); Diag << FixItHint::CreateInsertion( - Lexer::getLocForEndOfToken(SubExpr->getLocEnd(), 0, SM, + Lexer::getLocForEndOfToken(SubExpr->getEndLoc(), 0, SM, getLangOpts()), ")"); } Modified: clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp Thu Aug 9 15:43:02 2018 @@ -118,7 +118,7 @@ void ExplicitConstructorCheck::check(con }; SourceRange ExplicitTokenRange = FindToken(*Result.SourceManager, getLangOpts(), - Ctor->getOuterLocStart(), Ctor->getLocEnd(), isKWExplicit); + Ctor->getOuterLocStart(), Ctor->getEndLoc(), isKWExplicit); StringRef ConstructorDescription; if (Ctor->isMoveConstructor()) ConstructorDescription = "move"; Modified: clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp Thu Aug 9 15:43:02 2018 @@ -48,7 +48,7 @@ void TwineLocalCheck::check(const MatchF 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()"); Modified: clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp Thu Aug 9 15:43:02 2018 @@ -885,7 +885,7 @@ void RedundantExpressionCheck::checkBitw 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 @@ void RedundantExpressionCheck::checkBitw 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, Modified: clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.cpp Thu Aug 9 15:43:02 2018 @@ -129,7 +129,7 @@ void StaticAssertCheck::check(const Matc 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(); } Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp Thu Aug 9 15:43:02 2018 @@ -36,7 +36,7 @@ void UnusedAliasDeclsCheck::check(const FoundDecls[AliasDecl] = CharSourceRange::getCharRange( AliasDecl->getBeginLoc(), Lexer::findLocationAfterToken( - AliasDecl->getLocEnd(), tok::semi, *Result.SourceManager, + AliasDecl->getEndLoc(), tok::semi, *Result.SourceManager, getLangOpts(), /*SkipTrailingWhitespaceAndNewLine=*/true)); return; Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp Thu Aug 9 15:43:02 2018 @@ -46,10 +46,10 @@ static CharSourceRange removeNode(const 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()); } Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp Thu Aug 9 15:43:02 2018 @@ -70,7 +70,7 @@ void UnusedUsingDeclsCheck::check(const 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(); Modified: clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp Thu Aug 9 15:43:02 2018 @@ -59,7 +59,7 @@ buildBindArguments(const MatchFinder::Ma } B.Tokens = Lexer::getSourceText( - CharSourceRange::getTokenRange(E->getBeginLoc(), E->getLocEnd()), + CharSourceRange::getTokenRange(E->getBeginLoc(), E->getEndLoc()), *Result.SourceManager, Result.Context->getLangOpts()); SmallVector<StringRef, 2> Matches; Modified: clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/modernize/MakeSmartPtrCheck.cpp Thu Aug 9 15:43:02 2018 @@ -201,7 +201,7 @@ void MakeSmartPtrCheck::checkReset(Sourc 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(); Modified: clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp Thu Aug 9 15:43:02 2018 @@ -207,7 +207,7 @@ void PassByValueCheck::check(const Match 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()) Modified: clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp Thu Aug 9 15:43:02 2018 @@ -105,7 +105,7 @@ void RedundantVoidArgCheck::processFunct 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 { Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp Thu Aug 9 15:43:02 2018 @@ -141,7 +141,7 @@ void UseEmplaceCheck::check(const MatchF Diag << FixItHint::CreateReplacement(FunctionNameSourceRange, EmplacePrefix); const SourceRange CallParensRange = - MakeCall ? SourceRange(MakeCall->getCallee()->getLocEnd(), + MakeCall ? SourceRange(MakeCall->getCallee()->getEndLoc(), MakeCall->getRParenLoc()) : CtorCall->getParenOrBraceRange(); Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDeleteCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDeleteCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDeleteCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/modernize/UseEqualsDeleteCheck.cpp Thu Aug 9 15:43:02 2018 @@ -55,7 +55,7 @@ void UseEqualsDeleteCheck::check(const M if (const auto *Func = Result.Nodes.getNodeAs<CXXMethodDecl>(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(), Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp Thu Aug 9 15:43:02 2018 @@ -215,7 +215,7 @@ public: } 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. Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp Thu Aug 9 15:43:02 2018 @@ -58,14 +58,14 @@ void UseUncaughtExceptionsCheck::check(c if (C) { BeginLoc = C->getBeginLoc(); - EndLoc = C->getLocEnd(); + EndLoc = C->getEndLoc(); } else if (const auto *E = Result.Nodes.getNodeAs<CallExpr>("call_expr")) { BeginLoc = E->getBeginLoc(); - EndLoc = E->getLocEnd(); + EndLoc = E->getEndLoc(); } else if (const auto *D = Result.Nodes.getNodeAs<DeclRefExpr>("decl_ref_expr")) { BeginLoc = D->getBeginLoc(); - EndLoc = D->getLocEnd(); + EndLoc = D->getEndLoc(); WarnOnly = true; } else { const auto *U = Result.Nodes.getNodeAs<UsingDecl>("using_decl"); Modified: clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/performance/FasterStringFindCheck.cpp Thu Aug 9 15:43:02 2018 @@ -96,7 +96,7 @@ void FasterStringFindCheck::check(const << FindFunc << FixItHint::CreateReplacement( CharSourceRange::getTokenRange(Literal->getBeginLoc(), - Literal->getLocEnd()), + Literal->getEndLoc()), *Replacement); } Modified: clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/performance/MoveConstArgCheck.cpp Thu Aug 9 15:43:02 2018 @@ -26,8 +26,8 @@ static void ReplaceCallWithArg(const Cal 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()) { Modified: clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp Thu Aug 9 15:43:02 2018 @@ -23,7 +23,7 @@ namespace { 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 @@ void AvoidConstParamsInDecls::check(cons 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; Modified: clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.cpp Thu Aug 9 15:43:02 2018 @@ -177,9 +177,9 @@ BracesAroundStatementsCheck::findRParenL 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(); Modified: clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/readability/DeleteNullPointerCheck.cpp Thu Aug 9 15:43:02 2018 @@ -63,7 +63,7 @@ void DeleteNullPointerCheck::check(const 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) { Modified: clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.cpp Thu Aug 9 15:43:02 2018 @@ -162,8 +162,8 @@ void FunctionSizeCheck::check(const Matc // 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()); } } Modified: clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolConversionCheck.cpp Thu Aug 9 15:43:02 2018 @@ -145,7 +145,7 @@ void fixGenericExprCastToBool(Diagnostic } 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 @@ void fixGenericExprCastFromBool(Diagnost if (NeedParens) { SourceLocation EndLoc = Lexer::getLocForEndOfToken( - Cast->getLocEnd(), 0, Context.getSourceManager(), + Cast->getEndLoc(), 0, Context.getSourceManager(), Context.getLangOpts()); Diag << FixItHint::CreateInsertion(EndLoc, ")"); Modified: clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/readability/MisleadingIndentationCheck.cpp Thu Aug 9 15:43:02 2018 @@ -40,7 +40,7 @@ void MisleadingIndentationCheck::danglin if (IfLoc.isMacroID() || ElseLoc.isMacroID()) return; - if (SM.getExpansionLineNumber(If->getThen()->getLocEnd()) == + if (SM.getExpansionLineNumber(If->getThen()->getEndLoc()) == SM.getExpansionLineNumber(ElseLoc)) return; Modified: clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp Thu Aug 9 15:43:02 2018 @@ -81,7 +81,7 @@ void RedundantControlFlowCheck::issueDia SourceLocation Start; if (Previous != Block->body_rend()) Start = Lexer::findLocationAfterToken( - dyn_cast<Stmt>(*Previous)->getLocEnd(), tok::semi, SM, getLangOpts(), + dyn_cast<Stmt>(*Previous)->getEndLoc(), tok::semi, SM, getLangOpts(), /*SkipTrailingWhitespaceAndNewLine=*/true); if (!Start.isValid()) Start = StmtRange.getBegin(); Modified: clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp Thu Aug 9 15:43:02 2018 @@ -385,7 +385,7 @@ void SimplifyBooleanExprCheck::reportBin 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 @@ void SimplifyBooleanExprCheck::replaceCo "return " + replacementExpression(Result, Negated, Condition); issueDiag( Result, Lit->getBeginLoc(), SimplifyConditionalReturnDiagnostic, - SourceRange(If->getBeginLoc(), Ret->getLocEnd()), Replacement); + SourceRange(If->getBeginLoc(), Ret->getEndLoc()), Replacement); return; } Modified: clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/readability/SimplifySubscriptExprCheck.cpp Thu Aug 9 15:43:02 2018 @@ -63,7 +63,7 @@ void SimplifySubscriptExprCheck::check(c DiagBuilder << FixItHint::CreateInsertion(Member->getBeginLoc(), "(*") << FixItHint::CreateInsertion(Member->getOperatorLoc(), ")"); DiagBuilder << FixItHint::CreateRemoval( - {Member->getOperatorLoc(), Call->getLocEnd()}); + {Member->getOperatorLoc(), Call->getEndLoc()}); } void SimplifySubscriptExprCheck::storeOptions( Modified: clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp Thu Aug 9 15:43:02 2018 @@ -52,7 +52,7 @@ void UniqueptrDeleteReleaseCheck::check( 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 @@ void UniqueptrDeleteReleaseCheck::check( << FixItHint::CreateRemoval(CharSourceRange::getCharRange( DeleteExpr->getBeginLoc(), PtrExpr->getBeginLoc())) << FixItHint::CreateReplacement( - CharSourceRange::getTokenRange(AfterPtr, DeleteExpr->getLocEnd()), + CharSourceRange::getTokenRange(AfterPtr, DeleteExpr->getEndLoc()), " = nullptr"); } Modified: clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp?rev=339401&r1=339400&r2=339401&view=diff ============================================================================== --- clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp (original) +++ clang-tools-extra/trunk/unittests/clang-tidy/OverlappingReplacementsTest.cpp Thu Aug 9 15:43:02 2018 @@ -52,7 +52,7 @@ public: 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"); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits