diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
| commit | 676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 (patch) | |
| tree | 02a1ac369cb734d0abfa5000dd86e5b7797e6a74 /lib/Tooling/Refactoring | |
| parent | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff) | |
Notes
Diffstat (limited to 'lib/Tooling/Refactoring')
| -rw-r--r-- | lib/Tooling/Refactoring/ASTSelection.cpp | 2 | ||||
| -rw-r--r-- | lib/Tooling/Refactoring/Extract/Extract.cpp | 6 | ||||
| -rw-r--r-- | lib/Tooling/Refactoring/Rename/USRFinder.cpp | 4 | ||||
| -rw-r--r-- | lib/Tooling/Refactoring/Rename/USRLocFinder.cpp | 8 |
4 files changed, 9 insertions, 11 deletions
diff --git a/lib/Tooling/Refactoring/ASTSelection.cpp b/lib/Tooling/Refactoring/ASTSelection.cpp index 7123fc32cec9..b8f996d8218c 100644 --- a/lib/Tooling/Refactoring/ASTSelection.cpp +++ b/lib/Tooling/Refactoring/ASTSelection.cpp @@ -250,8 +250,6 @@ static bool hasAnyDirectChildrenWithKind(const SelectedASTNode &Node, namespace { struct SelectedNodeWithParents { - SelectedNodeWithParents(SelectedNodeWithParents &&) = default; - SelectedNodeWithParents &operator=(SelectedNodeWithParents &&) = default; SelectedASTNode::ReferenceType Node; llvm::SmallVector<SelectedASTNode::ReferenceType, 8> Parents; diff --git a/lib/Tooling/Refactoring/Extract/Extract.cpp b/lib/Tooling/Refactoring/Extract/Extract.cpp index a12454cd29ef..7a741bdb2e91 100644 --- a/lib/Tooling/Refactoring/Extract/Extract.cpp +++ b/lib/Tooling/Refactoring/Extract/Extract.cpp @@ -52,7 +52,7 @@ SourceLocation computeFunctionExtractionLocation(const Decl *D) { while (const auto *RD = dyn_cast<CXXRecordDecl>(D->getLexicalDeclContext())) D = RD; } - return D->getLocStart(); + return D->getBeginLoc(); } } // end anonymous namespace @@ -102,8 +102,8 @@ ExtractFunction::createSourceReplacements(RefactoringRuleContext &Context) { assert(ParentDecl && "missing parent"); // Compute the source range of the code that should be extracted. - SourceRange ExtractedRange(Code[0]->getLocStart(), - Code[Code.size() - 1]->getLocEnd()); + SourceRange ExtractedRange(Code[0]->getBeginLoc(), + 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 63f536c72a6f..4ed805fd504c 100644 --- a/lib/Tooling/Refactoring/Rename/USRFinder.cpp +++ b/lib/Tooling/Refactoring/Rename/USRFinder.cpp @@ -83,8 +83,8 @@ const NamedDecl *getNamedDeclAt(const ASTContext &Context, // see. If both start and end is either before or after the point we're // 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->getLocStart(); - SourceLocation EndLoc = CurrDecl->getLocEnd(); + SourceLocation StartLoc = CurrDecl->getBeginLoc(); + 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 fb06b91118b0..7f60cf54c8ec 100644 --- a/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp +++ b/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp @@ -117,7 +117,7 @@ SourceLocation StartLocationForType(TypeLoc TL) { return NestedNameSpecifier.getBeginLoc(); TL = TL.getNextTypeLoc(); } - return TL.getLocStart(); + return TL.getBeginLoc(); } SourceLocation EndLocationForType(TypeLoc TL) { @@ -255,12 +255,12 @@ public: Decl = UsingShadow->getTargetDecl(); } - auto StartLoc = Expr->getLocStart(); + auto StartLoc = Expr->getBeginLoc(); // For template function call expressions like `foo<int>()`, we want to // 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->getLocStart(), Using->getLocEnd(), "using " + NewName.str()); + Replace(Using->getBeginLoc(), Using->getEndLoc(), "using " + NewName.str()); return AtomicChanges; } |
