16 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDER_H
17 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDER_H
19 #include "clang/AST/AST.h"
20 #include "clang/AST/ASTContext.h"
21 #include "clang/ASTMatchers/ASTMatchFinder.h"
26 using namespace clang::ast_matchers;
40 const SourceLocation
Point);
46 const std::string &
Name);
65 const auto NestedNameSpecifierLocMatcher =
66 nestedNameSpecifierLoc().bind(
"nestedNameSpecifierLoc");
67 Finder.addMatcher(NestedNameSpecifierLocMatcher,
this);
70 void run(
const MatchFinder::MatchResult &
Result)
override {
71 const auto *NNS = Result.Nodes.getNodeAs<NestedNameSpecifierLoc>(
72 "nestedNameSpecifierLoc");
73 Locations.push_back(*NNS);
77 std::vector<NestedNameSpecifierLoc> Locations;
84 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDER_H
const SourceLocation Point
std::unique_ptr< ast_matchers::MatchFinder > Finder
const NamedDecl * getNamedDeclAt(const ASTContext &Context, const SourceLocation Point)
std::string getUSRForDecl(const Decl *Decl)
NestedNameSpecifierLocFinder(ASTContext &Context)
const NamedDecl * getNamedDeclFor(const ASTContext &Context, const std::string &Name)
std::vector< NestedNameSpecifierLoc > getNestedNameSpecifierLocations()
ClangTidyContext & Context