steveire created this revision.
Herald added subscribers: cfe-commits, kbarton, ioeric, nemanjai.

Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50355

Files:
  change-namespace/ChangeNamespace.cpp
  clang-move/ClangMove.cpp
  clang-tidy/android/CloexecCheck.cpp
  clang-tidy/bugprone/ArgumentCommentCheck.cpp
  clang-tidy/bugprone/CopyConstructorInitCheck.cpp
  clang-tidy/bugprone/InaccurateEraseCheck.cpp
  clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
  clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp
  clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp
  clang-tidy/bugprone/UnusedRaiiCheck.cpp
  clang-tidy/cppcoreguidelines/NoMallocCheck.cpp
  clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
  clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp
  clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
  clang-tidy/google/AvoidCStyleCastsCheck.cpp
  clang-tidy/google/ExplicitConstructorCheck.cpp
  clang-tidy/llvm/TwineLocalCheck.cpp
  clang-tidy/misc/RedundantExpressionCheck.cpp
  clang-tidy/misc/StaticAssertCheck.cpp
  clang-tidy/misc/UnusedAliasDeclsCheck.cpp
  clang-tidy/misc/UnusedParametersCheck.cpp
  clang-tidy/misc/UnusedUsingDeclsCheck.cpp
  clang-tidy/modernize/AvoidBindCheck.cpp
  clang-tidy/modernize/MakeSmartPtrCheck.cpp
  clang-tidy/modernize/PassByValueCheck.cpp
  clang-tidy/modernize/RedundantVoidArgCheck.cpp
  clang-tidy/modernize/UseEmplaceCheck.cpp
  clang-tidy/modernize/UseEqualsDeleteCheck.cpp
  clang-tidy/modernize/UseNullptrCheck.cpp
  clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
  clang-tidy/performance/FasterStringFindCheck.cpp
  clang-tidy/performance/MoveConstArgCheck.cpp
  clang-tidy/readability/AvoidConstParamsInDecls.cpp
  clang-tidy/readability/BracesAroundStatementsCheck.cpp
  clang-tidy/readability/DeleteNullPointerCheck.cpp
  clang-tidy/readability/FunctionSizeCheck.cpp
  clang-tidy/readability/ImplicitBoolConversionCheck.cpp
  clang-tidy/readability/MisleadingIndentationCheck.cpp
  clang-tidy/readability/RedundantControlFlowCheck.cpp
  clang-tidy/readability/SimplifyBooleanExprCheck.cpp
  clang-tidy/readability/SimplifySubscriptExprCheck.cpp
  clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
  unittests/clang-tidy/OverlappingReplacementsTest.cpp

Index: unittests/clang-tidy/OverlappingReplacementsTest.cpp
===================================================================
--- unittests/clang-tidy/OverlappingReplacementsTest.cpp
+++ 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");
Index: clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
===================================================================
--- clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
+++ clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
@@ -52,15 +52,15 @@
     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<> "
        "objects")
       << FixItHint::CreateRemoval(CharSourceRange::getCharRange(
              DeleteExpr->getBeginLoc(), PtrExpr->getBeginLoc()))
       << FixItHint::CreateReplacement(
-             CharSourceRange::getTokenRange(AfterPtr, DeleteExpr->getLocEnd()),
+             CharSourceRange::getTokenRange(AfterPtr, DeleteExpr->getEndLoc()),
              " = nullptr");
 }
 
Index: clang-tidy/readability/SimplifySubscriptExprCheck.cpp
===================================================================
--- clang-tidy/readability/SimplifySubscriptExprCheck.cpp
+++ 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-tidy/readability/SimplifyBooleanExprCheck.cpp
===================================================================
--- clang-tidy/readability/SimplifyBooleanExprCheck.cpp
+++ 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-tidy/readability/RedundantControlFlowCheck.cpp
===================================================================
--- clang-tidy/readability/RedundantControlFlowCheck.cpp
+++ clang-tidy/readability/RedundantControlFlowCheck.cpp
@@ -81,7 +81,7 @@
   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();
Index: clang-tidy/readability/MisleadingIndentationCheck.cpp
===================================================================
--- clang-tidy/readability/MisleadingIndentationCheck.cpp
+++ 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-tidy/readability/ImplicitBoolConversionCheck.cpp
===================================================================
--- clang-tidy/readability/ImplicitBoolConversionCheck.cpp
+++ 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-tidy/readability/FunctionSizeCheck.cpp
===================================================================
--- clang-tidy/readability/FunctionSizeCheck.cpp
+++ 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-tidy/readability/DeleteNullPointerCheck.cpp
===================================================================
--- clang-tidy/readability/DeleteNullPointerCheck.cpp
+++ 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-tidy/readability/BracesAroundStatementsCheck.cpp
===================================================================
--- clang-tidy/readability/BracesAroundStatementsCheck.cpp
+++ 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-tidy/readability/AvoidConstParamsInDecls.cpp
===================================================================
--- clang-tidy/readability/AvoidConstParamsInDecls.cpp
+++ 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-tidy/performance/MoveConstArgCheck.cpp
===================================================================
--- clang-tidy/performance/MoveConstArgCheck.cpp
+++ 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-tidy/performance/FasterStringFindCheck.cpp
===================================================================
--- clang-tidy/performance/FasterStringFindCheck.cpp
+++ clang-tidy/performance/FasterStringFindCheck.cpp
@@ -95,7 +95,7 @@
                                "effective overload accepting a character")
       << FindFunc << FixItHint::CreateReplacement(
                          CharSourceRange::getTokenRange(Literal->getBeginLoc(),
-                                                        Literal->getLocEnd()),
+                                                        Literal->getEndLoc()),
                          *Replacement);
 }
 
Index: clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
===================================================================
--- clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
+++ 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<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");
Index: clang-tidy/modernize/UseNullptrCheck.cpp
===================================================================
--- clang-tidy/modernize/UseNullptrCheck.cpp
+++ 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-tidy/modernize/UseEqualsDeleteCheck.cpp
===================================================================
--- clang-tidy/modernize/UseEqualsDeleteCheck.cpp
+++ clang-tidy/modernize/UseEqualsDeleteCheck.cpp
@@ -55,7 +55,7 @@
   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(),
Index: clang-tidy/modernize/UseEmplaceCheck.cpp
===================================================================
--- clang-tidy/modernize/UseEmplaceCheck.cpp
+++ 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-tidy/modernize/RedundantVoidArgCheck.cpp
===================================================================
--- clang-tidy/modernize/RedundantVoidArgCheck.cpp
+++ 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-tidy/modernize/PassByValueCheck.cpp
===================================================================
--- clang-tidy/modernize/PassByValueCheck.cpp
+++ 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-tidy/modernize/MakeSmartPtrCheck.cpp
===================================================================
--- clang-tidy/modernize/MakeSmartPtrCheck.cpp
+++ 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-tidy/modernize/AvoidBindCheck.cpp
===================================================================
--- clang-tidy/modernize/AvoidBindCheck.cpp
+++ 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<StringRef, 2> Matches;
Index: clang-tidy/misc/UnusedUsingDeclsCheck.cpp
===================================================================
--- clang-tidy/misc/UnusedUsingDeclsCheck.cpp
+++ 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-tidy/misc/UnusedParametersCheck.cpp
===================================================================
--- clang-tidy/misc/UnusedParametersCheck.cpp
+++ 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-tidy/misc/UnusedAliasDeclsCheck.cpp
===================================================================
--- clang-tidy/misc/UnusedAliasDeclsCheck.cpp
+++ 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-tidy/misc/StaticAssertCheck.cpp
===================================================================
--- clang-tidy/misc/StaticAssertCheck.cpp
+++ 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-tidy/misc/RedundantExpressionCheck.cpp
===================================================================
--- clang-tidy/misc/RedundantExpressionCheck.cpp
+++ clang-tidy/misc/RedundantExpressionCheck.cpp
@@ -885,15 +885,15 @@
       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());
 
       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-tidy/llvm/TwineLocalCheck.cpp
===================================================================
--- clang-tidy/llvm/TwineLocalCheck.cpp
+++ 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-tidy/google/ExplicitConstructorCheck.cpp
===================================================================
--- clang-tidy/google/ExplicitConstructorCheck.cpp
+++ 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-tidy/google/AvoidCStyleCastsCheck.cpp
===================================================================
--- clang-tidy/google/AvoidCStyleCastsCheck.cpp
+++ clang-tidy/google/AvoidCStyleCastsCheck.cpp
@@ -135,7 +135,7 @@
     if (!isa<ParenExpr>(SubExpr)) {
       CastText.push_back('(');
       Diag << FixItHint::CreateInsertion(
-          Lexer::getLocForEndOfToken(SubExpr->getLocEnd(), 0, SM,
+          Lexer::getLocForEndOfToken(SubExpr->getEndLoc(), 0, SM,
                                      getLangOpts()),
           ")");
     }
Index: clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
===================================================================
--- clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
+++ clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
@@ -34,7 +34,7 @@
           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(),
Index: clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp
===================================================================
--- clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp
+++ clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp
@@ -81,7 +81,7 @@
       if (!isa<ParenExpr>(SubExpr)) {
         CastText.push_back('(');
         diag_builder << FixItHint::CreateInsertion(
-            Lexer::getLocForEndOfToken(SubExpr->getLocEnd(), 0,
+            Lexer::getLocForEndOfToken(SubExpr->getEndLoc(), 0,
                                        *Result.SourceManager, getLangOpts()),
             ")");
       }
Index: clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
===================================================================
--- clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
+++ 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<FixItHint> Insertion = Inserter->CreateIncludeInsertion(
           Result.SourceManager->getMainFileID(), GslHeader,
Index: clang-tidy/cppcoreguidelines/NoMallocCheck.cpp
===================================================================
--- clang-tidy/cppcoreguidelines/NoMallocCheck.cpp
+++ 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-tidy/bugprone/UnusedRaiiCheck.cpp
===================================================================
--- clang-tidy/bugprone/UnusedRaiiCheck.cpp
+++ clang-tidy/bugprone/UnusedRaiiCheck.cpp
@@ -84,7 +84,7 @@
       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);
 }
Index: clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp
===================================================================
--- clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp
+++ 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-tidy/bugprone/StringIntegerAssignmentCheck.cpp
===================================================================
--- clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp
+++ 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-tidy/bugprone/MoveForwardingReferenceCheck.cpp
===================================================================
--- clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
+++ 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-tidy/bugprone/InaccurateEraseCheck.cpp
===================================================================
--- clang-tidy/bugprone/InaccurateEraseCheck.cpp
+++ 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-tidy/bugprone/CopyConstructorInitCheck.cpp
===================================================================
--- clang-tidy/bugprone/CopyConstructorInitCheck.cpp
+++ 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-tidy/bugprone/ArgumentCommentCheck.cpp
===================================================================
--- clang-tidy/bugprone/ArgumentCommentCheck.cpp
+++ clang-tidy/bugprone/ArgumentCommentCheck.cpp
@@ -243,15 +243,15 @@
 
     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()) {
       Comments = getCommentsInRange(Ctx, BeforeArgument);
     } 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<CXXConstructExpr>(E);
Index: clang-tidy/android/CloexecCheck.cpp
===================================================================
--- clang-tidy/android/CloexecCheck.cpp
+++ 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-move/ClangMove.cpp
===================================================================
--- clang-move/ClangMove.cpp
+++ 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<FileID, unsigned> 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: change-namespace/ChangeNamespace.cpp
===================================================================
--- change-namespace/ChangeNamespace.cpp
+++ 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;
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D50355: Port getLocE... Stephen Kelly via Phabricator via cfe-commits

Reply via email to