clang: clang::DeclContext Class Reference (original) (raw)
DeclContext - This is used only as base class of specific decl types that can act as declaration contexts. More...
#include "[clang/AST/DeclBase.h](DeclBase%5F8h%5Fsource.html)"
| Classes | |
|---|---|
| class | all_lookups_iterator |
| all_lookups_iterator - An iterator that provides a view over the results of looking up every possible name. More... | |
| class | BlockDeclBitfields |
| Stores the bits used by BlockDecl. More... | |
| class | CXXConstructorDeclBitfields |
| Stores the bits used by CXXConstructorDecl. More... | |
| class | ddiag_iterator |
| An iterator over the dependent diagnostics in a dependent context. More... | |
| class | decl_iterator |
| decl_iterator - Iterates through the declarations stored within this context. More... | |
| class | DeclContextBitfields |
| Stores the bits used by DeclContext. More... | |
| class | EnumDeclBitfields |
| Stores the bits used by EnumDecl. More... | |
| class | filtered_decl_iterator |
| Iterates over a filtered subrange of declarations stored in a DeclContext. More... | |
| class | FunctionDeclBitfields |
| Stores the bits used by FunctionDecl. More... | |
| class | LinkageSpecDeclBitfields |
| Stores the bits used by LinkageSpecDecl. More... | |
| class | NamespaceDeclBitfields |
| Stores the bits used by NamespaceDecl. More... | |
| class | ObjCContainerDeclBitfields |
| Stores the bits used by ObjCContainerDecl. More... | |
| class | ObjCMethodDeclBitfields |
| Stores the bits used by ObjCMethodDecl. More... | |
| class | OMPDeclareReductionDeclBitfields |
| Stores the bits used by OMPDeclareReductionDecl. More... | |
| class | RecordDeclBitfields |
| Stores the bits used by RecordDecl. More... | |
| class | specific_decl_iterator |
| specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it). More... | |
| class | TagDeclBitfields |
| Stores the bits used by TagDecl. More... | |
| struct | udir_iterator |
| Public Types | |
|---|---|
| using | decl_range = llvm::iterator_range<decl_iterator> |
| using | lookup_result = DeclContextLookupResult |
| using | lookup_iterator = lookup_result::iterator |
| using | lookups_range = llvm::iterator_range<all_lookups_iterator> |
| using | udir_iterator_base |
| using | udir_range = llvm::iterator_range<udir_iterator> |
| using | ddiag_range = llvm::iterator_range<DeclContext::ddiag_iterator> |
| Public Member Functions | |
|---|---|
| ~DeclContext () | |
| bool | hasValidDeclKind () const |
| Decl::Kind | getDeclKind () const |
| const char * | getDeclKindName () const |
| DeclContext * | getParent () |
| getParent - Returns the containing DeclContext. | |
| const DeclContext * | getParent () const |
| DeclContext * | getLexicalParent () |
| getLexicalParent - Returns the containing lexical DeclContext. | |
| const DeclContext * | getLexicalParent () const |
| DeclContext * | getLookupParent () |
| Find the parent context of this context that will be used for unqualified name lookup. | |
| const DeclContext * | getLookupParent () const |
| ASTContext & | getParentASTContext () const |
| bool | isClosure () const |
| const BlockDecl * | getInnermostBlockDecl () const |
| Return this DeclContext if it is a BlockDecl. | |
| bool | isObjCContainer () const |
| bool | isFunctionOrMethod () const |
| bool | isLookupContext () const |
| Test whether the context supports looking up names. | |
| bool | isFileContext () const |
| bool | isTranslationUnit () const |
| bool | isRecord () const |
| bool | isRequiresExprBody () const |
| bool | isNamespace () const |
| bool | isStdNamespace () const |
| bool | isInlineNamespace () const |
| bool | isDependentContext () const |
| Determines whether this context is dependent on a template parameter. | |
| bool | isTransparentContext () const |
| isTransparentContext - Determines whether this context is a "transparent" context, meaning that the members declared in this context are semantically declared in the nearest enclosing non-transparent (opaque) context but are lexically declared in this context. | |
| bool | isExternCContext () const |
| Determines whether this context or some of its ancestors is a linkage specification context that specifies C linkage. | |
| const LinkageSpecDecl * | getExternCContext () const |
| Retrieve the nearest enclosing C linkage specification context. | |
| bool | isExternCXXContext () const |
| Determines whether this context or some of its ancestors is a linkage specification context that specifies C++ linkage. | |
| bool | Equals (const DeclContext *DC) const |
| Determine whether this declaration context is equivalent to the declaration context DC. | |
| bool | Encloses (const DeclContext *DC) const |
| Determine whether this declaration context semantically encloses the declaration context DC. | |
| bool | LexicallyEncloses (const DeclContext *DC) const |
| Determine whether this declaration context lexically encloses the declaration context DC. | |
| Decl * | getNonClosureAncestor () |
| Find the nearest non-closure ancestor of this context, i.e. | |
| const Decl * | getNonClosureAncestor () const |
| DeclContext * | getNonTransparentContext () |
| const DeclContext * | getNonTransparentContext () const |
| DeclContext * | getPrimaryContext () |
| getPrimaryContext - There may be many different declarations of the same entity (including forward declarations of classes, multiple definitions of namespaces, etc.), each with a different set of declarations. | |
| const DeclContext * | getPrimaryContext () const |
| DeclContext * | getRedeclContext () |
| getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same name, or where it is a redeclaration if the two entities are compatible. | |
| const DeclContext * | getRedeclContext () const |
| DeclContext * | getEnclosingNamespaceContext () |
| Retrieve the nearest enclosing namespace context. | |
| const DeclContext * | getEnclosingNamespaceContext () const |
| RecordDecl * | getOuterLexicalRecordContext () |
| Retrieve the outermost lexically enclosing record context. | |
| const RecordDecl * | getOuterLexicalRecordContext () const |
| bool | InEnclosingNamespaceSetOf (const DeclContext *NS) const |
| Test if this context is part of the enclosing namespace set of the context NS, as defined in C++0x [namespace.def]p9. | |
| void | collectAllContexts (SmallVectorImpl< DeclContext * > &Contexts) |
| Collects all of the declaration contexts that are semantically connected to this declaration context. | |
| decl_range | decls () const |
| decls_begin/decls_end - Iterate over the declarations stored in this context. | |
| decl_iterator | decls_begin () const |
| decl_iterator | decls_end () const |
| bool | decls_empty () const |
| decl_range | noload_decls () const |
| noload_decls_begin/end - Iterate over the declarations stored in this context that are currently loaded; don't attempt to retrieve anything from an external source. | |
| decl_iterator | noload_decls_begin () const |
| decl_iterator | noload_decls_end () const |
| void | addDecl (Decl *D) |
| Add the declaration D into this context. | |
| void | addDeclInternal (Decl *D) |
| Add the declaration D into this context, but suppress searches for external declarations with the same name. | |
| void | addHiddenDecl (Decl *D) |
| Add the declaration D to this context without modifying any lookup tables. | |
| void | removeDecl (Decl *D) |
| Removes a declaration from this context. | |
| bool | containsDecl (Decl *D) const |
| Checks whether a declaration is in this context. | |
| bool | containsDeclAndLoad (Decl *D) const |
| Checks whether a declaration is in this context. | |
| lookup_result | lookup (DeclarationName Name) const |
| lookup - Find the declarations (if any) with the given Name in this context. | |
| lookup_result | noload_lookup (DeclarationName Name) |
| Find the declarations with the given name that are visible within this context; don't attempt to retrieve anything from an external source. | |
| void | localUncachedLookup (DeclarationName Name, SmallVectorImpl< NamedDecl * > &Results) |
| A simplistic name lookup mechanism that performs name lookup into this declaration context without consulting the external source. | |
| void | makeDeclVisibleInContext (NamedDecl *D) |
| Makes a declaration visible within this context. | |
| lookups_range | lookups () const |
| lookups_range | noload_lookups (bool PreserveInternalState) const |
| all_lookups_iterator | lookups_begin () const |
| Iterators over all possible lookups within this context. | |
| all_lookups_iterator | lookups_end () const |
| all_lookups_iterator | noload_lookups_begin () const |
| Iterators over all possible lookups within this context that are currently loaded; don't attempt to retrieve anything from an external source. | |
| all_lookups_iterator | noload_lookups_end () const |
| udir_range | using_directives () const |
| Returns iterator range [First, Last) of UsingDirectiveDecls stored within this context. | |
| ddiag_range | ddiags () const |
| void | setMustBuildLookupTable () |
| Mark that there are external lexical declarations that we need to include in our lookup table (and that are not available as external visible lookups). | |
| StoredDeclsMap * | getLookupPtr () const |
| Retrieve the internal representation of the lookup structure. | |
| StoredDeclsMap * | buildLookup () |
| Ensure the lookup structure is fully-built and return it. | |
| bool | hasExternalLexicalStorage () const |
| Whether this DeclContext has external storage containing additional declarations that are lexically in this context. | |
| void | setHasExternalLexicalStorage (bool ES=true) const |
| State whether this DeclContext has external storage for declarations lexically in this context. | |
| bool | hasExternalVisibleStorage () const |
| Whether this DeclContext has external storage containing additional declarations that are visible in this context. | |
| void | setHasExternalVisibleStorage (bool ES=true) const |
| State whether this DeclContext has external storage for declarations visible in this context. | |
| bool | isDeclInLexicalTraversal (const Decl *D) const |
| Determine whether the given declaration is stored in the list of declarations lexically within this context. | |
| void | setUseQualifiedLookup (bool use=true) const |
| bool | shouldUseQualifiedLookup () const |
| void | dumpAsDecl () const |
| void | dumpAsDecl (const ASTContext *Ctx) const |
| void | dumpDeclContext () const |
| void | dumpLookups () const |
| void | dumpLookups (llvm::raw_ostream &OS, bool DumpDecls=false, bool Deserialize=false) const |
| Protected Types | |
|---|---|
| enum | { NumOdrHashBits = 25 } |
| enum | { NumDeclContextBits = 13 } |
| Number of bits in DeclContextBitfields. More... | |
| enum | { NumNamespaceDeclBits = NumDeclContextBits + 2 } |
| Number of inherited and non-inherited bits in NamespaceDeclBitfields. More... | |
| enum | { NumTagDeclBits = NumDeclContextBits + 10 } |
| Number of inherited and non-inherited bits in TagDeclBitfields. More... | |
| enum | { NumEnumDeclBits = NumTagDeclBits + 20 } |
| Number of inherited and non-inherited bits in EnumDeclBitfields. More... | |
| enum | { NumRecordDeclBits = NumTagDeclBits + 41 } |
| Number of inherited and non-inherited bits in RecordDeclBitfields. More... | |
| enum | { NumOMPDeclareReductionDeclBits = NumDeclContextBits + 2 } |
| Number of inherited and non-inherited bits in OMPDeclareReductionDeclBitfields. More... | |
| enum | { NumFunctionDeclBits = NumDeclContextBits + 32 } |
| Number of inherited and non-inherited bits in FunctionDeclBitfields. More... | |
| enum | { NumCXXConstructorDeclBits = NumFunctionDeclBits + 19 } |
| Number of inherited and non-inherited bits in CXXConstructorDeclBitfields. More... | |
| enum | { NumObjCMethodDeclBits = NumDeclContextBits + 24 } |
| Number of inherited and non-inherited bits in ObjCMethodDeclBitfields. More... | |
| enum | { NumObjCContainerDeclBits = 64 } |
| Number of inherited and non-inherited bits in ObjCContainerDeclBitfields. More... | |
| enum | { NumLinkageSpecDeclBits = NumDeclContextBits + 4 } |
| Number of inherited and non-inherited bits in LinkageSpecDeclBitfields. More... | |
| enum | { NumBlockDeclBits = NumDeclContextBits + 5 } |
| Number of inherited and non-inherited bits in BlockDeclBitfields. More... |
| Static Protected Member Functions | |
|---|---|
| static std::pair< Decl *, Decl * > | BuildDeclChain (ArrayRef< Decl * > Decls, bool FieldsAlreadyLoaded) |
| Build up a chain of declarations. |
| Protected Attributes | |
|---|---|
| StoredDeclsMap * | LookupPtr = nullptr |
| Pointer to the data structure used to lookup declarations within this context (or a DependentStoredDeclsMap if this is a dependent context). | |
| union { | |
| DeclContextBitfields DeclContextBits | |
| NamespaceDeclBitfields NamespaceDeclBits | |
| TagDeclBitfields TagDeclBits | |
| EnumDeclBitfields EnumDeclBits | |
| RecordDeclBitfields RecordDeclBits | |
| OMPDeclareReductionDeclBitfields OMPDeclareReductionDeclBits | |
| FunctionDeclBitfields FunctionDeclBits | |
| CXXConstructorDeclBitfields CXXConstructorDeclBits | |
| ObjCMethodDeclBitfields ObjCMethodDeclBits | |
| ObjCContainerDeclBitfields ObjCContainerDeclBits | |
| LinkageSpecDeclBitfields LinkageSpecDeclBits | |
| BlockDeclBitfields BlockDeclBits | |
| }; | |
| This anonymous union stores the bits belonging to DeclContext and classes deriving from it. | |
| Decl * | FirstDecl = nullptr |
| FirstDecl - The first declaration stored within this declaration context. | |
| Decl * | LastDecl = nullptr |
| LastDecl - The last declaration stored within this declaration context. |
| Friends | |
|---|---|
| class | ASTDeclReader |
| For makeDeclVisibleInContextImpl. | |
| class | ASTDeclWriter |
| For checking the new bits in the Serialization part. | |
| class | ExternalASTSource |
| For reconcileExternalVisibleStorage, CreateStoredDeclsMap, hasNeedToReconcileExternalVisibleStorage. | |
| class | DependentDiagnostic |
| For CreateStoredDeclsMap. | |
| class | ASTWriter |
| For hasNeedToReconcileExternalVisibleStorage, hasLazyLocalLexicalLookups, hasLazyExternalLexicalLookups. |
DeclContext - This is used only as base class of specific decl types that can act as declaration contexts.
These decls are (only the top classes that directly derive from DeclContext are mentioned, not their subclasses):
TranslationUnitDecl ExternCContext NamespaceDecl TagDecl OMPDeclareReductionDecl OMPDeclareMapperDecl FunctionDecl ObjCMethodDecl ObjCContainerDecl LinkageSpecDecl ExportDecl BlockDecl CapturedDecl
Definition at line 1449 of file DeclBase.h.
◆ ddiag_range
◆ decl_range
◆ lookup_iterator
◆ lookup_result
◆ lookups_range
◆ udir_iterator_base
Initial value:
lookup_result::iterator lookup_iterator
std::forward_iterator_tag iterator_category
Represents C++ using-directive.
Definition at line 2643 of file DeclBase.h.
◆ udir_range
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
| DeclContext::DeclContext ( Decl::Kind K) | protected |
|---|
Definition at line 1302 of file DeclBase.cpp.
References DeclContextBits, setHasExternalLexicalStorage(), setHasExternalVisibleStorage(), and setUseQualifiedLookup().
Referenced by clang::OMPDeclareReductionDecl::ASTDeclReader, clang::NamespaceDecl::ASTDeclWriter, clang::ObjCMethodDecl::ASTDeclWriter, clang::OMPDeclareMapperDecl::ASTDeclWriter, clang::FunctionDecl::castFromDeclContext(), clang::HLSLBufferDecl::castFromDeclContext(), clang::NamespaceDecl::castFromDeclContext(), clang::ObjCContainerDecl::castFromDeclContext(), clang::ObjCMethodDecl::castFromDeclContext(), clang::OMPDeclareMapperDecl::castFromDeclContext(), clang::OMPDeclareReductionDecl::castFromDeclContext(), clang::TagDecl::castFromDeclContext(), clang::FunctionDecl::castToDeclContext(), clang::HLSLBufferDecl::castToDeclContext(), clang::NamespaceDecl::castToDeclContext(), clang::ObjCContainerDecl::castToDeclContext(), clang::ObjCMethodDecl::castToDeclContext(), clang::OMPDeclareMapperDecl::castToDeclContext(), clang::OMPDeclareReductionDecl::castToDeclContext(), clang::TagDecl::castToDeclContext(), classof(), clang::FunctionDecl::Create(), clang::FunctionDecl::Create(), clang::HLSLBufferDecl::Create(), clang::NamespaceDecl::Create(), clang::ObjCMethodDecl::Create(), clang::OMPDeclareMapperDecl::Create(), clang::OMPDeclareReductionDecl::Create(), clang::HLSLBufferDecl::CreateDefaultCBuffer(), dumpDeclContext(), dumpLookups(), Encloses(), Equals(), clang::FunctionDecl::FunctionDecl(), getEnclosingNamespaceContext(), getEnclosingNamespaceContext(), getExternCContext(), getInnermostBlockDecl(), getLexicalParent(), getLexicalParent(), getLookupParent(), getLookupParent(), getNonClosureAncestor(), getNonTransparentContext(), getNonTransparentContext(), getOuterLexicalRecordContext(), getOuterLexicalRecordContext(), getParent(), getParent(), getPrimaryContext(), getPrimaryContext(), getRedeclContext(), getRedeclContext(), InEnclosingNamespaceSetOf(), clang::ObjCMethodDecl::isDesignatedInitializerForTheInterface(), clang::FunctionDecl::isGlobal(), LexicallyEncloses(), lookups(), makeDeclVisibleInContext(), noload_lookup(), noload_lookups(), clang::ObjCContainerDecl::ObjCContainerDecl(), and clang::TagDecl::TagDecl().
◆ ~DeclContext()
| DeclContext::~DeclContext ( ) | default |
|---|
◆ addDecl()
| void DeclContext::addDecl | ( | Decl * | D | ) |
|---|
Add the declaration D into this context.
This routine should be invoked when the declaration D has first been declared, to place D into the context where it was (lexically) defined. Every declaration must be added to one (and only one!) context, where it can be visited via [decls_begin(), decls_end()). Once a declaration has been added to its lexical context, the corresponding DeclContext owns the declaration.
If D is also a NamedDecl, it will be made visible within its semantic context via makeDeclVisibleInContext.
Definition at line 1816 of file DeclBase.cpp.
References addHiddenDecl().
Referenced by clang::Sema::ActOnCapturedRegionStart(), clang::Sema::ActOnCapturedRegionStart(), clang::SemaOpenACC::ActOnEndDeclDirective(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaOpenMP::ActOnOpenMPAllocateDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionDirectiveStart(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::ActOnStartNamespaceDef(), clang::ObjCImplDecl::addClassMethod(), addFieldToRecordDecl(), clang::ObjCImplDecl::addInstanceMethod(), clang::HLSLBufferDecl::addLayoutStruct(), clang::ObjCImplDecl::addPropertyImplementation(), clang::Sema::BuildAnonymousStructOrUnion(), clang::ASTContext::buildBuiltinTemplateDecl(), clang::Sema::BuildCaptureField(), buildImplicitMapper(), clang::Sema::BuildModuleInclude(), clang::SemaObjC::CheckImplementationIvars(), clang::SemaOpenACC::CheckRoutineDecl(), clang::Sema::CompleteLambdaCallOperator(), constructBufferConceptDecl(), CreateAAPCSABIBuiltinVaListDecl(), clang::Sema::CreateBuiltin(), clang::Sema::CreateCapturedStmtRecordDecl(), createHostLayoutStruct(), createHostLayoutStructForBuffer(), clang::Sema::createImplicitModuleImportForErrorRecovery(), clang::Sema::createLambdaClosureType(), clang::SemaObjC::CreatePropertyDecl(), clang::Sema::DeclareImplicitCopyAssignment(), clang::Sema::DeclareImplicitCopyConstructor(), clang::Sema::DeclareImplicitDefaultConstructor(), clang::Sema::DeclareImplicitDestructor(), clang::Sema::DeclareImplicitMoveAssignment(), clang::Sema::DeclareImplicitMoveConstructor(), clang::Sema::findInheritingConstructor(), clang::ASTContext::getBlockDescriptorExtendedType(), clang::ASTContext::getBlockDescriptorType(), clang::CodeGen::CodeGenModule::getObjCFastEnumerationStateType(), clang::ASTContext::getObjCSuperType(), clang::ASTContext::InitBuiltinTypes(), clang::HLSLExternalSemaSource::InitializeSema(), clang::SemaObjC::ProcessPropertyDecl(), clang::Sema::PushUsingDirective(), clang::TreeTransform< AdjustConstraintDepth >::RebuildExceptionDecl(), and clang::Sema::SubstSpaceshipAsEqualEqual().
◆ addDeclInternal()
| void DeclContext::addDeclInternal | ( | Decl * | D | ) |
|---|
Add the declaration D into this context, but suppress searches for external declarations with the same name.
Although analogous in function to addDecl, this removes an important check. This is only useful if the Decl is being added in response to an external search; in all other cases, addDecl() is the right function to use. See the ASTImporter for use cases.
Definition at line 1824 of file DeclBase.cpp.
References addHiddenDecl().
Referenced by clang::ASTNodeImporter::ImportDeclContext(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitConceptDecl(), clang::ASTNodeImporter::VisitEmptyDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitImplicitConceptSpecializationDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTNodeImporter::VisitLabelDecl(), clang::ASTNodeImporter::VisitLifetimeExtendedTemporaryDecl(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), clang::ASTNodeImporter::VisitNamespaceAliasDecl(), clang::ASTNodeImporter::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), clang::ASTNodeImporter::VisitObjCCategoryImplDecl(), clang::ASTNodeImporter::VisitObjCInterfaceDecl(), clang::ASTNodeImporter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::ASTNodeImporter::VisitObjCProtocolDecl(), clang::ASTNodeImporter::VisitRequiresExprBodyDecl(), clang::ASTNodeImporter::VisitStaticAssertDecl(), clang::ASTNodeImporter::VisitTypeAliasTemplateDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitUnresolvedUsingTypenameDecl(), clang::ASTNodeImporter::VisitUnresolvedUsingValueDecl(), clang::ASTNodeImporter::VisitUsingDecl(), clang::ASTNodeImporter::VisitUsingDirectiveDecl(), clang::ASTNodeImporter::VisitUsingEnumDecl(), clang::ASTNodeImporter::VisitUsingShadowDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
◆ addHiddenDecl()
| void DeclContext::addHiddenDecl | ( | Decl * | D | ) |
|---|
Add the declaration D to this context without modifying any lookup tables.
This is useful for some operations in dependent contexts where the semantic context might not be dependent; this basically only happens with friends.
Definition at line 1790 of file DeclBase.cpp.
References clang::ASTContext::addedLocalImportDecl(), FirstDecl, clang::Decl::getASTContext(), clang::Decl::getLexicalDeclContext(), clang::Decl::getNextDeclInContext(), clang::Decl::isFromASTFile(), and LastDecl.
Referenced by addDecl(), addDeclInternal(), buildCaptureDecl(), clang::Sema::BuildVariableInstantiation(), and FinishForRangeVarDecl().
◆ BuildDeclChain()
◆ buildLookup()
Ensure the lookup structure is fully-built and return it.
buildLookup - Build the lookup data structure with all of the declarations in this DeclContext (and any other contexts linked to it or transparent contexts nested within it) and return it.
Note that the produced map may miss out declarations from an external source. If it does, those entries will be marked with the 'hasExternalDecls' flag.
Definition at line 1839 of file DeclBase.cpp.
References collectAllContexts(), getPrimaryContext(), hasExternalVisibleStorage(), and LookupPtr.
Referenced by lookups().
◆ classof() [1/2]
| bool DeclContext::classof ( const Decl * D) | static |
|---|
◆ classof() [2/2]
◆ collectAllContexts()
Collects all of the declaration contexts that are semantically connected to this declaration context.
For declaration contexts that have multiple semantically connected but syntactically distinct contexts, such as C++ namespaces, this routine retrieves the complete set of such declaration contexts in source order. For example, given:
namespace N {
int x;
}
namespace N {
int y;
}
The Contexts parameter will contain both definitions of N.
Parameters
| Contexts | Will be cleared and set to the set of declaration contexts that are semanticaly connected to this declaration context, in source order, including this context (which may be the only result, for non-namespace contexts). |
|---|
Definition at line 1559 of file DeclBase.cpp.
References collectAllContextsImpl(), and getDeclKind().
Referenced by buildLookup().
◆ containsDecl()
| bool DeclContext::containsDecl | ( | Decl * | D | ) | const |
|---|
◆ containsDeclAndLoad()
| bool DeclContext::containsDeclAndLoad | ( | Decl * | D | ) | const |
|---|
◆ ddiags()
| DeclContext::ddiag_range clang::DeclContext::ddiags ( ) const | inline |
|---|
◆ decls()
| decl_range clang::DeclContext::decls ( ) const | inline |
|---|
decls_begin/decls_end - Iterate over the declarations stored in this context.
Definition at line 2373 of file DeclBase.h.
References decls_begin(), and decls_end().
Referenced by clang::SemaOpenMP::ActOnOpenMPAssumesDirective(), clang::Sema::ActOnStartOfFunctionDef(), AddInterfaceResults(), clang::CallGraph::addNodesForBlocks(), clang::ODRHash::AddObjCInterfaceDecl(), clang::ODRHash::AddObjCProtocolDecl(), AddProtocolResults(), CheckAbstractClassUsage(), checkExportedDeclContext(), clang::IncrementalParser::CleanUpPTU(), clang::SemaCodeCompletion::CodeCompleteObjCInterfaceCategory(), clang::SemaCodeCompletion::CodeCompleteObjCPropertyDefinition(), diagnoseBadDirectAccess(), DiagnoseNonAggregateReason(), clang::Sema::DiagnoseUnusedNestedTypedefs(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::dumpDeclContext(), clang::CIRGen::CIRGenModule::emitDeclContext(), clang::CodeGen::CodeGenModule::EmitTopLevelDecl(), clang::CIRGen::CIRGenModule::emitTopLevelDecl(), clang::ASTMergeAction::ExecuteAction(), getNonCLikeKindForAnonymousStruct(), GroupNewVirtualOverloads(), clang::SemaBPF::handlePreserveAIRecord(), clang::ASTNodeImporter::ImportDeclContext(), clang::index::IndexingContext::indexDeclContext(), InjectAnonymousStructOrUnionMembers(), clang::Sema::InstantiateClassMembers(), isTrivialForMSVC(), clang::serialization::numberAnonymousDeclsWithin(), clang::randstruct::randomizeStructureLayout(), clang::Sema::SetCtorInitializers(), and clang::installapi::InstallAPIVisitor::VisitCXXRecordDecl().
◆ decls_begin()
Definition at line 1672 of file DeclBase.cpp.
References FirstDecl, and hasExternalLexicalStorage().
Referenced by clang::HLSLBufferDecl::buffer_decls_begin(), clang::ObjCContainerDecl::classmeth_begin(), clang::ObjCContainerDecl::classprop_begin(), clang::SemaCodeCompletion::CodeCompleteNamespaceDecl(), clang::CXXRecordDecl::ctor_begin(), decls(), clang::EnumDecl::enumerator_begin(), clang::Sema::FindInstantiatedDecl(), findUserDeclaredCtor(), clang::ExportDecl::getEndLoc(), clang::LinkageSpecDecl::getEndLoc(), clang::HLSLExternalSemaSource::InitializeSema(), clang::ObjCContainerDecl::instmeth_begin(), clang::ObjCContainerDecl::instprop_begin(), clang::ObjCCategoryDecl::ivar_begin(), clang::ObjCImplementationDecl::ivar_begin(), clang::ObjCContainerDecl::meth_begin(), clang::CXXRecordDecl::method_begin(), MethodsAndNestedClassesComplete(), clang::ObjCContainerDecl::prop_begin(), clang::ObjCImplDecl::propimpl_begin(), and clang::LexicallyOrderedRecursiveASTVisitor< Derived >::TraverseDeclContextHelper().
◆ decls_empty()
| bool DeclContext::decls_empty | ( | ) | const |
|---|
◆ decls_end()
Definition at line 2375 of file DeclBase.h.
Referenced by clang::HLSLBufferDecl::buffer_decls_begin(), clang::HLSLBufferDecl::buffer_decls_end(), clang::ObjCContainerDecl::classmeth_end(), clang::ObjCContainerDecl::classprop_end(), clang::SemaCodeCompletion::CodeCompleteNamespaceDecl(), clang::CXXRecordDecl::ctor_end(), decls(), clang::EnumDecl::enumerator_end(), clang::Sema::FindInstantiatedDecl(), findUserDeclaredCtor(), clang::ObjCContainerDecl::instmeth_end(), clang::ObjCContainerDecl::instprop_end(), clang::ObjCCategoryDecl::ivar_end(), clang::ObjCImplementationDecl::ivar_end(), clang::ObjCContainerDecl::meth_end(), clang::CXXRecordDecl::method_end(), MethodsAndNestedClassesComplete(), clang::ObjCContainerDecl::prop_end(), clang::ObjCImplDecl::propimpl_end(), and clang::LexicallyOrderedRecursiveASTVisitor< Derived >::TraverseDeclContextHelper().
◆ dumpAsDecl() [1/2]
| LLVM_DUMP_METHOD void DeclContext::dumpAsDecl | ( | ) | const |
|---|
◆ dumpAsDecl() [2/2]
| LLVM_DUMP_METHOD void DeclContext::dumpAsDecl | ( | const ASTContext * | Ctx | ) | const |
|---|
◆ dumpDeclContext()
| LLVM_DUMP_METHOD void DeclContext::dumpDeclContext | ( | ) | const |
|---|
◆ dumpLookups() [1/2]
| LLVM_DUMP_METHOD void DeclContext::dumpLookups | ( | ) | const |
|---|
◆ dumpLookups() [2/2]
| void clang::DeclContext::dumpLookups | ( | llvm::raw_ostream & | OS, |
|---|---|---|---|
| bool | DumpDecls = false, | ||
| bool | Deserialize = false ) const |
◆ Encloses()
Determine whether this declaration context semantically encloses the declaration context DC.
Definition at line 1451 of file DeclBase.cpp.
References DeclContext(), Encloses(), getParent(), getPrimaryContext(), and clang::isa().
Referenced by clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::CheckClassTemplate(), CheckExplicitInstantiationScope(), clang::Sema::CheckShadow(), CheckTemplateSpecializationScope(), diagnoseInstanceReference(), clang::Sema::diagnoseQualifiedDeclaration(), DiagnoseTwoPhaseLookup(), DoMarkPotentialCapture(), Encloses(), getRequiredQualification(), isAcceptableTagRedeclContext(), clang::Sema::PushOnScopeChains(), and clang::SemaOpenMP::tryCaptureOpenMPLambdas().
◆ Equals()
Determine whether this declaration context is equivalent to the declaration context DC.
Definition at line 2238 of file DeclBase.h.
References DeclContext(), and getPrimaryContext().
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::Sema::ActOnTag(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::CheckClassTemplate(), CheckMultiVersionFunction(), clang::Sema::CheckShadow(), CheckTemplateSpecializationScope(), clang::Sema::DiagnoseDependentMemberLookup(), diagnoseInstanceReference(), clang::Sema::diagnoseQualifiedDeclaration(), evaluateVarDeclInit(), clang::Sema::FindInstantiatedDecl(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), InEnclosingNamespaceSetOf(), isAcceptableTagRedeclContext(), clang::CXXRecordDecl::isCurrentInstantiation(), clang::IdentifierResolver::isDeclInScope(), clang::Decl::isOutOfLine(), isOutOfScopePreviousDeclaration(), clang::Sema::LookupName(), MaybeAddOverrideCalls(), and clang::Sema::tryCaptureVariable().
◆ getDeclKind()
| Decl::Kind clang::DeclContext::getDeclKind ( ) const | inline |
|---|
Definition at line 2102 of file DeclBase.h.
References DeclContextBits.
Referenced by clang::Sema::ActOnTag(), clang::Decl::castFromDeclContext(), collectAllContexts(), clang::ASTDumper::dumpInvalidDeclContext(), getDeclKindName(), clang::serialization::getDefinitiveDeclContext(), getExternCContext(), getKind(), getOutermostFuncOrBlockContext(), getPrimaryContext(), getRedeclContext(), clang::CXXRecordDecl::hasInjectedClassType(), hasValidDeclKind(), isClosure(), isFileContext(), isFunctionOrMethod(), clang::VarDecl::isFunctionOrMethodVarDecl(), isLinkageSpecContext(), isLookupContext(), isNamespace(), isObjCContainer(), isRecord(), IsRecordContextStructurallyEquivalent(), isRequiresExprBody(), IsStructurallyEquivalent(), isTranslationUnit(), isTransparentContext(), IsUsingDirectiveInToplevelContext(), lookup(), noload_lookup(), clang::tooling::stdlib::Recognizer::operator()(), shouldConsiderLinkage(), and clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarTemplateDecl().
◆ getDeclKindName()
| const char * DeclContext::getDeclKindName | ( | ) | const |
|---|
◆ getEnclosingNamespaceContext() [1/2]
| DeclContext * DeclContext::getEnclosingNamespaceContext | ( | ) |
|---|
Retrieve the nearest enclosing namespace context.
Definition at line 2063 of file DeclBase.cpp.
References DeclContext(), getParent(), getPrimaryContext(), and isFileContext().
Referenced by clang::Sema::ActOnTag(), CheckExplicitInstantiationScope(), getEnclosingNamespaceContext(), isDefinedInClangModule(), clang::AnalysisDeclContext::isInStdNamespace(), isOutOfScopePreviousDeclaration(), shouldAddReversedEqEq(), and clang::ASTNodeImporter::VisitNamespaceDecl().
◆ getEnclosingNamespaceContext() [2/2]
| const DeclContext * clang::DeclContext::getEnclosingNamespaceContext ( ) const | inline |
|---|
◆ getExternCContext()
◆ getInnermostBlockDecl()
| const BlockDecl * DeclContext::getInnermostBlockDecl | ( | ) | const |
|---|
◆ getLexicalParent() [1/2]
| DeclContext * clang::DeclContext::getLexicalParent ( ) | inline |
|---|
getLexicalParent - Returns the containing lexical DeclContext.
May be different from getParent, e.g.:
namespace A { struct S; } struct A::S {}; // getParent() == namespace 'A' // getLexicalParent() == translation unit
Definition at line 2125 of file DeclBase.h.
References clang::cast(), and DeclContext().
Referenced by clang::SemaObjC::ActOnObjCContainerStartDefinition(), clang::Sema::ActOnReenterFunctionContext(), clang::ODRHash::AddFunctionDecl(), basicGVALinkageForVariable(), clang::Sema::CheckShadow(), clang::Sema::getCurrentMangleNumberContext(), getEnclosingExportDecl(), getExternCContext(), getLexicalParent(), getLookupParent(), getOuterLexicalRecordContext(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), isDependentContext(), clang::Decl::isInExportDeclContext(), isInInlineFunction(), clang::Decl::isInLocalScopeForInstantiation(), isLinkageSpecContext(), LexicallyEncloses(), clang::Sema::PushDeclContext(), and clang::ASTDeclWriter::VisitFunctionDecl().
◆ getLexicalParent() [2/2]
| const DeclContext * clang::DeclContext::getLexicalParent ( ) const | inline |
|---|
◆ getLookupParent() [1/2]
Find the parent context of this context that will be used for unqualified name lookup.
Generally, the parent lookup context is the semantic context. However, for a friend function the parent lookup context is the lexical context, which is the class in which the friend is declared.
Definition at line 1332 of file DeclBase.cpp.
References DeclContext(), getLexicalParent(), getParent(), getRedeclContext(), clang::isa(), isFileContext(), clang::isLambdaCallOperator(), and isRecord().
Referenced by AddTopLevelDeclarationToHash(), clang::Sema::CheckClassTemplate(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::EnterTemplatedContext(), findRecordWithDependentBasesOfEnclosingMethod(), getLookupParent(), and synthesizeCurrentNestedNameSpecifier().
◆ getLookupParent() [2/2]
| const DeclContext * clang::DeclContext::getLookupParent ( ) const | inline |
|---|
◆ getLookupPtr()
◆ getNonClosureAncestor() [1/2]
| Decl * DeclContext::getNonClosureAncestor | ( | ) |
|---|
◆ getNonClosureAncestor() [2/2]
| const Decl * clang::DeclContext::getNonClosureAncestor ( ) const | inline |
|---|
◆ getNonTransparentContext() [1/2]
| DeclContext * DeclContext::getNonTransparentContext | ( | ) |
|---|
Definition at line 1473 of file DeclBase.cpp.
References DeclContext(), getParent(), and isTransparentContext().
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::CheckFunctionConstraints(), clang::ASTDeclReader::checkMultipleDefinitionInNamedModules(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckRedeclarationExported(), findRecordDeclInContext(), getNonTransparentContext(), clang::Decl::getNonTransparentDeclContext(), clang::Decl::isInStdNamespace(), IsRecordContextStructurallyEquivalent(), and clang::NamespaceDecl::isRedundantInlineQualifierFor().
◆ getNonTransparentContext() [2/2]
| const DeclContext * clang::DeclContext::getNonTransparentContext ( ) const | inline |
|---|
◆ getOuterLexicalRecordContext() [1/2]
| RecordDecl * DeclContext::getOuterLexicalRecordContext | ( | ) |
|---|
◆ getOuterLexicalRecordContext() [2/2]
| const RecordDecl * clang::DeclContext::getOuterLexicalRecordContext ( ) const | inline |
|---|
◆ getParent() [1/2]
getParent - Returns the containing DeclContext.
Definition at line 2109 of file DeclBase.h.
References clang::cast(), and DeclContext().
Referenced by clang::Sema::ActOnFinishFullExpr(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnLambdaClosureQualifiers(), clang::Sema::ActOnSEHTryBlock(), clang::Sema::ActOnSuperScopeSpecifier(), clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::ActOnVariableDeclarator(), clang::ODRHash::AddCXXRecordDecl(), clang::ODRHash::AddFunctionDecl(), clang::Sema::adjustContextForLocalExternDecl(), adjustCVQualifiersForCXXThisWithinLambda(), clang::CodeGen::CodeGenModule::AlwaysHasLTOVisibilityPublic(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildUsingDeclaration(), calculateOffset(), clang::ento::RetainSummaryManager::canEval(), clang::Sema::CheckAddressOfOperand(), checkAttrArgsAreCapabilityObjs(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckConstructorAccess(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::Sema::CheckFunctionConstraints(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), checkInheritableAttr(), checkModuleImportContext(), clang::Sema::CheckParmsForFunctionDef(), clang::Sema::CheckShadow(), CheckSimplerImplicitMovesMSVCWorkaround(), clang::Sema::CheckUsingShadowDecl(), ClassifyImplicitMemberAccess(), CollectEnclosingNamespace(), clang::PredefinedExpr::ComputeName(), ConvertDeducedTemplateArguments(), clang::Sema::CreateCapturedStmtRecordDecl(), createFriendTagNNSFixIt(), clang::ASTContext::DeclMustBeEmitted(), diagnoseBadDirectAccess(), clang::Sema::DiagnoseDependentMemberLookup(), diagnoseImplicitlyRetainedSelf(), diagnoseInstanceReference(), clang::Sema::diagnoseQualifiedDeclaration(), DiagnoseTwoPhaseLookup(), diagnoseUncapturableValueReferenceOrBinding(), dumpDeclContext(), clang::CodeGen::CGHLSLRuntime::emitBufferMemberExpr(), EmitObjectDelete(), clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(), Encloses(), enclosingClassIsRelatedToClassInWhichMembersWereFound(), clang::ento::LikelyFalsePositiveSuppressionBRVisitor::finalizeVisitor(), clang::Sema::FindInstantiatedDecl(), clang::ObjCMethodDecl::findPropertyDecl(), findRecordWithDependentBasesOfEnclosingMethod(), getBaseAlignmentAndOffsetFromLValue(), getBestNamespaceSubstr(), clang::BodyFarm::getBody(), clang::CXXMethodDecl::getCorrespondingMethodDeclaredInClass(), clang::Sema::getCurMethodDecl(), clang::Sema::getCurrentMangleNumberContext(), clang::ASTContext::getDeclAlign(), getEnclosingNamespaceContext(), clang::Sema::getFunctionLevelDeclContext(), getFunctionName(), clang::CXXMethodDecl::getFunctionObjectParameterReferenceType(), getImplicitCodeSegAttrFromClass(), getInnermostBlockDecl(), getInnerPointerType(), clang::getLambdaAwareParentOfDeclContext(), getLookupParent(), getNonTransparentContext(), getNullabilityCompletenessCheckFileID(), getOutermostFuncOrBlockContext(), clang::CXXMethodDecl::getParent(), clang::CXXMethodDecl::getParent(), getParent(), clang::interp::Function::getParentDecl(), clang::CodeCompletionTUInfo::getParentName(), getPredefinedExprDecl(), getRedeclContext(), clang::AnalysisDeclContext::getSelfDecl(), getTagInjectionContext(), clang::CXXMethodDecl::getThisType(), clang::Decl::getTranslationUnitDecl(), clang::SemaObjC::handleIBOutletCollection(), InEnclosingNamespaceSetOf(), clang::dataflow::Environment::initialize(), clang::Sema::InstantiateFunctionDeclaration(), isAncestorDeclContextOf(), clang::ento::isCapturedByReference(), clang::CXXMethodDecl::isCopyAssignmentOperator(), clang::CXXRecordDecl::isCurrentInstantiation(), isDeclContextInNamespace(), IsDeclSourceLocationCurrent(), isDependentContext(), clang::dataflow::isFullyQualifiedNamespaceEqualTo(), clang::isGenericLambdaCallOperatorOrStaticInvokerSpecialization(), clang::FunctionDecl::isGlobal(), clang::Decl::isInAnonymousNamespace(), IsInfinityFunction(), clang::Sema::IsInsideALocalClassWithinATemplateFunction(), clang::AnalysisDeclContext::isInStdNamespace(), clang::CXXMethodDecl::isLambdaStaticInvoker(), clang::CXXMethodDecl::isMoveAssignmentOperator(), IsRecordContextStructurallyEquivalent(), clang::NamespaceDecl::isRedundantInlineQualifierFor(), isReferenceToNonConstCapture(), clang::interp::InterpFrame::isStdFunction(), isStdNamespace(), clang::isStdOrWTFMove(), IsUsingDirectiveInToplevelContext(), clang::ento::isWithinStdNamespace(), lookup(), clang::MangleContext::mangleBlock(), clang::Sema::MarkFunctionReferenced(), MaybeAddOverrideCalls(), clang::dataflow::statusor_model::namespaceEquals(), noload_lookup(), clang::tooling::stdlib::Recognizer::operator()(), clang::CodeGen::CGRecordLayout::print(), clang::NamedDecl::printNestedNameSpecifier(), recoverFromMSUnqualifiedLookup(), recoverFromTypeInKnownDependentBase(), rewriteBuiltinFunctionDecl(), clang::interp::MemberPointer::toPointer(), clang::Sema::tryCaptureVariable(), tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs(), clang::FunctionCallFilterCCC::ValidateCandidate(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), clang::TextNodeDumper::VisitFunctionDecl(), clang::interp::Compiler< Emitter >::VisitMemberExpr(), and clang::ASTDeclWriter::VisitNamespaceDecl().
◆ getParent() [2/2]
| const DeclContext * clang::DeclContext::getParent ( ) const | inline |
|---|
◆ getParentASTContext()
| ASTContext & clang::DeclContext::getParentASTContext ( ) const | inline |
|---|
Definition at line 2138 of file DeclBase.h.
References clang::cast().
Referenced by buildImplicitMapper(), disambiguateSpellingInScope(), findVar(), clang::CXXMethodDecl::getFunctionObjectParameterReferenceType(), clang::CXXRecordDecl::getLambdaContextDecl(), clang::Type::getObjCSubstitutions(), getRedeclContext(), lookups(), clang::ExternalASTSource::SetExternalVisibleDeclsForName(), clang::ExternalASTSource::SetNoExternalVisibleDeclsForName(), and clang::QualType::substObjCMemberType().
◆ getPrimaryContext() [1/2]
getPrimaryContext - There may be many different declarations of the same entity (including forward declarations of classes, multiple definitions of namespaces, etc.), each with a different set of declarations.
This routine returns the "primary" DeclContext structure, which will contain the information needed to perform name lookup into this context.
Definition at line 1482 of file DeclBase.cpp.
References clang::cast(), DeclContext(), and getDeclKind().
Referenced by buildLookup(), clang::SemaOpenACC::CheckDeclareClause(), clang::IncrementalParser::CleanUpPTU(), CollectEnclosingNamespace(), ddiags(), clang::ASTDumper::dumpLookups(), Encloses(), Equals(), clang::ASTReader::FindExternalVisibleDeclsByName(), findRecordWithDependentBasesOfEnclosingMethod(), getEnclosingNamespaceContext(), getPrimaryContext(), clang::Sema::getScopeForContext(), clang::Sema::getScopeForDeclContext(), LexicallyEncloses(), lookup(), clang::LookupNamed(), lookups(), makeDeclVisibleInContext(), MightInstantiateTo(), noload_lookup(), noload_lookups(), setMustBuildLookupTable(), synthesizeCurrentNestedNameSpecifier(), and clang::ASTDeclWriter::VisitNamespaceDecl().
◆ getPrimaryContext() [2/2]
| const DeclContext * clang::DeclContext::getPrimaryContext ( ) const | inline |
|---|
◆ getRedeclContext() [1/2]
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same name, or where it is a redeclaration if the two entities are compatible.
This skips through transparent contexts.
Definition at line 2045 of file DeclBase.cpp.
References DeclContext(), getDeclKind(), clang::ASTContext::getLangOpts(), getParent(), getParentASTContext(), isRecord(), and isTransparentContext().
Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnStartConceptDefinition(), clang::Sema::ActOnTag(), clang::Sema::ActOnTypedefNameDecl(), clang::Sema::ActOnVariableDeclarator(), clang::ASTImporterLookupTable::add(), adjustDeclContextForDeclaratorDecl(), clang::CodeGen::CodeGenModule::AlwaysHasLTOVisibilityPublic(), clang::Sema::BuildAnonymousStructOrUnion(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), CheckExplicitInstantiationScope(), clang::Sema::CheckFunctionTemplateSpecialization(), CheckMultiVersionFunction(), CheckOperatorNewDeleteDeclarationScope(), clang::Sema::CheckShadow(), clang::Sema::CheckTemplateDeclScope(), CheckTemplateSpecializationScope(), clang::Sema::CheckUsingDeclQualifier(), clang::ASTReader::CompleteRedeclChain(), clang::LinkageComputer::computeLVForDecl(), createFriendTagNNSFixIt(), clang::TypeName::createNestedNameSpecifierForScopeOf(), clang::NamedDecl::declarationReplaces(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::FinalizeDeclaration(), clang::ASTContext::forEachMultiversionedFunctionVersion(), getContextForScopeMatching(), getDeclForLocalLookup(), getFunctionStorageClass(), getLookupParent(), getRedeclContext(), handleExcludeFromExplicitInstantiationAttr(), handleWeakRefAttr(), isAcceptableTagRedeclContext(), clang::ento::CheckerContext::isCLibraryFunction(), clang::NamedDecl::isCXXClassMember(), clang::IdentifierResolver::isDeclInScope(), clang::VarDecl::isFunctionOrMethodVarDecl(), IsInternalDeclFromFileContext(), clang::FunctionDecl::isMain(), clang::FunctionDecl::isMSVCRTEntryPoint(), isOutOfScopePreviousDeclaration(), clang::NamedDecl::isReserved(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), clang::ASTContext::isSameEntity(), isStdNamespace(), clang::FunctionDecl::isUsableAsGlobalAllocationFunctionInConstantEvaluation(), clang::Sema::LookupName(), clang::Sema::makeMergedDefinitionVisible(), clang::Sema::PushOnScopeChains(), clang::Sema::RegisterLocallyScopedExternCDecl(), clang::ASTImporterLookupTable::remove(), clang::CXXDestructorDecl::setGlobalOperatorArrayDelete(), clang::CXXDestructorDecl::setOperatorGlobalDelete(), shouldConsiderLinkage(), shouldConsiderLinkage(), ShouldWarnAboutMissingPrototype(), clang::IdentifierResolver::tryAddTopLevelDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::ASTDeclWriter::VisitNamespaceDecl().
◆ getRedeclContext() [2/2]
| const DeclContext * clang::DeclContext::getRedeclContext ( ) const | inline |
|---|
◆ hasExternalLexicalStorage()
| bool clang::DeclContext::hasExternalLexicalStorage ( ) const | inline |
|---|
◆ hasExternalVisibleStorage()
| bool clang::DeclContext::hasExternalVisibleStorage ( ) const | inline |
|---|
◆ hasValidDeclKind()
| bool DeclContext::hasValidDeclKind | ( | ) | const |
|---|
◆ InEnclosingNamespaceSetOf()
| bool DeclContext::InEnclosingNamespaceSetOf | ( | const DeclContext * | NS | ) | const |
|---|
Test if this context is part of the enclosing namespace set of the context NS, as defined in C++0x [namespace.def]p9.
If either context isn't a namespace, this is equivalent to Equals().
The enclosing namespace set of a namespace is the namespace and, if it is inline, its enclosing namespace, recursively.
Definition at line 2082 of file DeclBase.cpp.
References DeclContext(), Equals(), getParent(), and isFileContext().
Referenced by clang::Sema::CheckDependentFunctionTemplateSpecialization(), CheckExplicitInstantiationScope(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::IdentifierResolver::isDeclInScope(), and isStdClassTemplate().
◆ isClosure()
| bool clang::DeclContext::isClosure ( ) const | inline |
|---|
◆ isDeclInLexicalTraversal()
| bool clang::DeclContext::isDeclInLexicalTraversal ( const Decl * D) const | inline |
|---|
◆ isDependentContext()
| bool DeclContext::isDependentContext | ( | ) | const |
|---|
Determines whether this context is dependent on a template parameter.
Definition at line 1381 of file DeclBase.cpp.
References clang::cast(), clang::Function, getLexicalParent(), getParent(), clang::isa(), isDependentContext(), and isFileContext().
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnCXXEnterDeclaratorScope(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFunctionDeclarator(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPFuseDirective(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::Sema::ActOnVariableDeclarator(), clang::SemaOpenACC::ActOnVariableInit(), AddOrdinaryNameResults(), AddRecordMembersCompletionResults(), clang::Sema::adjustContextForLocalExternDecl(), clang::Sema::BuildCXXNestedNameSpecifier(), buildDeclareReductionRef(), buildUserDefinedMapperRef(), clang::Sema::BuildVariableInstantiation(), clang::Sema::canFullyTypeCheckRedeclaration(), checkAllocateClauses(), clang::SemaCUDA::checkAllowedInitializer(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckExplicitlyDefaultedFunction(), clang::Sema::CheckFunctionConstraints(), clang::Sema::CheckFunctionDeclaration(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), checkOpenMPIterationSpace(), checkOpenMPLoop(), CheckOperatorDeleteDeclaration(), clang::Sema::CheckTemplatePartialSpecializationArgs(), checkTypeMappable(), clang::Sema::CheckUsingDeclQualifier(), clang::computeDependence(), clang::computeDependence(), clang::computeDependence(), ddiags(), clang::Sema::DeclareAggregateDeductionGuideFromInitList(), clang::Sema::DeclareImplicitDeductionGuides(), clang::ASTContext::DeclMustBeEmitted(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), DelayDependentAccess(), clang::Sema::FinalizeVarWithDestructor(), findRecordWithDependentBasesOfEnclosingMethod(), finishLinearClauses(), clang::Sema::getConstructorName(), clang::NestedNameSpecifier::getDependence(), clang::Sema::getEmissionStatus(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), clang::Sema::getTypeName(), clang::Sema::HandleDeclarator(), clang::CXXRecordDecl::hasAnyDependentBases(), hasUserDefinedMapper(), clang::CXXRecordDecl::isCurrentInstantiation(), isDependentContext(), isDependentContextAtLevel(), clang::TagDecl::isDependentType(), IsDerivedFromInclusive(), clang::Decl::isInLocalScopeForInstantiation(), isNonNegativeIntegerValue(), isOdrUseContext(), clang::Expr::isPotentialConstantExpr(), IsUnusedPrivateField(), clang::Sema::LookupParsedName(), clang::Sema::LookupQualifiedName(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), MarkBaseDestructorsReferenced(), clang::CXXRecordDecl::mayBeAbstract(), clang::Sema::MaybeBindToTemporary(), clang::serialization::needsAnonymousDeclarationNumber(), ProcessOpenMPDoacrossClauseCommon(), clang::Sema::RequireCompleteDeclContext(), shouldFunctionGenerateHereOnly(), clang::Sema::shouldLinkDependentDeclWithPrevious(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), EnsureImmediateInvocationInDefaultArgs::TransformSourceLocExpr(), tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs(), and clang::ASTNodeImporter::VisitRecordDecl().
◆ isExternCContext()
| bool DeclContext::isExternCContext | ( | ) | const |
|---|
◆ isExternCXXContext()
| bool DeclContext::isExternCXXContext | ( | ) | const |
|---|
◆ isFileContext()
| bool clang::DeclContext::isFileContext ( ) const | inline |
|---|
Definition at line 2180 of file DeclBase.h.
References getDeclKind().
Referenced by clang::Sema::ActOnDeclarator(), clang::SemaObjC::ActOnFinishObjCImplementation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnStartConceptDefinition(), clang::SemaOpenMP::ActOnStartOpenMPDeclareTargetContext(), clang::Sema::ActOnTag(), clang::Sema::ActOnTagFinishDefinition(), clang::ASTUnit::addFileLevelDecl(), clang::ODRHash::AddFunctionDecl(), clang::Sema::adjustContextForLocalExternDecl(), clang::Sema::CheckClassTemplate(), clang::ASTDeclReader::checkMultipleDefinitionInNamedModules(), clang::Sema::CheckRedeclarationExported(), clang::Sema::CheckTemplateDeclScope(), CheckTemplateSpecializationScope(), clang::SemaCodeCompletion::CodeCompleteNamespaceDecl(), clang::SemaCodeCompletion::CodeCompleteQualifiedId(), CollectEnclosingNamespace(), clang::LinkageComputer::computeLVForDecl(), computeShadowedDeclKind(), CppNamespaceLookup(), clang::Sema::CreateCapturedStmtRecordDecl(), clang::Sema::FinalizeDeclaration(), clang::Sema::FindInstantiatedDecl(), getEnclosingNamespaceContext(), clang::ASTContext::getInlineVariableDefinitionKind(), getLookupParent(), clang::Decl::getParentFunctionOrMethod(), getTagInjectionContext(), handleWeakRefAttr(), hasAcceptableMemberSpecialization(), InEnclosingNamespaceSetOf(), clang::LookupResult::isAvailableForLookup(), clang::CXXRecordDecl::isCurrentInstantiation(), isDependentContext(), isInInlineFunction(), IsInternalDeclFromFileContext(), isNamespaceOrTranslationUnitScope(), isNamespaceScope(), isUsingDeclNotAtClassScope(), clang::Sema::LookupQualifiedName(), LookupQualifiedNameInUsingDirectives(), mapCodeCompletionContext(), MightInstantiateTo(), shouldConsiderLinkage(), shouldConsiderLinkage(), clang::Sema::shouldLinkDependentDeclWithPrevious(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
◆ isFunctionOrMethod()
| bool clang::DeclContext::isFunctionOrMethod ( ) const | inline |
|---|
Definition at line 2161 of file DeclBase.h.
References getDeclKind().
Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnLambdaClosureQualifiers(), clang::Sema::ActOnSEHTryBlock(), clang::Sema::ActOnTag(), clang::Sema::ActOnVariableDeclarator(), clang::CodeCompletionBuilder::addParentContext(), clang::Sema::adjustContextForLocalExternDecl(), areAllValuesNoReturn(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildVariableInstantiation(), CheckAnonMemberRedeclaration(), clang::Sema::CheckParmsForFunctionDef(), CheckTemplateSpecializationScope(), clang::LinkageComputer::computeLVForDecl(), clang::Sema::CreateCapturedStmtRecordDecl(), diagnoseUncapturableValueReferenceOrBinding(), DoMarkPotentialCapture(), clang::Sema::FindInstantiatedDecl(), getContextForScopeMatching(), getFunctionStorageClass(), clang::CodeCompletionTUInfo::getParentName(), getTagInjectionContext(), clang::Sema::ImplicitlyDefineFunction(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::IdentifierResolver::isDeclInScope(), isDeclWithinFunction(), clang::VarDecl::isFunctionOrMethodVarDecl(), clang::Decl::isInLocalScopeForInstantiation(), isLookupContext(), isOutOfScopePreviousDeclaration(), clang::NamedDecl::isPlaceholderVar(), IsRecordContextStructurallyEquivalent(), mergeTypeWithPrevious(), clang::serialization::needsAnonymousDeclarationNumber(), clang::NamedDecl::printNestedNameSpecifier(), clang::Sema::PushUsingDirective(), shouldConsiderLinkage(), shouldConsiderLinkage(), ShouldDiagnoseUnusedDecl(), clang::Sema::tryCaptureVariable(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitFunctionTemplateDecl(), clang::ASTNodeImporter::VisitLabelDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitTypeAliasTemplateDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTDeclReader::VisitVarDeclImpl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and warnAboutAmbiguousFunction().
◆ isInlineNamespace()
| bool DeclContext::isInlineNamespace | ( | ) | const |
|---|
◆ isLookupContext()
| bool clang::DeclContext::isLookupContext ( ) const | inline |
|---|
◆ isNamespace()
| bool clang::DeclContext::isNamespace ( ) const | inline |
|---|
◆ isObjCContainer()
| bool clang::DeclContext::isObjCContainer ( ) const | inline |
|---|
◆ isRecord()
| bool clang::DeclContext::isRecord ( ) const | inline |
|---|
Definition at line 2189 of file DeclBase.h.
References getDeclKind().
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnTag(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildAnonymousStructOrUnion(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::CheckAddressOfOperand(), CheckAnonMemberRedeclaration(), clang::Sema::CheckClassTemplate(), CheckExplicitInstantiationScope(), clang::Sema::CheckExplicitObjectMemberFunction(), CheckMultiVersionAdditionalDecl(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckShadow(), CheckTemplateSpecializationScope(), clang::Sema::CheckUsingDeclQualifier(), clang::LinkageComputer::computeLVForDecl(), clang::Sema::CreateCapturedStmtRecordDecl(), CreateNewFunctionDecl(), clang::Sema::diagnoseQualifiedDeclaration(), clang::exceptionSpecNotKnownYet(), clang::Sema::FindAllocationFunctions(), getDeclLanguageLinkage(), GetFullTypeForDeclarator(), getLookupParent(), getOuterLexicalRecordContext(), getRedeclContext(), clang::Sema::getShadowedDeclaration(), clang::Sema::HandleDeclarator(), haveIncompatibleLanguageLinkages(), clang::Sema::InstantiateVariableDefinition(), clang::NamedDecl::isCXXClassMember(), isDeclExternC(), isDeclWithinFunction(), isOutOfScopePreviousDeclaration(), clang::VarDecl::isStaticDataMember(), mapCodeCompletionContext(), clang::Sema::MergeFunctionDecl(), clang::Sema::MergeVarDecl(), shouldConsiderLinkage(), shouldConsiderLinkage(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarDecl(), clang::installapi::InstallAPIVisitor::VisitVarDecl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
◆ isRequiresExprBody()
| bool clang::DeclContext::isRequiresExprBody ( ) const | inline |
|---|
◆ isStdNamespace()
| bool DeclContext::isStdNamespace | ( | ) | const |
|---|
Definition at line 1365 of file DeclBase.cpp.
References clang::cast(), getParent(), getRedeclContext(), isNamespace(), clang::IdentifierInfo::isStr(), and isTranslationUnit().
Referenced by CheckSimplerImplicitMovesMSVCWorkaround(), clang::BodyFarm::getBody(), clang::ento::CheckerContext::isCLibraryFunction(), IsInfinityFunction(), clang::Decl::isInStdNamespace(), clang::sema::isInStlNamespace(), and clang::ento::smartptr::isStdSmartPtr().
◆ isTranslationUnit()
| bool clang::DeclContext::isTranslationUnit ( ) const | inline |
|---|
Definition at line 2185 of file DeclBase.h.
References getDeclKind().
Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::SemaOpenMP::ActOnOpenMPIteratorVarDecl(), clang::Sema::ActOnTypedefNameDecl(), clang::Sema::AddKnownFunctionAttributes(), AddOrdinaryNameResults(), clang::CodeCompletionBuilder::addParentContext(), AddTopLevelDeclarationToHash(), clang::Sema::BuildAnonymousStructOrUnion(), createFriendTagNNSFixIt(), clang::TypeName::createNestedNameSpecifierForScopeOf(), clang::TypeName::createOuterNNS(), diagnoseOpenCLTypes(), dumpDeclContext(), clang::FormatASTNodeDiagnosticArgument(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), clang::Decl::getTranslationUnitDecl(), clang::Sema::ImplicitlyDefineFunction(), clang::ento::CheckerContext::isCLibraryFunction(), isDeclContextInNamespace(), IsDefaultBufferConstantDecl(), clang::dataflow::isFullyQualifiedNamespaceEqualTo(), clang::Sema::IsInsideALocalClassWithinATemplateFunction(), clang::FunctionDecl::isMain(), IsRecordContextStructurallyEquivalent(), clang::NamedDecl::isReserved(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), isStdNamespace(), isStdStreamVar(), clang::FunctionDecl::isUsableAsGlobalAllocationFunctionInConstantEvaluation(), LookupDirect(), clang::tooling::stdlib::Recognizer::operator()(), RedeclForcesDefC99(), clang::Sema::RegisterLocallyScopedExternCDecl(), clang::CXXDestructorDecl::setGlobalOperatorArrayDelete(), clang::CXXDestructorDecl::setOperatorGlobalDelete(), and clang::IdentifierResolver::tryAddTopLevelDecl().
◆ isTransparentContext()
| bool DeclContext::isTransparentContext | ( | ) | const |
|---|
isTransparentContext - Determines whether this context is a "transparent" context, meaning that the members declared in this context are semantically declared in the nearest enclosing non-transparent (opaque) context but are lexically declared in this context.
For example, consider the enumerators of an enumeration type:
Here, E is a transparent context, so its enumerator (Val1) will appear (semantically) that it is in the same context of E. Examples of transparent contexts include: enumerations (except for C++0x scoped enums), C++ linkage specifications and export declaration.
Definition at line 1415 of file DeclBase.cpp.
References clang::cast(), getDeclKind(), and clang::isa().
Referenced by clang::Sema::CheckClassTemplate(), clang::Sema::CheckFunctionConstraints(), clang::Sema::getNonFieldDeclScope(), getNonTransparentContext(), getRedeclContext(), getTagInjectionScope(), clang::IdentifierResolver::isDeclInScope(), clang::Sema::LookupName(), clang::NamedDecl::printNestedNameSpecifier(), and clang::Sema::PushOnScopeChains().
◆ LexicallyEncloses()
◆ localUncachedLookup()
◆ lookup()
lookup - Find the declarations (if any) with the given Name in this context.
Returns a range of iterators that contains all of the declarations with this name, with object, function, member, and enumerator names preceding any tag name. Note that this routine will not look into parent contexts.
Definition at line 1902 of file DeclBase.cpp.
References getDeclKind(), getParent(), getPrimaryContext(), and lookup().
Referenced by clang::Sema::AddOverriddenMethods(), clang::Sema::BuildBlockForLambdaConversion(), checkGlobalOrExternCConflict(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), clang::ASTReader::CompleteRedeclChain(), configureBlocksRuntimeObject(), clang::Sema::DeclareGlobalAllocationFunction(), clang::Sema::DiagRedefinedPlaceholderFieldDecl(), clang::CodeGen::CodeGenFunction::EmitBuiltinNewDeleteCall(), clang::CIRGen::CIRGenFunction::emitNewOrDeleteBuiltinCall(), FindFieldDeclInstantiationPattern(), clang::Sema::FindHiddenVirtualMethods(), findImplicitlyDeclaredEqualityComparisons(), clang::Sema::findInheritingConstructor(), clang::Sema::FindInstantiatedDecl(), findOrdinaryMember(), clang::ObjCPropertyDecl::findPropertyDecl(), findRecordDeclInContext(), clang::ASTContext::forEachMultiversionedFunctionVersion(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::Sema::getConstructorName(), clang::CXXMethodDecl::getCorrespondingMethodDeclaredInClass(), clang::CXXRecordDecl::getDestructor(), getGlobalStreamPointerByName(), clang::ObjCContainerDecl::getIvarDecl(), getLambdaCallOperatorHelper(), getLambdaStaticInvokers(), clang::ObjCContainerDecl::getMethod(), clang::ASTContext::getObjCMethodRedeclaration(), clang::ObjCContainerDecl::getProperty(), GetRuntimeFunctionDecl(), hasConflictingOverload(), clang::ObjCContainerDecl::HasUserDeclaredSetterMethod(), clang::Sema::InstantiateClassMembers(), clang::NamespaceDecl::isRedundantInlineQualifierFor(), clang::CXXMethodDecl::isUsualDeallocationFunction(), localUncachedLookup(), lookup(), lookupCXXRecordDecl(), LookupDirect(), clang::Sema::LookupQualifiedName(), clang::Sema::LookupSpecialMember(), LookupSpecialMemberFromXValue(), lookupStdNamespace(), lookupUnqualifiedTypeNameInBase(), clang::Sema::makeMergedDefinitionVisible(), clang::TreeTransform< AdjustConstraintDepth >::RebuildShuffleVectorExpr(), shouldAddReversedEqEq(), clang::Sema::tryLookupUnambiguousFieldDecl(), using_directives(), and clang::ASTDeclReader::VisitDecl().
◆ lookups()
| DeclContext::lookups_range clang::DeclContext::lookups ( ) const | inline |
|---|
◆ lookups_begin()
Iterators over all possible lookups within this context.
◆ lookups_end()
◆ makeDeclVisibleInContext()
| void DeclContext::makeDeclVisibleInContext | ( | NamedDecl * | D | ) |
|---|
Makes a declaration visible within this context.
This routine makes the declaration D visible to name lookup within this context and, if this is a transparent context, within its parent contexts up to the first enclosing non-transparent context. Making a declaration visible within a context does not transfer ownership of a declaration, and a declaration can be visible in many contexts that aren't its lexical context.
If D is a redeclaration of an existing declaration that is visible from this context, as determined by NamedDecl::declarationReplaces, the previous declaration will be replaced with D.
Definition at line 2100 of file DeclBase.cpp.
References DeclContext(), clang::Decl::getDeclContext(), and getPrimaryContext().
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::ActOnTag(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckClassTemplate(), clang::SemaObjC::CheckImplementationIvars(), clang::Sema::makeMergedDefinitionVisible(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
◆ noload_decls()
| decl_range clang::DeclContext::noload_decls ( ) const | inline |
|---|
◆ noload_decls_begin()
| decl_iterator clang::DeclContext::noload_decls_begin ( ) const | inline |
|---|
◆ noload_decls_end()
| decl_iterator clang::DeclContext::noload_decls_end ( ) const | inline |
|---|
◆ noload_lookup()
◆ noload_lookups()
| DeclContext::lookups_range clang::DeclContext::noload_lookups ( bool PreserveInternalState) const | inline |
|---|
◆ noload_lookups_begin()
Iterators over all possible lookups within this context that are currently loaded; don't attempt to retrieve anything from an external source.
◆ noload_lookups_end()
◆ removeDecl()
| void DeclContext::removeDecl | ( | Decl * | D | ) |
|---|
Removes a declaration from this context.
Definition at line 1735 of file DeclBase.cpp.
References clang::cast(), FirstDecl, clang::Decl::getDeclContext(), clang::Decl::getLexicalDeclContext(), clang::isa(), clang::StoredDeclsList::isNull(), LastDecl, clang::Decl::NextInContextAndBits, clang::StoredDeclsList::remove(), and shouldBeHidden().
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::HideUsingShadowDecl(), and clang::ASTNodeImporter::ImportDeclContext().
◆ setHasExternalLexicalStorage()
| void clang::DeclContext::setHasExternalLexicalStorage ( bool ES = true) const | inline |
|---|
◆ setHasExternalVisibleStorage()
| void clang::DeclContext::setHasExternalVisibleStorage ( bool ES = true) const | inline |
|---|
◆ setMustBuildLookupTable()
| void clang::DeclContext::setMustBuildLookupTable ( ) | inline |
|---|
Mark that there are external lexical declarations that we need to include in our lookup table (and that are not available as external visible lookups).
These extra lookup results will be found by walking the lexical declarations of this context. This should be used only if setHasExternalLexicalStorage() has been called on any decl context for which this is the primary context.
Definition at line 2673 of file DeclBase.h.
References DeclContextBits, and getPrimaryContext().
◆ setUseQualifiedLookup()
| void clang::DeclContext::setUseQualifiedLookup ( bool use = true) const | inline |
|---|
◆ shouldUseQualifiedLookup()
| bool clang::DeclContext::shouldUseQualifiedLookup ( ) const | inline |
|---|
◆ using_directives()
| DeclContext::udir_range DeclContext::using_directives | ( | ) | const |
|---|
◆ ASTDeclReader
◆ ASTDeclWriter
◆ ASTWriter
For hasNeedToReconcileExternalVisibleStorage, hasLazyLocalLexicalLookups, hasLazyExternalLexicalLookups.
Definition at line 1461 of file DeclBase.h.
References ASTWriter.
Referenced by ASTWriter.
◆ DependentDiagnostic
◆ ExternalASTSource
◆ [union]
This anonymous union stores the bits belonging to DeclContext and classes deriving from it.
The goal is to use otherwise wasted space in DeclContext to store data belonging to derived classes. The space saved is especially significient when pointers are aligned to 8 bytes. In this case due to alignment requirements we have a little less than 8 bytes free in DeclContext which we can use. We check that none of the classes in this union is larger than 8 bytes with static_asserts in the ctor of DeclContext.
◆ BlockDeclBits
Definition at line 2049 of file DeclBase.h.
Referenced by clang::BlockDecl::blockMissingReturnType(), clang::BlockDecl::canAvoidCopyToHeap(), clang::BlockDecl::capturesCXXThis(), clang::BlockDecl::doesNotEscape(), clang::BlockDecl::isConversionFromLambda(), clang::BlockDecl::isVariadic(), clang::BlockDecl::setBlockMissingReturnType(), clang::BlockDecl::setCanAvoidCopyToHeap(), clang::BlockDecl::setCapturesCXXThis(), clang::BlockDecl::setDoesNotEscape(), clang::BlockDecl::setIsConversionFromLambda(), and clang::BlockDecl::setIsVariadic().
◆ CXXConstructorDeclBits
◆ DeclContextBits
◆ EnumDeclBits
◆ FirstDecl
◆ FunctionDeclBits
Definition at line 2044 of file DeclBase.h.
Referenced by clang::FunctionDecl::BodyContainsImmediateEscalatingExpressions(), clang::FunctionDecl::doesThisDeclarationHaveABody(), clang::FunctionDecl::FriendConstraintRefersToEnclosingTemplate(), clang::FunctionDecl::FunctionDecl(), clang::FunctionDecl::getConstexprKind(), clang::CXXDeductionGuideDecl::getDeductionCandidateKind(), clang::FunctionDecl::getDefaultedOrDeletedInfo(), clang::FunctionDecl::getDeletedMessage(), clang::FunctionDecl::getStorageClass(), clang::FunctionDecl::hasImplicitReturnZero(), clang::FunctionDecl::hasInheritedPrototype(), clang::FunctionDecl::hasSkippedBody(), clang::FunctionDecl::hasWrittenPrototype(), clang::FunctionDecl::instantiationIsPending(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::FunctionDecl::isDeletedAsWritten(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::FunctionDecl::isIneligibleOrNotSelected(), clang::FunctionDecl::isInlined(), clang::FunctionDecl::isInlineSpecified(), clang::FunctionDecl::isInstantiatedFromMemberTemplate(), clang::FunctionDecl::isLateTemplateParsed(), clang::FunctionDecl::isMultiVersion(), clang::FunctionDecl::isPureVirtual(), clang::FunctionDecl::isTrivial(), clang::FunctionDecl::isTrivialForCall(), clang::FunctionDecl::isVirtualAsWritten(), clang::FunctionDecl::setBody(), clang::FunctionDecl::setBodyContainsImmediateEscalatingExpressions(), clang::FunctionDecl::setConstexprKind(), clang::CXXDeductionGuideDecl::setDeductionCandidateKind(), clang::FunctionDecl::setDefaulted(), clang::FunctionDecl::setDefaultedOrDeletedInfo(), clang::FunctionDecl::setDeletedAsWritten(), clang::FunctionDecl::setExplicitlyDefaulted(), clang::FunctionDecl::setFriendConstraintRefersToEnclosingTemplate(), clang::FunctionDecl::setHasImplicitReturnZero(), clang::FunctionDecl::setHasInheritedPrototype(), clang::FunctionDecl::setHasSkippedBody(), clang::FunctionDecl::setHasWrittenPrototype(), clang::FunctionDecl::setImplicitlyInline(), clang::FunctionDecl::setIneligibleOrNotSelected(), clang::FunctionDecl::setInlineSpecified(), clang::FunctionDecl::setInstantiatedFromMemberTemplate(), clang::FunctionDecl::setInstantiationIsPending(), clang::FunctionDecl::setIsMultiVersion(), clang::FunctionDecl::setIsPureVirtual(), clang::FunctionDecl::setLateTemplateParsed(), clang::FunctionDecl::setLazyBody(), clang::FunctionDecl::setStorageClass(), clang::FunctionDecl::setTrivial(), clang::FunctionDecl::setTrivialForCall(), clang::FunctionDecl::setUsesFPIntrin(), clang::FunctionDecl::setUsesSEHTry(), clang::FunctionDecl::setVirtualAsWritten(), clang::FunctionDecl::setWillHaveBody(), clang::FunctionDecl::UsesFPIntrin(), clang::FunctionDecl::usesSEHTry(), and clang::FunctionDecl::willHaveBody().
◆ LastDecl
◆ LinkageSpecDeclBits
◆ LookupPtr
◆ NamespaceDeclBits
◆ ObjCContainerDeclBits
◆ ObjCMethodDeclBits
Definition at line 2046 of file DeclBase.h.
Referenced by clang::ObjCMethodDecl::getImplementationControl(), clang::ObjCMethodDecl::getMethodFamily(), clang::ObjCMethodDecl::getObjCDeclQualifier(), clang::ObjCMethodDecl::hasRedeclaration(), clang::ObjCMethodDecl::hasRelatedResultType(), clang::ObjCMethodDecl::hasSkippedBody(), clang::ObjCMethodDecl::isDefined(), clang::ObjCMethodDecl::isInstanceMethod(), clang::ObjCMethodDecl::isOverriding(), clang::ObjCMethodDecl::isPropertyAccessor(), clang::ObjCMethodDecl::isRedeclaration(), clang::ObjCMethodDecl::isSynthesizedAccessorStub(), clang::ObjCMethodDecl::isVariadic(), clang::ObjCMethodDecl::setDeclImplementation(), clang::ObjCMethodDecl::setDefined(), clang::ObjCMethodDecl::setHasRedeclaration(), clang::ObjCMethodDecl::setHasSkippedBody(), clang::ObjCMethodDecl::setInstanceMethod(), clang::ObjCMethodDecl::setIsRedeclaration(), clang::ObjCMethodDecl::setObjCDeclQualifier(), clang::ObjCMethodDecl::setOverriding(), clang::ObjCMethodDecl::setPropertyAccessor(), clang::ObjCMethodDecl::setRelatedResultType(), clang::ObjCMethodDecl::setSynthesizedAccessorStub(), and clang::ObjCMethodDecl::setVariadic().
◆ OMPDeclareReductionDeclBits
◆ RecordDeclBits
Definition at line 2042 of file DeclBase.h.
Referenced by clang::RecordDecl::getArgPassingRestrictions(), clang::RecordDecl::getODRHash(), clang::RecordDecl::hasFlexibleArrayMember(), clang::RecordDecl::hasLoadedFieldsFromExternalStorage(), clang::RecordDecl::hasNonTrivialToPrimitiveCopyCUnion(), clang::RecordDecl::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::RecordDecl::hasNonTrivialToPrimitiveDestructCUnion(), clang::RecordDecl::hasObjectMember(), clang::RecordDecl::hasUninitializedExplicitInitFields(), clang::RecordDecl::hasVolatileMember(), clang::RecordDecl::isAnonymousStructOrUnion(), clang::RecordDecl::isNonTrivialToPrimitiveCopy(), clang::RecordDecl::isNonTrivialToPrimitiveDefaultInitialize(), clang::RecordDecl::isNonTrivialToPrimitiveDestroy(), clang::RecordDecl::isParamDestroyedInCallee(), clang::RecordDecl::isRandomized(), clang::RecordDecl::setAnonymousStructOrUnion(), clang::RecordDecl::setArgPassingRestrictions(), clang::RecordDecl::setHasFlexibleArrayMember(), clang::RecordDecl::setHasLoadedFieldsFromExternalStorage(), clang::RecordDecl::setHasNonTrivialToPrimitiveCopyCUnion(), clang::RecordDecl::setHasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::RecordDecl::setHasNonTrivialToPrimitiveDestructCUnion(), clang::RecordDecl::setHasObjectMember(), clang::RecordDecl::setHasUninitializedExplicitInitFields(), clang::RecordDecl::setHasVolatileMember(), clang::RecordDecl::setIsRandomized(), clang::RecordDecl::setNonTrivialToPrimitiveCopy(), clang::RecordDecl::setNonTrivialToPrimitiveDefaultInitialize(), clang::RecordDecl::setNonTrivialToPrimitiveDestroy(), and clang::RecordDecl::setParamDestroyedInCallee().
◆ TagDeclBits
Definition at line 2040 of file DeclBase.h.
Referenced by clang::TagDecl::demoteThisDefinitionToDeclaration(), clang::TagDecl::getTagKind(), clang::TagDecl::isBeingDefined(), clang::TagDecl::isCompleteDefinition(), clang::TagDecl::isCompleteDefinitionRequired(), clang::TagDecl::isEmbeddedInDeclarator(), clang::TagDecl::isFreeStanding(), clang::TagDecl::isThisDeclarationADemotedDefinition(), clang::TagDecl::setBeingDefined(), clang::TagDecl::setCompleteDefinition(), clang::TagDecl::setCompleteDefinitionRequired(), clang::TagDecl::setEmbeddedInDeclarator(), clang::TagDecl::setFreeStanding(), clang::TagDecl::setTagKind(), and clang::TagDecl::TagDecl().
The documentation for this class was generated from the following files:
- include/clang/AST/DeclBase.h
- include/clang/AST/DeclLookups.h
- include/clang/AST/DependentDiagnostic.h
- lib/AST/ASTDumper.cpp
- lib/AST/DeclBase.cpp
- lib/AST/DeclPrinter.cpp