;
25 if(SuperD->getName() ==
"XCTestCase")
35 if(!
D->parameters().empty())
37 if(!
D->getReturnType()->isVoidType())
39 if(!
D->getSelector().getNameForSlot(0).starts_with(
"test"))
45 if(
D->
hasAttr<IBOutletAttr>()) {
47}
else if(
D->
hasAttr<IBOutletCollectionAttr>()) {
56 if(isa<ParmVarDecl>(
D))
59 if(isa<ObjCTypeParamDecl>(
D))
62 if(isa<UsingDirectiveDecl>(
D))
67 if(
const NamedDecl*ND = dyn_cast<NamedDecl>(
D)) {
68 switch(ND->getFormalLinkage()) {
69 caseLinkage::Invalid:
70llvm_unreachable(
"Linkage hasn't been computed!");
72 caseLinkage::Internal:
74 caseLinkage::VisibleNone:
75 caseLinkage::UniqueExternal:
76llvm_unreachable(
"Not a sema linkage");
78 caseLinkage::External:
89Info.
Kind= SymbolKind::Unknown;
90Info.
SubKind= SymbolSubKind::None;
92Info.
Lang= SymbolLanguage::C;
101 if(
auto*VT = dyn_cast<VarTemplateDecl>(
D)) {
103Info.
Lang= SymbolLanguage::CXX;
105 D= VT->getTemplatedDecl();
108 if(
const TagDecl*TD = dyn_cast<TagDecl>(
D)) {
109 switch(TD->getTagKind()) {
110 caseTagTypeKind::Struct:
111Info.
Kind= SymbolKind::Struct;
break;
112 caseTagTypeKind::Union:
113Info.
Kind= SymbolKind::Union;
break;
114 caseTagTypeKind::Class:
115Info.
Kind= SymbolKind::Class;
116Info.
Lang= SymbolLanguage::CXX;
118 caseTagTypeKind::Interface:
119Info.
Kind= SymbolKind::Protocol;
120Info.
Lang= SymbolLanguage::CXX;
122 caseTagTypeKind::Enum:
123Info.
Kind= SymbolKind::Enum;
break;
126 if(
const CXXRecordDecl*CXXRec = dyn_cast<CXXRecordDecl>(
D)) {
127 if(!CXXRec->isCLike()) {
128Info.
Lang= SymbolLanguage::CXX;
129 if(CXXRec->getDescribedClassTemplate()) {
135 if(isa<ClassTemplatePartialSpecializationDecl>(
D)) {
139}
else if(isa<ClassTemplateSpecializationDecl>(
D)) {
145}
else if(
auto*VD = dyn_cast<VarDecl>(
D)) {
146Info.
Kind= SymbolKind::Variable;
147 if(isa<ParmVarDecl>(
D)) {
148Info.
Kind= SymbolKind::Parameter;
150Info.
Kind= SymbolKind::StaticProperty;
151Info.
Lang= SymbolLanguage::CXX;
154 if(isa<VarTemplatePartialSpecializationDecl>(
D)) {
155Info.
Lang= SymbolLanguage::CXX;
159}
else if(isa<VarTemplateSpecializationDecl>(
D)) {
160Info.
Lang= SymbolLanguage::CXX;
164}
else if(VD->getDescribedVarTemplate()) {
165Info.
Lang= SymbolLanguage::CXX;
172Info.
Kind= SymbolKind::Module;
175Info.
Kind= SymbolKind::TypeAlias;
break;
177Info.
Kind= SymbolKind::Function;
180 caseDecl::IndirectField:
181Info.
Kind= SymbolKind::Field;
184 if(!CXXRec->isCLike())
185Info.
Lang= SymbolLanguage::CXX;
188 caseDecl::EnumConstant:
189Info.
Kind= SymbolKind::EnumConstant;
break;
190 caseDecl::ObjCInterface:
191 caseDecl::ObjCImplementation: {
192Info.
Kind= SymbolKind::Class;
193Info.
Lang= SymbolLanguage::ObjC;
196ClsD = cast<ObjCImplementationDecl>(
D)->getClassInterface();
201 caseDecl::ObjCProtocol:
202Info.
Kind= SymbolKind::Protocol;
203Info.
Lang= SymbolLanguage::ObjC;
205 caseDecl::ObjCCategory:
206 caseDecl::ObjCCategoryImpl: {
207Info.
Kind= SymbolKind::Extension;
208Info.
Lang= SymbolLanguage::ObjC;
210 if(
auto*CatD = dyn_cast<ObjCCategoryDecl>(
D))
211ClsD = CatD->getClassInterface();
213ClsD = cast<ObjCCategoryImplDecl>(
D)->getClassInterface();
218 caseDecl::ObjCMethod: {
223Info.
SubKind= SymbolSubKind::AccessorSetter;
225Info.
SubKind= SymbolSubKind::AccessorGetter;
227Info.
Lang= SymbolLanguage::ObjC;
234 caseDecl::ObjCProperty:
235Info.
Kind= SymbolKind::InstanceProperty;
236Info.
Lang= SymbolLanguage::ObjC;
238 if(
auto*Annot =
D->
getAttr<AnnotateAttr>()) {
239 if(Annot->getAnnotation() ==
"gk_inspectable")
244Info.
Kind= SymbolKind::Field;
245Info.
Lang= SymbolLanguage::ObjC;
248 caseDecl::Namespace:
249Info.
Kind= SymbolKind::Namespace;
250Info.
Lang= SymbolLanguage::CXX;
252 caseDecl::NamespaceAlias:
253Info.
Kind= SymbolKind::NamespaceAlias;
254Info.
Lang= SymbolLanguage::CXX;
256 caseDecl::CXXConstructor: {
257Info.
Kind= SymbolKind::Constructor;
258Info.
Lang= SymbolLanguage::CXX;
259 auto*CD = cast<CXXConstructorDecl>(
D);
260 if(CD->isCopyConstructor())
261Info.
SubKind= SymbolSubKind::CXXCopyConstructor;
262 else if(CD->isMoveConstructor())
263Info.
SubKind= SymbolSubKind::CXXMoveConstructor;
266 caseDecl::CXXDestructor:
267Info.
Kind= SymbolKind::Destructor;
268Info.
Lang= SymbolLanguage::CXX;
270 caseDecl::CXXConversion:
271Info.
Kind= SymbolKind::ConversionFunction;
272Info.
Lang= SymbolLanguage::CXX;
274 caseDecl::CXXMethod: {
277Info.
Kind= SymbolKind::StaticMethod;
279Info.
Kind= SymbolKind::InstanceMethod;
280Info.
Lang= SymbolLanguage::CXX;
283 caseDecl::ClassTemplate:
284Info.
Kind= SymbolKind::Class;
286Info.
Lang= SymbolLanguage::CXX;
288 caseDecl::FunctionTemplate:
289Info.
Kind= SymbolKind::Function;
291Info.
Lang= SymbolLanguage::CXX;
292 if(
const CXXMethodDecl*MD = dyn_cast_or_null<CXXMethodDecl>(
293cast<FunctionTemplateDecl>(
D)->getTemplatedDecl())) {
294 if(isa<CXXConstructorDecl>(MD))
295Info.
Kind= SymbolKind::Constructor;
296 else if(isa<CXXDestructorDecl>(MD))
297Info.
Kind= SymbolKind::Destructor;
298 else if(isa<CXXConversionDecl>(MD))
299Info.
Kind= SymbolKind::ConversionFunction;
302Info.
Kind= SymbolKind::StaticMethod;
304Info.
Kind= SymbolKind::InstanceMethod;
308 caseDecl::TypeAliasTemplate:
309Info.
Kind= SymbolKind::TypeAlias;
310Info.
Lang= SymbolLanguage::CXX;
313 caseDecl::TypeAlias:
314Info.
Kind= SymbolKind::TypeAlias;
315Info.
Lang= SymbolLanguage::CXX;
317 caseDecl::UnresolvedUsingTypename:
318Info.
Kind= SymbolKind::Using;
319Info.
SubKind= SymbolSubKind::UsingTypename;
320Info.
Lang= SymbolLanguage::CXX;
323 caseDecl::UnresolvedUsingValue:
324Info.
Kind= SymbolKind::Using;
325Info.
SubKind= SymbolSubKind::UsingValue;
326Info.
Lang= SymbolLanguage::CXX;
330Info.
Kind= SymbolKind::Using;
331Info.
Lang= SymbolLanguage::CXX;
333 caseDecl::UsingEnum:
334Info.
Kind= SymbolKind::Using;
335Info.
Lang= SymbolLanguage::CXX;
336Info.
SubKind= SymbolSubKind::UsingEnum;
339Info.
Kind= SymbolKind::Variable;
340Info.
Lang= SymbolLanguage::CXX;
342 caseDecl::MSProperty:
343Info.
Kind= SymbolKind::InstanceProperty;
346 if(!CXXRec->isCLike())
347Info.
Lang= SymbolLanguage::CXX;
350 caseDecl::ClassTemplatePartialSpecialization:
351 caseDecl::ClassTemplateSpecialization:
352 caseDecl::CXXRecord:
355llvm_unreachable(
"records handled before");
357 caseDecl::VarTemplateSpecialization:
358 caseDecl::VarTemplatePartialSpecialization:
359 caseDecl::ImplicitParam:
362 caseDecl::VarTemplate:
363llvm_unreachable(
"variables handled before");
365 caseDecl::TemplateTypeParm:
366Info.
Kind= SymbolKind::TemplateTypeParm;
368 caseDecl::TemplateTemplateParm:
369Info.
Kind= SymbolKind::TemplateTemplateParm;
371 caseDecl::NonTypeTemplateParm:
372Info.
Kind= SymbolKind::NonTypeTemplateParm;
375Info.
Kind= SymbolKind::Concept;
383 if(Info.Kind == SymbolKind::Unknown)
387 if(FD->getTemplatedKind() ==
396Info.Lang = SymbolLanguage::CXX;
399 if(
attr->getLanguage() ==
"Swift")
400Info.Lang = SymbolLanguage::Swift;
408Info.
Kind= SymbolKind::Macro;
409Info.
SubKind= SymbolSubKind::None;
411Info.
Lang= SymbolLanguage::C;
416llvm::function_ref<
bool(
SymbolRole)> Fn) {
417#define APPLY_FOR_ROLE(Role) \ 418 if (Roles & (unsigned)SymbolRole::Role) \ 419 if (!Fn(SymbolRole::Role)) \ 450llvm::function_ref<
void(
SymbolRole)> Fn) {
458 boolVisitedOnce =
false;
465 caseSymbolRole::Declaration: OS <<
"Decl";
break;
466 caseSymbolRole::Definition: OS <<
"Def";
break;
467 caseSymbolRole::Reference: OS <<
"Ref";
break;
468 caseSymbolRole::Read: OS <<
"Read";
break;
469 caseSymbolRole::Write: OS <<
"Writ";
break;
470 caseSymbolRole::Call: OS <<
"Call";
break;
471 caseSymbolRole::Dynamic: OS <<
"Dyn";
break;
472 caseSymbolRole::AddressOf: OS <<
"Addr";
break;
473 caseSymbolRole::Implicit: OS <<
"Impl";
break;
474 caseSymbolRole::Undefinition: OS <<
"Undef";
break;
475 caseSymbolRole::RelationChildOf: OS <<
"RelChild";
break;
476 caseSymbolRole::RelationBaseOf: OS <<
"RelBase";
break;
477 caseSymbolRole::RelationOverrideOf: OS <<
"RelOver";
break;
478 caseSymbolRole::RelationReceivedBy: OS <<
"RelRec";
break;
479 caseSymbolRole::RelationCalledBy: OS <<
"RelCall";
break;
480 caseSymbolRole::RelationExtendedBy: OS <<
"RelExt";
break;
481 caseSymbolRole::RelationAccessorOf: OS <<
"RelAcc";
break;
482 caseSymbolRole::RelationContainedBy: OS <<
"RelCont";
break;
483 caseSymbolRole::RelationIBTypeOf: OS <<
"RelIBType";
break;
484 caseSymbolRole::RelationSpecializationOf: OS <<
"RelSpecialization";
break;
485 caseSymbolRole::NameReference: OS <<
"NameReference";
break;
492 if(
auto*ND = dyn_cast<NamedDecl>(
D)) {
501DeclName.
print(OS, Policy);
510 caseSymbolKind::Unknown:
return "<unknown>";
511 caseSymbolKind::Module:
return "module";
512 caseSymbolKind::Namespace:
return "namespace";
513 caseSymbolKind::NamespaceAlias:
return "namespace-alias";
514 caseSymbolKind::Macro:
return "macro";
515 caseSymbolKind::Enum:
return "enum";
516 caseSymbolKind::Struct:
return "struct";
517 caseSymbolKind::Class:
return "class";
518 caseSymbolKind::Protocol:
return "protocol";
519 caseSymbolKind::Extension:
return "extension";
520 caseSymbolKind::Union:
return "union";
521 caseSymbolKind::TypeAlias:
return "type-alias";
522 caseSymbolKind::Function:
return "function";
523 caseSymbolKind::Variable:
return "variable";
524 caseSymbolKind::Field:
return "field";
525 caseSymbolKind::EnumConstant:
return "enumerator";
526 caseSymbolKind::InstanceMethod:
return "instance-method";
527 caseSymbolKind::ClassMethod:
return "class-method";
528 caseSymbolKind::StaticMethod:
return "static-method";
529 caseSymbolKind::InstanceProperty:
return "instance-property";
530 caseSymbolKind::ClassProperty:
return "class-property";
531 caseSymbolKind::StaticProperty:
return "static-property";
532 caseSymbolKind::Constructor:
return "constructor";
533 caseSymbolKind::Destructor:
return "destructor";
534 caseSymbolKind::ConversionFunction:
return "conversion-func";
535 caseSymbolKind::Parameter:
return "param";
536 caseSymbolKind::Using:
return "using";
537 caseSymbolKind::TemplateTypeParm:
return "template-type-param";
538 caseSymbolKind::TemplateTemplateParm:
return "template-template-param";
539 caseSymbolKind::NonTypeTemplateParm:
return "non-type-template-param";
540 caseSymbolKind::Concept:
543llvm_unreachable(
"invalid symbol kind");
548 caseSymbolSubKind::None:
return "<none>";
549 caseSymbolSubKind::CXXCopyConstructor:
return "cxx-copy-ctor";
550 caseSymbolSubKind::CXXMoveConstructor:
return "cxx-move-ctor";
551 caseSymbolSubKind::AccessorGetter:
return "acc-get";
552 caseSymbolSubKind::AccessorSetter:
return "acc-set";
553 caseSymbolSubKind::UsingTypename:
return "using-typename";
554 caseSymbolSubKind::UsingValue:
return "using-value";
555 caseSymbolSubKind::UsingEnum:
return "using-enum";
557llvm_unreachable(
"invalid symbol subkind");
562 caseSymbolLanguage::C:
return "C";
563 caseSymbolLanguage::ObjC:
return "ObjC";
564 caseSymbolLanguage::CXX:
return "C++";
565 caseSymbolLanguage::Swift:
return "Swift";
567llvm_unreachable(
"invalid symbol language kind");
572#define APPLY_FOR_PROPERTY(K) \ 573 if (Props & (SymbolPropertySet)SymbolProperty::K) \ 574 Fn(SymbolProperty::K) 586#undef APPLY_FOR_PROPERTY 590 boolVisitedOnce =
false;
597 caseSymbolProperty::Generic: OS <<
"Gen";
break;
598 caseSymbolProperty::TemplatePartialSpecialization: OS <<
"TPS";
break;
599 caseSymbolProperty::TemplateSpecialization: OS <<
"TS";
break;
600 caseSymbolProperty::UnitTest: OS <<
"test";
break;
601 caseSymbolProperty::IBAnnotated: OS <<
"IB";
break;
602 caseSymbolProperty::IBOutletCollection: OS <<
"IBColl";
break;
603 caseSymbolProperty::GKInspectable: OS <<
"GKI";
break;
604 caseSymbolProperty::Local: OS <<
"local";
break;
605 caseSymbolProperty::ProtocolInterface: OS <<
"protocol";
break;
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
#define APPLY_FOR_PROPERTY(K)
static bool isUnitTest(const ObjCMethodDecl *D)
#define APPLY_FOR_ROLE(Role)
static void checkForIBOutlets(const Decl *D, SymbolPropertySet &PropSet)
static bool isUnitTestCase(const ObjCInterfaceDecl *D)
Defines the clang::MacroInfo and clang::MacroDirective classes.
Represents a static or instance method of a struct/union/class.
Represents a C++ struct/union/class.
Decl - This represents one declaration (or definition), e.g.
const DeclContext * getParentFunctionOrMethod(bool LexicalParent=false) const
If this decl is defined inside a function/method/block it returns the corresponding DeclContext,...
ExternalSourceSymbolAttr * getExternalSourceSymbolAttr() const
Looks on this and related declarations for an applicable external source symbol attribute.
DeclContext * getDeclContext()
The name of a declaration.
void print(raw_ostream &OS, const PrintingPolicy &Policy) const
bool isEmpty() const
Evaluates true when this declaration name is empty.
Represents a function declaration or definition.
@ TK_FunctionTemplateSpecialization
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Encapsulates the data about a macro definition (e.g.
This represents a decl that may have a name.
Represents an ObjC class declaration.
ObjCMethodDecl - Represents an instance or class method declaration.
unsigned param_size() const
bool isPropertyAccessor() const
bool isInstanceMethod() const
Represents the declaration of a struct/union/class/enum.
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
void applyForEachSymbolProperty(SymbolPropertySet Props, llvm::function_ref< void(SymbolProperty)> Fn)
SymbolRole
Set of roles that are attributed to symbol occurrences.
@ RelationSpecializationOf
StringRef getSymbolSubKindString(SymbolSubKind K)
void printSymbolProperties(SymbolPropertySet Props, raw_ostream &OS)
SymbolInfo getSymbolInfo(const Decl *D)
StringRef getSymbolKindString(SymbolKind K)
bool isFunctionLocalSymbol(const Decl *D)
void applyForEachSymbolRole(SymbolRoleSet Roles, llvm::function_ref< void(SymbolRole)> Fn)
void printSymbolRoles(SymbolRoleSet Roles, raw_ostream &OS)
SymbolInfo getSymbolInfoForMacro(const MacroInfo &MI)
bool printSymbolName(const Decl *D, const LangOptions &LO, raw_ostream &OS)
bool applyForEachSymbolRoleInterruptible(SymbolRoleSet Roles, llvm::function_ref< bool(SymbolRole)> Fn)
SymbolProperty
Set of properties that provide additional info about a symbol.
@ TemplatePartialSpecialization
@ ProtocolInterface
Symbol is part of a protocol interface.
uint16_t SymbolPropertySet
StringRef getSymbolLanguageString(SymbolLanguage K)
SymbolSubKind
Language specific sub-kinds.
The JSON file list parser is used to communicate input to InstallAPI.
if(T->getSizeExpr()) TRY_TO(TraverseStmt(const_cast< Expr * >(T -> getSizeExpr())))
@ Generic
not a target-specific vector type
Describes how types, statements, expressions, and declarations should be printed.
unsigned SuppressTemplateArgsInCXXConstructors
When true, suppresses printing template arguments in names of C++ constructors.
SymbolPropertySet Properties
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4