summaryrefslogtreecommitdiffstats
path: root/lib/Tooling/Refactoring
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2018-08-09 21:09:38 +0000
committerStephen Kelly <steveire@gmail.com>2018-08-09 21:09:38 +0000
commit2dfd8132cf7984a86fd4cfc9d84f2195d60205ef (patch)
tree6af8bbd1c911945732be0a9272736594124e5b96 /lib/Tooling/Refactoring
parentd7b659b592e6aaa6659904d346a0cacfa18d1661 (diff)
Port getLocEnd -> getEndLoc
Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50351 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Tooling/Refactoring')
-rw-r--r--lib/Tooling/Refactoring/Extract/Extract.cpp2
-rw-r--r--lib/Tooling/Refactoring/Rename/USRFinder.cpp2
-rw-r--r--lib/Tooling/Refactoring/Rename/USRLocFinder.cpp4
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;
}