;
22 if(
auto*
attr=
D->
getAttr<ExternalSourceSymbolAttr>()) {
23 return attr->getGeneratedDeclaration();
65 const Decl*OrigD =
D;
66 if(isa<ObjCPropertyImplDecl>(
D)) {
67 D= cast<ObjCPropertyImplDecl>(
D)->getPropertyDecl();
69 returnhandleDeclOccurrence(
D,
Loc,
false, cast<Decl>(DC),
84(isa<NonTypeTemplateParmDecl>(
D) || isa<TemplateTypeParmDecl>(
D) ||
85isa<TemplateTemplateParmDecl>(
D))) {
88 returnhandleDeclOccurrence(
D,
Loc,
true,
Parent, Roles, Relations,
151SD = dyn_cast<ClassTemplateSpecializationDecl>(
D)) {
152TKind = SD->getSpecializationKind();
153}
else if(
const FunctionDecl*FD = dyn_cast<FunctionDecl>(
D)) {
154TKind = FD->getTemplateSpecializationKind();
155}
else if(
auto*VD = dyn_cast<VarDecl>(
D)) {
156TKind = VD->getTemplateSpecializationKind();
157}
else if(
const auto*RD = dyn_cast<CXXRecordDecl>(
D)) {
158 if(RD->getInstantiatedFromMemberClass())
159TKind = RD->getTemplateSpecializationKind();
160}
else if(
const auto*ED = dyn_cast<EnumDecl>(
D)) {
161 if(ED->getInstantiatedFromMemberEnum())
162TKind = ED->getTemplateSpecializationKind();
163}
else if(isa<FieldDecl>(
D) || isa<TypedefNameDecl>(
D) ||
164isa<EnumConstantDecl>(
D)) {
173 returnisa<ClassTemplateSpecializationDecl>(
D);
181llvm_unreachable(
"invalid TemplateSpecializationKind");
184boolIndexingContext::shouldIgnoreIfImplicit(
const Decl*
D) {
185 if(isa<ObjCInterfaceDecl>(
D))
187 if(isa<ObjCCategoryDecl>(
D))
189 if(isa<ObjCIvarDecl>(
D))
191 if(isa<ObjCMethodDecl>(
D))
193 if(isa<ImportDecl>(
D))
200 if(
const auto*CTSD =
203 else if(
const auto*RD = dyn_cast<CXXRecordDecl>(
D->
getDeclContext()))
210SD = dyn_cast<ClassTemplateSpecializationDecl>(
D)) {
211 const auto*Template = SD->getTemplateInstantiationPattern();
216 returnSD->getSpecializedTemplate()->getTemplatedDecl();
217}
else if(
const FunctionDecl*FD = dyn_cast<FunctionDecl>(
D)) {
218 returnFD->getTemplateInstantiationPattern();
219}
else if(
auto*VD = dyn_cast<VarDecl>(
D)) {
220 returnVD->getTemplateInstantiationPattern();
221}
else if(
const auto*RD = dyn_cast<CXXRecordDecl>(
D)) {
222 returnRD->getInstantiatedFromMemberClass();
223}
else if(
const auto*ED = dyn_cast<EnumDecl>(
D)) {
224 returnED->getInstantiatedFromMemberEnum();
225}
else if(isa<FieldDecl>(
D) || isa<TypedefNameDecl>(
D)) {
226 const auto*ND = cast<NamedDecl>(
D);
229 for(
const NamedDecl*BaseND : Pattern->lookup(ND->getDeclName())) {
230 if(BaseND->isImplicit())
232 if(BaseND->getKind() == ND->getKind())
236}
else if(
const auto*ECD = dyn_cast<EnumConstantDecl>(
D)) {
237 if(
const auto*ED = dyn_cast<EnumDecl>(ECD->getDeclContext())) {
239 for(
const NamedDecl*BaseECD : Pattern->lookup(ECD->getDeclName()))
248 if(
autoVD = dyn_cast<VarDecl>(
D))
249 returnVD->isThisDeclarationADefinition(Ctx);
251 if(
autoFD = dyn_cast<FunctionDecl>(
D))
252 returnFD->isThisDeclarationADefinition();
254 if(
autoTD = dyn_cast<TagDecl>(
D))
255 returnTD->isThisDeclarationADefinition();
257 if(
autoMD = dyn_cast<ObjCMethodDecl>(
D))
258 returnMD->isThisDeclarationADefinition() || isa<ObjCImplDecl>(ContainerDC);
260 if(isa<TypedefNameDecl>(
D) || isa<EnumConstantDecl>(
D) ||
261isa<FieldDecl>(
D) || isa<MSPropertyDecl>(
D) || isa<ObjCImplDecl>(
D) ||
262isa<ObjCPropertyImplDecl>(
D) || isa<ConceptDecl>(
D))
271!isa<ObjCCategoryDecl>(ND)) || isa<CXXDeductionGuideDecl>(ND);
277 for(;;
Parent= cast<Decl>(
Parent->getDeclContext())) {
278 if(isa<TranslationUnitDecl>(
Parent))
280 if(isa<LinkageSpecDecl>(
Parent) || isa<BlockDecl>(
Parent))
282 if(
autoNS = dyn_cast<NamespaceDecl>(
Parent)) {
283 if(NS->isAnonymousNamespace())
285}
else if(
autoRD = dyn_cast<RecordDecl>(
Parent)) {
286 if(RD->isAnonymousStructOrUnion())
288}
else if(
autoND = dyn_cast<NamedDecl>(
Parent)) {
298 if(
autoTD = dyn_cast<TemplateDecl>(
D)) {
299 if(
autoTTD = TD->getTemplatedDecl()) {
314 boolaccept =
false;
342llvm_unreachable(
"Unsupported SymbolRole value!");
347 for(
auto&Rel : Relations) {
348 if(acceptForRelation(Rel.Roles))
415FinalRelations.reserve(Relations.size()+1);
418 autoIt = llvm::find_if(FinalRelations, [&](
SymbolRelationElem) ->
bool{
421 if(It != FinalRelations.end()) {
422It->Roles |= Rel.Roles;
424FinalRelations.push_back(Rel);
443 for(
auto&Rel : Relations) {
445Rel.RelatedSymbol->getCanonicalDecl()));
455 if(!shouldIndexMacroOccurrence(
false,
Loc))
464 if(!shouldIndexMacroOccurrence(
false,
Loc))
473 if(!shouldIndexMacroOccurrence(
true,
Loc))
479boolIndexingContext::shouldIndexMacroOccurrence(
boolIsRef,
Defines the clang::ASTContext interface.
Defines the C++ template declaration subclasses.
static bool shouldSkipNamelessDecl(const NamedDecl *ND)
Whether the given NamedDecl should be skipped because it has no name.
static const Decl * adjustParent(const Decl *Parent)
static void reportModuleReferences(const Module *Mod, ArrayRef< SourceLocation > IdLocs, const ImportDecl *ImportD, IndexDataConsumer &DataConsumer)
static bool isGeneratedDecl(const Decl *D)
static bool isDeclADefinition(const Decl *D, const DeclContext *ContainerDC, ASTContext &Ctx)
static bool shouldReportOccurrenceForSystemDeclOnlyMode(bool IsRef, SymbolRoleSet Roles, ArrayRef< SymbolRelation > Relations)
static const Decl * adjustTemplateImplicitInstantiation(const Decl *D)
static const CXXRecordDecl * getDeclContextForTemplateInstationPattern(const Decl *D)
static const Decl * getCanonicalDecl(const Decl *D)
Defines the clang::SourceLocation class and associated facilities.
Defines the SourceManager interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceManager & getSourceManager()
const LangOptions & getLangOpts() const
Represents a C++ struct/union/class.
CXXRecordDecl * getInstantiatedFromMemberClass() const
If this record is an instantiation of a member class, retrieves the member class from which it was in...
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated.
Represents a class template specialization, which refers to a class template with a given set of temp...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Decl - This represents one declaration (or definition), e.g.
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
bool isInvalidDecl() const
SourceLocation getLocation() const
DeclContext * getDeclContext()
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
bool isEmpty() const
Evaluates true when this declaration name is empty.
EnumDecl * getInstantiatedFromMemberEnum() const
Returns the enumeration (declared within the template) from which this enumeration type was instantia...
This represents one expression.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Represents a function declaration or definition.
One of these records is kept for each identifier that is lexed.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
ArrayRef< SourceLocation > getIdentifierLocs() const
Retrieves the locations of each of the identifiers that make up the complete module name in the impor...
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
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.
Describes a module or submodule.
Module * Parent
The parent of this module.
This represents a decl that may have a name.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
CharacteristicKind getFileCharacteristic() const
Return whether this is a system header or not.
This is a discriminated union of FileInfo and ExpansionInfo.
const FileInfo & getFile() const
virtual bool handleDeclOccurrence(const Decl *D, SymbolRoleSet Roles, ArrayRef< SymbolRelation > Relations, SourceLocation Loc, ASTNodeInfo ASTNode)
virtual bool handleMacroOccurrence(const IdentifierInfo *Name, const MacroInfo *MI, SymbolRoleSet Roles, SourceLocation Loc)
virtual bool handleModuleOccurrence(const ImportDecl *ImportD, const Module *Mod, SymbolRoleSet Roles, SourceLocation Loc)
bool shouldIndexImplicitInstantiation() const
bool importedModule(const ImportDecl *ImportD)
bool handleDecl(const Decl *D, SymbolRoleSet Roles=SymbolRoleSet(), ArrayRef< SymbolRelation > Relations={})
bool shouldIndex(const Decl *D)
bool handleReference(const NamedDecl *D, SourceLocation Loc, const NamedDecl *Parent, const DeclContext *DC, SymbolRoleSet Roles=SymbolRoleSet(), ArrayRef< SymbolRelation > Relations={}, const Expr *RefE=nullptr)
bool shouldIndexFunctionLocalSymbols() const
void handleMacroReference(const IdentifierInfo &Name, SourceLocation Loc, const MacroInfo &MD)
bool shouldIndexTemplateParameters() const
bool shouldIndexParametersInDeclarations() const
void handleMacroUndefined(const IdentifierInfo &Name, SourceLocation Loc, const MacroInfo &MI)
static bool isTemplateImplicitInstantiation(const Decl *D)
const LangOptions & getLangOpts() const
void handleMacroDefined(const IdentifierInfo &Name, SourceLocation Loc, const MacroInfo &MI)
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
SymbolRole
Set of roles that are attributed to symbol occurrences.
@ RelationSpecializationOf
bool isFunctionLocalSymbol(const Decl *D)
bool applyForEachSymbolRoleInterruptible(SymbolRoleSet Roles, llvm::function_ref< bool(SymbolRole)> Fn)
The JSON file list parser is used to communicate input to InstallAPI.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
@ TSK_Undeclared
This template specialization was formed from a template-id but has not yet been declared,...
SystemSymbolFilterKind SystemSymbolFilter
bool IndexParametersInDeclarations
bool IndexImplicitInstantiation
bool IndexTemplateParameters
Represents a relation to another symbol for a symbol occurrence.
const Decl * RelatedSymbol
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