17 using namespace clang;
25 if (SuperD->getName() ==
"XCTestCase")
45 if (D->
hasAttr<IBOutletAttr>()) {
47 }
else if (D->
hasAttr<IBOutletCollectionAttr>()) {
56 if (isa<ParmVarDecl>(D))
59 if (isa<TemplateTemplateParmDecl>(D))
62 if (isa<ObjCTypeParamDecl>(D))
65 if (isa<UsingDirectiveDecl>(D))
70 if (
const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
71 switch (ND->getFormalLinkage()) {
78 llvm_unreachable(
"Not a sema linkage");
100 if (
const TagDecl *TD = dyn_cast<TagDecl>(D)) {
101 switch (TD->getTagKind()) {
118 if (
const CXXRecordDecl *CXXRec = dyn_cast<CXXRecordDecl>(D)) {
119 if (!CXXRec->isCLike()) {
121 if (CXXRec->getDescribedClassTemplate()) {
127 if (isa<ClassTemplatePartialSpecializationDecl>(D)) {
131 }
else if (isa<ClassTemplateSpecializationDecl>(D)) {
137 }
else if (
auto *VD = dyn_cast<VarDecl>(D)) {
139 if (isa<ParmVarDecl>(D)) {
146 if (isa<VarTemplatePartialSpecializationDecl>(D)) {
151 }
else if (isa<VarTemplateSpecializationDecl>(D)) {
156 }
else if (VD->getDescribedVarTemplate()) {
175 if (!CXXRec->isCLike())
181 case Decl::ObjCInterface:
182 case Decl::ObjCImplementation: {
187 ClsD = cast<ObjCImplementationDecl>(D)->getClassInterface();
192 case Decl::ObjCProtocol:
196 case Decl::ObjCCategory:
197 case Decl::ObjCCategoryImpl: {
201 if (
auto *CatD = dyn_cast<ObjCCategoryDecl>(D))
202 ClsD = CatD->getClassInterface();
204 ClsD = cast<ObjCCategoryImplDecl>(D)->getClassInterface();
209 case Decl::ObjCMethod: {
221 if (D->
hasAttr<IBActionAttr>())
225 case Decl::ObjCProperty:
229 if (
auto *Annot = D->
getAttr<AnnotateAttr>()) {
230 if (Annot->getAnnotation() ==
"gk_inspectable")
247 case Decl::CXXConstructor: {
250 auto *CD = cast<CXXConstructorDecl>(D);
251 if (CD->isCopyConstructor())
253 else if (CD->isMoveConstructor())
257 case Decl::CXXDestructor:
261 case Decl::CXXConversion:
265 case Decl::CXXMethod: {
274 case Decl::ClassTemplate:
279 case Decl::FunctionTemplate:
283 if (
const CXXMethodDecl *MD = dyn_cast_or_null<CXXMethodDecl>(
284 cast<FunctionTemplateDecl>(D)->getTemplatedDecl())) {
285 if (isa<CXXConstructorDecl>(MD))
287 else if (isa<CXXDestructorDecl>(MD))
289 else if (isa<CXXConversionDecl>(MD))
299 case Decl::TypeAliasTemplate:
308 case Decl::UnresolvedUsingTypename:
314 case Decl::UnresolvedUsingValue:
332 if (
const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
333 if (FD->getTemplatedKind() ==
344 if (
auto *attr = D->getExternalSourceSymbolAttr()) {
345 if (attr->getLanguage() ==
"Swift")
363 #define APPLY_FOR_ROLE(Role) \ 364 if (Roles & (unsigned)SymbolRole::Role) \ 365 if (!Fn(SymbolRole::Role)) \ 389 #undef APPLY_FOR_ROLE 403 bool VisitedOnce =
false;
436 if (
auto *ND = dyn_cast<NamedDecl>(D)) {
445 DeclName.
print(OS, Policy);
482 llvm_unreachable(
"invalid symbol kind");
495 llvm_unreachable(
"invalid symbol subkind");
505 llvm_unreachable(
"invalid symbol language kind");
510 #define APPLY_FOR_PROPERTY(K) \ 511 if (Props & (SymbolPropertySet)SymbolProperty::K) \ 512 Fn(SymbolProperty::K) 523 #undef APPLY_FOR_PROPERTY 527 bool VisitedOnce =
false;
Represents a function declaration or definition.
External linkage, which indicates that the entity can be referred to from other translation units...
if(T->getSizeExpr()) TRY_TO(TraverseStmt(T -> getSizeExpr()))
StringRef getSymbolLanguageString(SymbolLanguage K)
unsigned param_size() const
ObjCInterfaceDecl * getClassInterface()
Internal linkage according to the Modules TS, but can be referred to from other translation units ind...
bool printSymbolName(const Decl *D, const LangOptions &LO, raw_ostream &OS)
No linkage, which means that the entity is unique and can only be referred to from within its scope...
Decl - This represents one declaration (or definition), e.g.
Defines the C++ template declaration subclasses.
Defines the clang::MacroInfo and clang::MacroDirective classes.
bool isEmpty() const
Evaluates true when this declaration name is empty.
const DeclContext * getParentFunctionOrMethod() const
If this decl is defined inside a function/method/block it returns the corresponding DeclContext...
The "__interface" keyword.
ObjCMethodDecl - Represents an instance or class method declaration.
Describes how types, statements, expressions, and declarations should be printed. ...
static bool isUnitTestCase(const ObjCInterfaceDecl *D)
bool applyForEachSymbolRoleInterruptible(SymbolRoleSet Roles, llvm::function_ref< bool(SymbolRole)> Fn)
SymbolSubKind
Language specific sub-kinds.
#define APPLY_FOR_PROPERTY(K)
void applyForEachSymbolProperty(SymbolPropertySet Props, llvm::function_ref< void(SymbolProperty)> Fn)
SymbolRole
Set of roles that are attributed to symbol occurrences.
bool isFunctionLocalSymbol(const Decl *D)
StringRef getSymbolKindString(SymbolKind K)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
StringRef getSymbolSubKindString(SymbolSubKind K)
Represents an ObjC class declaration.
static bool isUnitTest(const ObjCMethodDecl *D)
QualType getReturnType() const
unsigned SuppressTemplateArgsInCXXConstructors
When true, suppresses printing template arguments in names of C++ constructors.
Module linkage, which indicates that the entity can be referred to from other translation units withi...
void printSymbolProperties(SymbolPropertySet Props, raw_ostream &OS)
uint8_t SymbolPropertySet
#define APPLY_FOR_ROLE(Role)
StringRef getNameForSlot(unsigned argIndex) const
Retrieve the name at a given position in the selector.
DeclContext * getDeclContext()
ObjCInterfaceDecl * getSuperClass() const
bool isInstanceMethod() const
Selector getSelector() const
static void checkForIBOutlets(const Decl *D, SymbolPropertySet &PropSet)
Represents the declaration of a struct/union/class/enum.
Represents a static or instance method of a struct/union/class.
void applyForEachSymbolRole(SymbolRoleSet Roles, llvm::function_ref< void(SymbolRole)> Fn)
Dataflow Directional Tag Classes.
External linkage within a unique namespace.
DeclarationName - The name of a declaration.
Encapsulates the data about a macro definition (e.g.
SymbolProperty
Set of properties that provide additional info about a symbol.
void printSymbolRoles(SymbolRoleSet Roles, raw_ostream &OS)
Internal linkage, which indicates that the entity can be referred to from within the translation unit...
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
SymbolInfo getSymbolInfo(const Decl *D)
Represents a C++ struct/union/class.
No linkage according to the standard, but is visible from other translation units because of types de...
void print(raw_ostream &OS, const PrintingPolicy &Policy)
SymbolInfo getSymbolInfoForMacro(const MacroInfo &MI)
This represents a decl that may have a name.
bool isPropertyAccessor() const
SymbolPropertySet Properties
ArrayRef< ParmVarDecl * > parameters() const