diff options
Diffstat (limited to 'lib/Tooling/Refactoring')
-rw-r--r-- | lib/Tooling/Refactoring/Extract/Extract.cpp | 2 | ||||
-rw-r--r-- | lib/Tooling/Refactoring/Rename/USRFinder.cpp | 2 | ||||
-rw-r--r-- | lib/Tooling/Refactoring/Rename/USRLocFinder.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/Tooling/Refactoring/Extract/Extract.cpp b/lib/Tooling/Refactoring/Extract/Extract.cpp index 9a5a12d5ee..7a741bdb2e 100644 --- a/lib/Tooling/Refactoring/Extract/Extract.cpp +++ b/lib/Tooling/Refactoring/Extract/Extract.cpp @@ -103,7 +103,7 @@ ExtractFunction::createSourceReplacements(RefactoringRuleContext &Context) { // Compute the source range of the code that should be extracted. SourceRange ExtractedRange(Code[0]->getBeginLoc(), - Code[Code.size() - 1]->getLocEnd()); + Code[Code.size() - 1]->getEndLoc()); // FIXME (Alex L): Add code that accounts for macro locations. ASTContext &AST = Context.getASTContext(); diff --git a/lib/Tooling/Refactoring/Rename/USRFinder.cpp b/lib/Tooling/Refactoring/Rename/USRFinder.cpp index 128fc42c08..4ed805fd50 100644 --- a/lib/Tooling/Refactoring/Rename/USRFinder.cpp +++ b/lib/Tooling/Refactoring/Rename/USRFinder.cpp @@ -84,7 +84,7 @@ const NamedDecl *getNamedDeclAt(const ASTContext &Context, // looking for the point cannot be inside of this decl. Don't even look at it. for (auto *CurrDecl : Context.getTranslationUnitDecl()->decls()) { SourceLocation StartLoc = CurrDecl->getBeginLoc(); - SourceLocation EndLoc = CurrDecl->getLocEnd(); + SourceLocation EndLoc = CurrDecl->getEndLoc(); if (StartLoc.isValid() && EndLoc.isValid() && SM.isBeforeInTranslationUnit(StartLoc, Point) != SM.isBeforeInTranslationUnit(EndLoc, Point)) diff --git a/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp b/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp index 8addfea4a5..7f60cf54c8 100644 --- a/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp +++ b/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp @@ -260,7 +260,7 @@ public: // restrict the end of location to just before the `<` character. SourceLocation EndLoc = Expr->hasExplicitTemplateArgs() ? Expr->getLAngleLoc().getLocWithOffset(-1) - : Expr->getLocEnd(); + : Expr->getEndLoc(); if (const auto *MD = llvm::dyn_cast<CXXMethodDecl>(Decl)) { if (isInUSRSet(MD)) { @@ -576,7 +576,7 @@ createRenameAtomicChanges(llvm::ArrayRef<std::string> USRs, // Hanlde using declarations explicitly as "using a::Foo" don't trigger // typeLoc for "a::Foo". for (const auto *Using : Finder.getUsingDecls()) - Replace(Using->getBeginLoc(), Using->getLocEnd(), "using " + NewName.str()); + Replace(Using->getBeginLoc(), Using->getEndLoc(), "using " + NewName.str()); return AtomicChanges; } |