16 #ifndef LLVM_CLANG_TOOLING_REFACTOR_RECURSIVE_SYMBOL_VISITOR_H
17 #define LLVM_CLANG_TOOLING_REFACTOR_RECURSIVE_SYMBOL_VISITOR_H
35 : SM(SM), LangOpts(LangOpts) {}
45 return isa<CXXConversionDecl>(D) ?
true : visit(D, D->
getLocation());
49 for (
const auto *Initializer : CD->
inits()) {
51 if (!Initializer->isWritten())
53 if (
const FieldDecl *FD = Initializer->getMember()) {
54 if (!visit(FD, Initializer->getSourceLocation(),
79 if (
const auto *TemplateTypeParm =
80 dyn_cast<TemplateTypeParmType>(Loc.
getType())) {
81 if (!visit(TemplateTypeParm->getDecl(), TypeBeginLoc, TypeEndLoc))
84 if (
const auto *TemplateSpecType =
85 dyn_cast<TemplateSpecializationType>(Loc.
getType())) {
86 if (!visit(TemplateSpecType->getTemplateName().getAsTemplateDecl(),
87 TypeBeginLoc, TypeEndLoc))
114 return visit(ND, Loc,
122 #endif // LLVM_CLANG_TOOLING_REFACTOR_RECURSIVE_SYMBOL_VISITOR_H
SourceLocation getLocalEndLoc() const
Retrieve the location of the end of this component of the nested-name-specifier.
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
NamespaceDecl - Represent a C++ namespace.
Represents a C++ constructor within a class.
SourceLocation getLocation() const
Base wrapper for a particular "section" of type source info.
A C++ nested-name-specifier augmented with source location information.
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
SourceLocation getBeginLoc() const
Get the begin source location.
SourceLocation getLocWithOffset(int Offset) const
Return a source location with the specified offset from this SourceLocation.
std::string getNameAsString() const
getNameAsString - Get a human-readable name for the declaration, even if it is one of the special kin...
A class that does preordor or postorder depth-first traversal on the entire Clang AST and visits each...
NamedDecl * getDecl() const
Expr - This represents one expression.
static SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset, const SourceManager &SM, const LangOptions &LangOpts)
Computes the source location just past the end of the token at this source location.
QualType getType() const
Get the type for which this source info wrapper provides information.
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
Encodes a location in the source.
bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Recursively visit a C++ nested-name-specifier with location information.
SourceLocation getLocalBeginLoc() const
Retrieve the location of the beginning of this component of the nested-name-specifier.
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'...
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
A reference to a declared variable, function, enum, etc.
A trivial tuple used to represent a source range.
SourceLocation getLocation() const
NamedDecl - This represents a decl with a name.
This class handles loading and caching of source files into memory.
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.