clang 17.0.0git
|
DeclContext - This is used only as base class of specific decl types that can act as declaration contexts. More...
#include "clang/AST/DeclBase.h"
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 | 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 | filtered_decl_iterator |
Iterates over a filtered subrange of declarations stored in a DeclContext. 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... | |
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 = llvm::iterator_adaptor_base< udir_iterator, lookup_iterator, typename lookup_iterator::iterator_category, UsingDirectiveDecl * > |
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 | 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 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 |
Static Public Member Functions | |
static bool | classof (const Decl *D) |
static bool | classof (const DeclContext *D) |
Protected Member Functions | |
DeclContext (Decl::Kind K) | |
Static Protected Member Functions | |
static std::pair< Decl *, Decl * > | BuildDeclChain (ArrayRef< Decl * > Decls, bool FieldsAlreadyLoaded) |
Build up a chain of declarations. | |
Protected Attributes | |
union { | |
DeclContextBitfields DeclContextBits | |
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 1402 of file DeclBase.h.
using clang::DeclContext::ddiag_range = llvm::iterator_range<DeclContext::ddiag_iterator> |
Definition at line 2485 of file DeclBase.h.
using clang::DeclContext::decl_range = llvm::iterator_range<decl_iterator> |
Definition at line 2193 of file DeclBase.h.
Definition at line 2402 of file DeclBase.h.
Definition at line 2401 of file DeclBase.h.
using clang::DeclContext::lookups_range = llvm::iterator_range<all_lookups_iterator> |
Definition at line 2448 of file DeclBase.h.
using clang::DeclContext::udir_iterator_base = llvm::iterator_adaptor_base<udir_iterator, lookup_iterator, typename lookup_iterator::iterator_category, UsingDirectiveDecl *> |
Definition at line 2467 of file DeclBase.h.
using clang::DeclContext::udir_range = llvm::iterator_range<udir_iterator> |
Definition at line 2478 of file DeclBase.h.
|
protected |
Definition at line 1124 of file DeclBase.cpp.
References DeclContextBits, setHasExternalLexicalStorage(), setHasExternalVisibleStorage(), and setUseQualifiedLookup().
|
default |
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 1642 of file DeclBase.cpp.
References addHiddenDecl().
Referenced by clang::Sema::ActOnBlockStart(), clang::Sema::ActOnCapturedRegionStart(), clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnEmptyDeclaration(), clang::Sema::ActOnExceptionDeclarator(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFileScopeAsmDecl(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFriendTypeDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnModuleDecl(), clang::Sema::ActOnModuleImport(), clang::Sema::ActOnOMPIteratorExpr(), clang::Sema::ActOnOpenMPAllocateDirective(), clang::Sema::ActOnOpenMPDeclareMapperDirective(), clang::Sema::ActOnOpenMPDeclareReductionDirectiveStart(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPRequiresDirective(), clang::Sema::ActOnOpenMPThreadprivateDirective(), clang::Sema::ActOnOpenMPUseDevicePtrClause(), clang::Sema::ActOnPragmaDetectMismatch(), clang::Sema::ActOnPragmaMSComment(), clang::Sema::ActOnPropertyImplDecl(), clang::Sema::ActOnStartCategoryImplementation(), clang::Sema::ActOnStartCategoryInterface(), clang::Sema::ActOnStartExportDecl(), clang::Sema::ActOnStartLinkageSpecification(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnTag(), clang::Sema::ActOnTemplatedFriendTag(), clang::Sema::ActOnTopLevelStmtDecl(), clang::Sema::ActOnVarTemplateSpecialization(), clang::ObjCImplDecl::addClassMethod(), addFieldToRecordDecl(), clang::ObjCImplDecl::addInstanceMethod(), clang::ObjCImplDecl::addPropertyImplementation(), clang::Sema::BuildAnonymousStructOrUnion(), clang::ASTContext::buildBuiltinTemplateDecl(), clang::Sema::BuildCaptureField(), clang::Sema::BuildMicrosoftCAnonymousStruct(), clang::Sema::BuildModuleInclude(), clang::Sema::BuildStaticAssertDeclaration(), clang::Sema::BuildUsingDeclaration(), clang::Sema::BuildUsingEnumDeclaration(), clang::Sema::BuildUsingPackDecl(), clang::Sema::BuildUsingShadowDecl(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckImplementationIvars(), clang::CodeGen::CGOpenMPRuntimeGPU::clear(), clang::Sema::CompleteLambdaCallOperator(), CreateAAPCSABIBuiltinVaListDecl(), CreateAArch64ABIBuiltinVaListDecl(), clang::Sema::CreateCapturedStmtRecordDecl(), CreateHexagonBuiltinVaListDecl(), clang::Sema::createImplicitModuleImportForErrorRecovery(), clang::Sema::createLambdaClosureType(), CreatePowerABIBuiltinVaListDecl(), clang::Sema::CreatePropertyDecl(), CreateSystemZBuiltinVaListDecl(), CreateX86_64ABIBuiltinVaListDecl(), clang::Sema::DeclareGlobalAllocationFunction(), 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::ASTContext::getCFConstantStringDecl(), clang::CodeGen::CodeGenModule::getObjCFastEnumerationStateType(), clang::ASTContext::getObjCSuperType(), clang::Sema::getOrCreateStdNamespace(), clang::ASTContext::InitBuiltinTypes(), clang::HLSLExternalSemaSource::InitializeSema(), clang::Sema::ProcessPropertyDecl(), clang::Sema::PushOnScopeChains(), clang::Sema::PushUsingDirective(), clang::TreeTransform< Derived >::RebuildExceptionDecl(), clang::Sema::SubstSpaceshipAsEqualEqual(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
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 1650 of file DeclBase.cpp.
References addHiddenDecl().
Referenced by clang::ASTNodeImporter::ImportDeclContext(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitEmptyDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitFunctionTemplateDecl(), 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::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(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
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 1616 of file DeclBase.cpp.
References clang::ASTContext::addedLocalImportDecl(), FirstDecl, clang::Decl::getASTContext(), clang::Decl::getLexicalDeclContext(), clang::Decl::getNextDeclInContext(), clang::Decl::isFromASTFile(), LastDecl, and clang::Decl::NextInContextAndBits.
Referenced by clang::Sema::ActOnAccessSpecifier(), clang::Sema::ActOnDecompositionDeclarator(), addDecl(), addDeclInternal(), buildCaptureDecl(), clang::Sema::BuildVariableInstantiation(), and FinishForRangeVarDecl().
|
staticprotected |
Build up a chain of declarations.
Definition at line 1399 of file DeclBase.cpp.
References clang::Decl::NextInContextAndBits.
Referenced by clang::RecordDecl::reorderDecls().
StoredDeclsMap * DeclContext::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 1665 of file DeclBase.cpp.
References collectAllContexts(), getPrimaryContext(), and hasExternalVisibleStorage().
Definition at line 1134 of file DeclBase.cpp.
References clang::Decl::getKind().
|
inlinestatic |
Definition at line 2552 of file DeclBase.h.
void DeclContext::collectAllContexts | ( | SmallVectorImpl< DeclContext * > & | Contexts | ) |
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:
The Contexts
parameter will contain both definitions of N.
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 1385 of file DeclBase.cpp.
References collectAllContextsImpl(), and getDeclKind().
Referenced by buildLookup().
Checks whether a declaration is in this context.
Definition at line 1511 of file DeclBase.cpp.
References clang::Decl::getLexicalDeclContext(), LastDecl, and clang::Decl::NextInContextAndBits.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::CheckUnaryExprOrTypeTraitOperand(), containsDeclAndLoad(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::DiagnoseUseOfDecl(), clang::ChildErrorHandlingStrategy::ignoreChildErrorOnParent(), and clang::ASTNodeImporter::ImportDeclContext().
Checks whether a declaration is in this context.
This also loads the Decls from the external source before the check.
Definition at line 1516 of file DeclBase.cpp.
References containsDecl(), and hasExternalLexicalStorage().
|
inline |
Definition at line 175 of file DependentDiagnostic.h.
References getLookupPtr(), getPrimaryContext(), and isDependentContext().
Referenced by clang::Sema::PerformDependentDiagnostics().
|
inline |
decls_begin/decls_end - Iterate over the declarations stored in this context.
Definition at line 2197 of file DeclBase.h.
References decls_begin(), and decls_end().
Referenced by clang::Sema::ActOnOpenMPAssumesDirective(), clang::Sema::ActOnStartOfFunctionDef(), AddInterfaceResults(), clang::CallGraph::addNodesForBlocks(), clang::ODRHash::AddObjCInterfaceDecl(), AddProtocolResults(), CheckAbstractClassUsage(), checkExportedDeclContext(), clang::Sema::CodeCompleteObjCInterfaceCategory(), diagnoseBadDirectAccess(), clang::Sema::DiagnoseUnusedNestedTypedefs(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::dumpDeclContext(), clang::CodeGen::CodeGenModule::EmitTopLevelDecl(), clang::ASTMergeAction::ExecuteAction(), getNonCLikeKindForAnonymousStruct(), GroupNewVirtualOverloads(), handleBPFPreserveAIRecord(), clang::ASTNodeImporter::ImportDeclContext(), clang::index::IndexingContext::indexDeclContext(), InjectAnonymousStructOrUnionMembers(), clang::Sema::InstantiateClass(), clang::Sema::InstantiateClassMembers(), clang::serialization::numberAnonymousDeclsWithin(), clang::randstruct::randomizeStructureLayout(), and clang::Sema::SetCtorInitializers().
DeclContext::decl_iterator DeclContext::decls_begin | ( | ) | const |
Definition at line 1498 of file DeclBase.cpp.
References FirstDecl, and hasExternalLexicalStorage().
Referenced by clang::ObjCContainerDecl::classmeth_begin(), clang::ObjCContainerDecl::classprop_begin(), cleanupDeallocOrFinalize(), clang::Sema::CodeCompleteNamespaceDecl(), clang::CXXRecordDecl::ctor_begin(), decls(), clang::EnumDecl::enumerator_begin(), clang::Sema::FindInstantiatedDecl(), findUserDeclaredCtor(), GCRewriteFinalize(), 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().
bool DeclContext::decls_empty | ( | ) | const |
Definition at line 1504 of file DeclBase.cpp.
References FirstDecl, and hasExternalLexicalStorage().
Referenced by clang::ExportDecl::getEndLoc(), and clang::LinkageSpecDecl::getEndLoc().
|
inline |
Definition at line 2199 of file DeclBase.h.
Referenced by clang::ObjCContainerDecl::classmeth_end(), clang::ObjCContainerDecl::classprop_end(), cleanupDeallocOrFinalize(), clang::Sema::CodeCompleteNamespaceDecl(), clang::CXXRecordDecl::ctor_end(), decls(), clang::EnumDecl::enumerator_end(), clang::Sema::FindInstantiatedDecl(), findUserDeclaredCtor(), GCRewriteFinalize(), 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().
LLVM_DUMP_METHOD void DeclContext::dumpAsDecl | ( | ) | const |
LLVM_DUMP_METHOD void DeclContext::dumpAsDecl | ( | const ASTContext * | Ctx | ) | const |
Definition at line 235 of file ASTDumper.cpp.
References clang::ASTContext::getDiagnostics(), clang::DiagnosticsEngine::getShowColors(), hasValidDeclKind(), and P.
LLVM_DUMP_METHOD void DeclContext::dumpDeclContext | ( | ) | const |
Definition at line 220 of file DeclPrinter.cpp.
References getParent(), clang::ASTContext::getPrintingPolicy(), and isTranslationUnit().
LLVM_DUMP_METHOD void DeclContext::dumpLookups | ( | ) | const |
Definition at line 256 of file ASTDumper.cpp.
References dumpLookups().
Referenced by dumpLookups().
void clang::DeclContext::dumpLookups | ( | llvm::raw_ostream & | OS, |
bool | DumpDecls = false , |
||
bool | Deserialize = false |
||
) | const |
bool DeclContext::Encloses | ( | const DeclContext * | DC | ) | const |
Determine whether this declaration context encloses the declaration context DC.
Definition at line 1279 of file DeclBase.cpp.
References Encloses(), getParent(), and getPrimaryContext().
Referenced by clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::CheckClassTemplate(), CheckExplicitInstantiationScope(), clang::Sema::CheckShadow(), CheckTemplateSpecializationScope(), diagnoseInstanceReference(), clang::Sema::diagnoseQualifiedDeclaration(), DoMarkPotentialCapture(), Encloses(), getRequiredQualification(), isAcceptableTagRedeclContext(), clang::Sema::PushOnScopeChains(), and clang::Sema::tryCaptureOpenMPLambdas().
|
inline |
Determine whether this declaration context is equivalent to the declaration context DC.
Definition at line 2066 of file DeclBase.h.
References getPrimaryContext().
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnTag(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckShadow(), CheckTemplateSpecializationScope(), clang::Sema::DiagnoseDependentMemberLookup(), diagnoseInstanceReference(), clang::Sema::diagnoseQualifiedDeclaration(), clang::Sema::FindInstantiatedDecl(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), InEnclosingNamespaceSetOf(), isAcceptableTagRedeclContext(), clang::CXXRecordDecl::isCurrentInstantiation(), clang::IdentifierResolver::isDeclInScope(), clang::Decl::isOutOfLine(), isOutOfScopePreviousDeclaration(), clang::Sema::IsOverload(), clang::Sema::LookupName(), MaybeAddOverrideCalls(), and clang::Sema::tryCaptureVariable().
|
inline |
Definition at line 1935 of file DeclBase.h.
References DeclContextBits.
Referenced by clang::Sema::ActOnTag(), clang::Decl::castFromDeclContext(), collectAllContexts(), DiagnoseFailedExplicitSpec(), clang::ASTDumper::dumpInvalidDeclContext(), getDeclKindName(), clang::serialization::getDefinitiveDeclContext(), getExternCContext(), getKind(), clang::Sema::getObjCContainerKind(), getOutermostFuncOrBlockContext(), getPrimaryContext(), getRedeclContext(), hasValidDeclKind(), isClosure(), isFileContext(), isFunctionOrMethod(), clang::VarDecl::isFunctionOrMethodVarDecl(), isLinkageSpecContext(), isLookupContext(), isNamespace(), isObjCContainer(), isRecord(), IsRecordContextStructurallyEquivalent(), IsStructurallyEquivalent(), isTranslationUnit(), isTransparentContext(), IsUsingDirectiveInToplevelContext(), lookup(), noload_lookup(), clang::tooling::stdlib::Recognizer::operator()(), and shouldConsiderLinkage().
const char * DeclContext::getDeclKindName | ( | ) | const |
Definition at line 165 of file DeclBase.cpp.
References getDeclKind().
DeclContext * DeclContext::getEnclosingNamespaceContext | ( | ) |
Retrieve the nearest enclosing namespace context.
Definition at line 1882 of file DeclBase.cpp.
References getParent(), getPrimaryContext(), and isFileContext().
Referenced by clang::Sema::ActOnTag(), CheckExplicitInstantiationScope(), getEnclosingNamespaceContext(), clang::Sema::HandleDeclarator(), isDefinedInClangModule(), clang::AnalysisDeclContext::isInStdNamespace(), isOutOfScopePreviousDeclaration(), and shouldAddReversedEqEq().
|
inline |
Definition at line 2109 of file DeclBase.h.
References getEnclosingNamespaceContext().
const LinkageSpecDecl * DeclContext::getExternCContext | ( | ) | const |
Retrieve the nearest enclosing C linkage specification context.
Definition at line 1264 of file DeclBase.cpp.
References getDeclKind(), getLexicalParent(), and clang::LinkageSpecDecl::lang_c.
Referenced by clang::Sema::CheckLiteralOperatorDeclaration(), and clang::Sema::CheckTemplateDeclScope().
const BlockDecl * DeclContext::getInnermostBlockDecl | ( | ) | const |
Return this DeclContext if it is a BlockDecl.
Otherwise, return the innermost enclosing BlockDecl or null if there are no enclosing blocks.
Definition at line 1176 of file DeclBase.cpp.
References getParent(), and isClosure().
Referenced by clang::Sema::BuildIvarRefExpr(), and diagnoseImplicitlyRetainedSelf().
|
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 1958 of file DeclBase.h.
Referenced by clang::Sema::ActOnExitFunctionContext(), clang::Sema::ActOnFinishRequiresExpr(), clang::Sema::ActOnModuleBegin(), clang::Sema::ActOnModuleEnd(), clang::Sema::ActOnObjCContainerStartDefinition(), clang::Sema::ActOnOpenMPAssumesDirective(), clang::Sema::ActOnReenterFunctionContext(), clang::Sema::ActOnStartExportDecl(), clang::ODRHash::AddFunctionDecl(), basicGVALinkageForVariable(), clang::Sema::CheckShadow(), ComputeDefaultedComparisonExceptionSpec(), clang::Sema::getCurrentMangleNumberContext(), getEnclosingExportDecl(), getExternCContext(), getLexicalParent(), getLookupParent(), getOuterLexicalRecordContext(), clang::Sema::inferCUDATargetForImplicitSpecialMember(), isDependentContext(), clang::Decl::isInExportDeclContext(), isInInlineFunction(), clang::Decl::isInLocalScopeForInstantiation(), isLinkageSpecContext(), clang::Sema::PopDeclContext(), and clang::Sema::PushDeclContext().
|
inline |
Definition at line 1961 of file DeclBase.h.
References getLexicalParent().
DeclContext * DeclContext::getLookupParent | ( | ) |
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 1160 of file DeclBase.cpp.
References getLexicalParent(), getParent(), getRedeclContext(), isFileContext(), clang::isLambdaCallOperator(), and isRecord().
Referenced by clang::Sema::ActOnTagStartSkippedDefinition(), AddTopLevelDeclarationToHash(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckTemplateIdType(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::EnterTemplatedContext(), findRecordWithDependentBasesOfEnclosingMethod(), getLookupParent(), and synthesizeCurrentNestedNameSpecifier().
|
inline |
Definition at line 1967 of file DeclBase.h.
References getLookupParent().
|
inline |
Retrieve the internal representation of the lookup structure.
This may omit some names if we are lazily building the structure.
Definition at line 2505 of file DeclBase.h.
Referenced by clang::IncrementalParser::CleanUpPTU(), ddiags(), and noload_lookups().
Decl * DeclContext::getNonClosureAncestor | ( | ) |
Find the nearest non-closure ancestor of this context, i.e.
the innermost semantic parent of this context which is not a closure. A context may be its own non-closure ancestor.
Definition at line 1116 of file DeclBase.cpp.
Referenced by getNonClosureAncestor(), clang::Sema::isSelfExpr(), and LookupMethodInReceiverType().
|
inline |
Definition at line 2078 of file DeclBase.h.
References getNonClosureAncestor().
DeclContext * DeclContext::getNonTransparentContext | ( | ) |
Definition at line 1290 of file DeclBase.cpp.
References getParent(), and isTransparentContext().
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::CheckFunctionConstraints(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckRedeclarationExported(), getNonTransparentContext(), clang::Decl::getNonTransparentDeclContext(), IsRecordContextStructurallyEquivalent(), and clang::NamespaceDecl::isRedundantInlineQualifierFor().
|
inline |
Definition at line 2084 of file DeclBase.h.
References getNonTransparentContext().
RecordDecl * DeclContext::getOuterLexicalRecordContext | ( | ) |
Retrieve the outermost lexically enclosing record context.
Definition at line 1890 of file DeclBase.cpp.
References getLexicalParent(), and isRecord().
Referenced by clang::Sema::BuildCXXDefaultInitExpr(), getOuterLexicalRecordContext(), and clang::Sema::InstantiateInClassInitializer().
|
inline |
Definition at line 2115 of file DeclBase.h.
References getOuterLexicalRecordContext().
|
inline |
getParent - Returns the containing DeclContext.
Definition at line 1942 of file DeclBase.h.
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::BuildCXXNestedNameSpecifier(), clang::Sema::BuildUsingDeclaration(), calculateOffset(), clang::Sema::CheckAddressOfOperand(), checkAttrArgsAreCapabilityObjs(), checkAttributesAfterMerging(), clang::Sema::CheckCompareOperands(), CheckConstexprFunction(), clang::Sema::CheckConstructorAccess(), clang::Sema::CheckFunctionConstraints(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), checkModuleImportContext(), clang::Sema::CheckParmsForFunctionDef(), clang::Sema::CheckShadow(), CheckSimplerImplicitMovesMSVCWorkaround(), clang::Sema::CheckUsingShadowDecl(), ClassifyImplicitMemberAccess(), CollectEnclosingNamespace(), clang::PredefinedExpr::ComputeName(), ConvertDeducedTemplateArguments(), clang::Sema::CreateCapturedStmtRecordDecl(), createFriendTagNNSFixIt(), clang::Sema::createLambdaClosureType(), clang::ASTContext::DeclMustBeEmitted(), clang::Sema::DeduceReturnType(), diagnoseBadDirectAccess(), clang::Sema::DiagnoseDependentMemberLookup(), diagnoseImplicitlyRetainedSelf(), clang::Sema::diagnoseQualifiedDeclaration(), DiagnoseTwoPhaseLookup(), diagnoseUncapturableValueReferenceOrBinding(), dumpDeclContext(), EmitObjectDelete(), Encloses(), enclosingClassIsRelatedToClassInWhichMembersWereFound(), clang::ento::LikelyFalsePositiveSuppressionBRVisitor::finalizeVisitor(), clang::Sema::FindInstantiatedDecl(), clang::ObjCMethodDecl::findPropertyDecl(), findRecordWithDependentBasesOfEnclosingMethod(), getBaseAlignmentAndOffsetFromLValue(), getBestNamespaceSubstr(), clang::BodyFarm::getBody(), clang::Sema::getCurMethodDecl(), clang::Sema::getCurrentMangleNumberContext(), getEnclosingNamespaceContext(), clang::Sema::getFunctionLevelDeclContext(), getInnermostBlockDecl(), getInnerPointerType(), clang::getLambdaAwareParentOfDeclContext(), getLookupParent(), clang::MicrosoftVTableContext::getMethodVFTableLocation(), clang::ItaniumVTableContext::getMethodVTableIndex(), getName(), getNonTransparentContext(), getNullabilityCompletenessCheckFileID(), getOutermostFuncOrBlockContext(), getParent(), clang::CXXMethodDecl::getParent(), clang::CodeCompletionTUInfo::getParentName(), getRedeclContext(), clang::AnalysisDeclContext::getSelfDecl(), getTagInjectionContext(), clang::CodeGen::CGCXXABI::getThisArgumentTypeForMethod(), clang::Decl::getTranslationUnitDecl(), handleGslAnnotatedTypes(), handleIBOutletCollection(), clang::Sema::handleTagNumbering(), InEnclosingNamespaceSetOf(), clang::Sema::InstantiateFunctionDeclaration(), clang::Sema::InstantiateMemInitializers(), isAncestorDeclContextOf(), clang::ento::isCapturedByReference(), clang::CXXRecordDecl::isCurrentInstantiation(), isDeclContextInNamespace(), IsDeclSourceLocationCurrent(), isDependentContext(), clang::isGenericLambdaCallOperatorOrStaticInvokerSpecialization(), clang::FunctionDecl::isGlobal(), clang::Decl::isInAnonymousNamespace(), clang::Sema::IsInsideALocalClassWithinATemplateFunction(), clang::Sema::isOpenMPCapturedDecl(), IsRecordContextStructurallyEquivalent(), clang::NamespaceDecl::isRedundantInlineQualifierFor(), isReferenceToNonConstCapture(), isStdNamespace(), clang::dataflow::isTopLevelNamespaceWithName(), IsUsingDirectiveInToplevelContext(), lookup(), clang::MangleContext::mangleBlock(), MaybeAddOverrideCalls(), clang::tooling::stdlib::Recognizer::operator()(), clang::CodeGen::CGRecordLayout::print(), clang::NamedDecl::printNestedNameSpecifier(), recoverFromMSUnqualifiedLookup(), recoverFromTypeInKnownDependentBase(), rewriteBuiltinFunctionDecl(), shouldSkipNotingLambdaConversionDecl(), clang::Sema::SubstituteExplicitTemplateArguments(), clang::Sema::tryCaptureVariable(), tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs(), clang::FunctionCallFilterCCC::ValidateCandidate(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), clang::interp::ByteCodeStmtGen< Emitter >::visitFunc(), clang::TextNodeDumper::VisitFunctionDecl(), clang::interp::ByteCodeExprGen< Emitter >::VisitMemberExpr(), and clang::ASTDeclWriter::VisitNamespaceDecl().
|
inline |
Definition at line 1945 of file DeclBase.h.
References getParent().
|
inline |
Definition at line 1971 of file DeclBase.h.
Referenced by disambiguateSpellingInScope(), findVar(), clang::CXXRecordDecl::getLambdaContextDecl(), clang::Type::getObjCSubstitutions(), getRedeclContext(), lookup(), lookups(), clang::ExternalASTSource::SetExternalVisibleDeclsForName(), clang::ExternalASTSource::SetNoExternalVisibleDeclsForName(), clang::QualType::substObjCMemberType(), and clang::FunctionCallFilterCCC::ValidateCandidate().
DeclContext * 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.
This routine returns the "primary" DeclContext structure, which will contain the information needed to perform name lookup into this context.
Definition at line 1299 of file DeclBase.cpp.
References getDeclKind(), clang::TagDecl::getDefinition(), and clang::TagDecl::isBeingDefined().
Referenced by clang::ASTImporterLookupTable::add(), buildLookup(), clang::IncrementalParser::CleanUpPTU(), CollectEnclosingNamespace(), ddiags(), clang::ASTImporterLookupTable::dump(), clang::ASTDumper::dumpLookups(), Encloses(), Equals(), clang::ASTReader::FindExternalVisibleDeclsByName(), findRecordWithDependentBasesOfEnclosingMethod(), getEnclosingNamespaceContext(), getPrimaryContext(), clang::Sema::getScopeForContext(), clang::Sema::getScopeForDeclContext(), lookup(), clang::ASTImporterLookupTable::lookup(), clang::LookupNamed(), lookups(), makeDeclVisibleInContext(), MightInstantiateTo(), noload_lookup(), noload_lookups(), clang::ASTImporterLookupTable::remove(), setMustBuildLookupTable(), synthesizeCurrentNestedNameSpecifier(), and clang::ASTDeclWriter::VisitNamespaceDecl().
|
inline |
Definition at line 2095 of file DeclBase.h.
References getPrimaryContext().
DeclContext * 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.
This skips through transparent contexts.
Definition at line 1864 of file DeclBase.cpp.
References getDeclKind(), clang::ASTContext::getLangOpts(), getParent(), getParentASTContext(), isRecord(), and isTransparentContext().
Referenced by clang::Sema::ActOnConceptDefinition(), clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnPragmaFloatControl(), clang::Sema::ActOnPragmaMSAllocText(), clang::Sema::ActOnPragmaMSFunction(), clang::Sema::ActOnPragmaMSOptimize(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnTag(), clang::Sema::ActOnTypedefNameDecl(), clang::Sema::ActOnVariableDeclarator(), clang::ASTImporterLookupTable::add(), adjustDeclContextForDeclaratorDecl(), clang::CodeGen::CodeGenModule::AlwaysHasLTOVisibilityPublic(), clang::Sema::BuildAnonymousStructOrUnion(), clang::Sema::BuildUsingEnumDeclaration(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), CheckExplicitInstantiationScope(), clang::Sema::CheckFunctionTemplateSpecialization(), CheckMultiVersionFunction(), clang::Sema::CheckObjCDeclScope(), CheckOperatorNewDeleteDeclarationScope(), clang::Sema::CheckShadow(), clang::Sema::CheckTemplateDeclScope(), CheckTemplateSpecializationScope(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::CheckUsingDeclRedeclaration(), 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(), clang::Sema::HandleDeclarator(), handleWeakRefAttr(), isAcceptableTagRedeclContext(), clang::ento::CheckerContext::isCLibraryFunction(), clang::NamedDecl::isCXXClassMember(), clang::IdentifierResolver::isDeclInScope(), clang::VarDecl::isFunctionOrMethodVarDecl(), clang::FunctionDecl::isMain(), clang::FunctionDecl::isMSVCRTEntryPoint(), isOutOfScopePreviousDeclaration(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::NamedDecl::isReserved(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), clang::ASTContext::isSameEntity(), isStdNamespace(), clang::Sema::LookupName(), clang::Sema::PushOnScopeChains(), clang::Sema::RegisterLocallyScopedExternCDecl(), clang::ASTImporterLookupTable::remove(), shouldConsiderLinkage(), clang::Sema::ShouldEnterDeclaratorScope(), ShouldWarnAboutMissingPrototype(), clang::IdentifierResolver::tryAddTopLevelDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::ASTDeclWriter::VisitNamespaceDecl().
|
inline |
Definition at line 2103 of file DeclBase.h.
References getRedeclContext().
|
inline |
Whether this DeclContext has external storage containing additional declarations that are lexically in this context.
Definition at line 2512 of file DeclBase.h.
References DeclContextBits.
Referenced by clang::ExternalASTMerger::CanComplete(), clang::ExternalASTMerger::CompleteType(), containsDeclAndLoad(), clang::ClassTemplateSpecializationDecl::Create(), decls_begin(), decls_empty(), clang::RecordDecl::field_begin(), clang::ASTContext::getASTRecordLayout(), clang::HLSLExternalSemaSource::InitializeSema(), IsStructurallyEquivalent(), localUncachedLookup(), and clang::ASTNodeImporter::VisitRecordDecl().
|
inline |
Whether this DeclContext has external storage containing additional declarations that are visible in this context.
Definition at line 2524 of file DeclBase.h.
References DeclContextBits.
Referenced by buildLookup(), clang::ExternalASTMerger::CanComplete(), clang::ASTReader::completeVisibleDeclsMap(), clang::ASTDumper::dumpLookups(), clang::ASTReader::FindExternalVisibleDeclsByName(), localUncachedLookup(), lookup(), and lookups().
bool DeclContext::hasValidDeclKind | ( | ) | const |
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 1901 of file DeclBase.cpp.
References Equals(), getParent(), and isFileContext().
Referenced by clang::Sema::CheckDependentFunctionTemplateSpecialization(), CheckExplicitInstantiationScope(), clang::Sema::CheckFunctionTemplateSpecialization(), and clang::IdentifierResolver::isDeclInScope().
|
inline |
Definition at line 1975 of file DeclBase.h.
References getDeclKind().
Referenced by clang::FormatASTNodeDiagnosticArgument(), and getInnermostBlockDecl().
Determine whether the given declaration is stored in the list of declarations lexically within this context.
Definition at line 2538 of file DeclBase.h.
References FirstDecl, LastDecl, and clang::Decl::NextInContextAndBits.
Referenced by clang::ASTReader::FindExternalLexicalDecls().
bool DeclContext::isDependentContext | ( | ) | const |
Determines whether this context is dependent on a template parameter.
Definition at line 1209 of file DeclBase.cpp.
References getLexicalParent(), getParent(), isDependentContext(), and isFileContext().
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnCXXEnterDeclaratorScope(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnOMPIteratorExpr(), actOnOMPReductionKindClause(), clang::Sema::ActOnOpenMPAllocateClause(), clang::Sema::ActOnOpenMPAtomicDirective(), clang::Sema::ActOnOpenMPDependClause(), clang::Sema::ActOnOpenMPDeviceClause(), clang::Sema::ActOnOpenMPDispatchDirective(), clang::Sema::ActOnOpenMPDistributeDirective(), clang::Sema::ActOnOpenMPDistributeParallelForDirective(), clang::Sema::ActOnOpenMPDistributeParallelForSimdDirective(), clang::Sema::ActOnOpenMPDistributeSimdDirective(), clang::Sema::ActOnOpenMPDistScheduleClause(), clang::Sema::ActOnOpenMPExecutableDirective(), clang::Sema::ActOnOpenMPFilterClause(), clang::Sema::ActOnOpenMPFinalClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPForDirective(), clang::Sema::ActOnOpenMPForSimdDirective(), clang::Sema::ActOnOpenMPGenericLoopDirective(), clang::Sema::ActOnOpenMPHasDeviceAddrClause(), clang::Sema::ActOnOpenMPIfClause(), clang::Sema::ActOnOpenMPLastprivateClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPMaskedTaskLoopDirective(), clang::Sema::ActOnOpenMPMaskedTaskLoopSimdDirective(), clang::Sema::ActOnOpenMPMasterTaskLoopDirective(), clang::Sema::ActOnOpenMPMasterTaskLoopSimdDirective(), clang::Sema::ActOnOpenMPNocontextClause(), clang::Sema::ActOnOpenMPNovariantsClause(), clang::Sema::ActOnOpenMPNumTeamsClause(), clang::Sema::ActOnOpenMPNumThreadsClause(), clang::Sema::ActOnOpenMPParallelForDirective(), clang::Sema::ActOnOpenMPParallelForSimdDirective(), clang::Sema::ActOnOpenMPParallelGenericLoopDirective(), clang::Sema::ActOnOpenMPParallelMaskedTaskLoopDirective(), clang::Sema::ActOnOpenMPParallelMaskedTaskLoopSimdDirective(), clang::Sema::ActOnOpenMPParallelMasterTaskLoopDirective(), clang::Sema::ActOnOpenMPParallelMasterTaskLoopSimdDirective(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::ActOnOpenMPScheduleClause(), clang::Sema::ActOnOpenMPSharedClause(), clang::Sema::ActOnOpenMPSimdDirective(), clang::Sema::ActOnOpenMPTargetParallelForDirective(), clang::Sema::ActOnOpenMPTargetParallelForSimdDirective(), clang::Sema::ActOnOpenMPTargetParallelGenericLoopDirective(), clang::Sema::ActOnOpenMPTargetSimdDirective(), clang::Sema::ActOnOpenMPTargetTeamsDistributeDirective(), clang::Sema::ActOnOpenMPTargetTeamsDistributeParallelForDirective(), clang::Sema::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(), clang::Sema::ActOnOpenMPTargetTeamsDistributeSimdDirective(), clang::Sema::ActOnOpenMPTargetTeamsGenericLoopDirective(), clang::Sema::ActOnOpenMPTaskLoopDirective(), clang::Sema::ActOnOpenMPTaskLoopSimdDirective(), clang::Sema::ActOnOpenMPTeamsDistributeDirective(), clang::Sema::ActOnOpenMPTeamsDistributeParallelForDirective(), clang::Sema::ActOnOpenMPTeamsDistributeParallelForSimdDirective(), clang::Sema::ActOnOpenMPTeamsDistributeSimdDirective(), clang::Sema::ActOnOpenMPTeamsGenericLoopDirective(), clang::Sema::ActOnOpenMPThreadLimitClause(), clang::Sema::ActOnOpenMPTileDirective(), clang::Sema::ActOnOpenMPUnrollDirective(), clang::Sema::ActOnOpenMPXDynCGroupMemClause(), clang::Sema::ActOnVariableDeclarator(), clang::ASTRecordWriter::AddFunctionDefinition(), AddOrdinaryNameResults(), clang::CXXMethodDecl::addOverriddenMethod(), AddRecordMembersCompletionResults(), clang::Sema::adjustContextForLocalExternDecl(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCXXNestedNameSpecifier(), buildDeclareReductionRef(), clang::Sema::BuildDelegatingInitializer(), clang::Sema::BuildFieldReferenceExpr(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), clang::Sema::BuildStaticAssertDeclaration(), buildUserDefinedMapperRef(), clang::Sema::BuildVariableInstantiation(), clang::Sema::canFullyTypeCheckRedeclaration(), checkAllocateClauses(), clang::Sema::checkAndRewriteMustTailAttr(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckExplicitlyDefaultedFunction(), clang::Sema::CheckFunctionConstraints(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), checkOpenMPIterationSpace(), checkOpenMPLoop(), CheckOperatorDeleteDeclaration(), clang::Sema::CheckPureMethod(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplatePartialSpecializationArgs(), checkTypeMappable(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::checkVarDeclRedefinition(), clang::Sema::CheckVarTemplateId(), clang::computeDependence(), ddiags(), clang::Sema::DeclareImplicitDeductionGuides(), clang::ASTContext::DeclMustBeEmitted(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), DelayDependentAccess(), clang::Sema::EndOpenMPDSABlock(), clang::Sema::FinalizeVarWithDestructor(), findRecordWithDependentBasesOfEnclosingMethod(), clang::Sema::getConstructorName(), clang::Sema::getCurrentMangleNumberContext(), clang::Sema::getEmissionStatus(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), clang::Sema::getTypeName(), clang::Sema::HandleDeclarator(), clang::CXXRecordDecl::hasAnyDependentBases(), clang::Sema::InstantiateClass(), clang::CXXRecordDecl::isCurrentInstantiation(), isDependentContext(), isDependentContextAtLevel(), clang::TagDecl::isDependentType(), IsDerivedFromInclusive(), clang::Decl::isInLocalScopeForInstantiation(), isNonNegativeIntegerValue(), clang::Sema::isNonTypeNestedNameSpecifier(), isOdrUseContext(), clang::Expr::isPotentialConstantExpr(), clang::Sema::LookupParsedName(), clang::Sema::LookupQualifiedName(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), clang::Sema::MarkVTableUsed(), clang::CXXRecordDecl::mayBeAbstract(), clang::Sema::MaybeBindToTemporary(), clang::Sema::MergeCXXFunctionDecl(), MightInstantiateTo(), clang::serialization::needsAnonymousDeclarationNumber(), clang::Sema::RequireCompleteDeclContext(), clang::Sema::shouldLinkDependentDeclWithPrevious(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), clang::Sema::tryCaptureOpenMPLambdas(), and tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs().
bool DeclContext::isExternCContext | ( | ) | const |
Determines whether this context or some of its ancestors is a linkage specification context that specifies C linkage.
Definition at line 1260 of file DeclBase.cpp.
References isLinkageSpecContext(), and clang::LinkageSpecDecl::lang_c.
Referenced by clang::Sema::ActOnStartOpenMPDeclareTargetContext(), clang::Sema::CheckTemplateDeclScope(), handleCmseNSEntryAttr(), clang::VarDecl::isInExternCContext(), clang::FunctionDecl::isInExternCContext(), and clang::CXXRecordDecl::isInterfaceLike().
bool DeclContext::isExternCXXContext | ( | ) | const |
Determines whether this context or some of its ancestors is a linkage specification context that specifies C++ linkage.
Definition at line 1275 of file DeclBase.cpp.
References isLinkageSpecContext(), and clang::LinkageSpecDecl::lang_cxx.
Referenced by clang::Sema::ActOnStartOpenMPDeclareTargetContext(), clang::VarDecl::isInExternCXXContext(), and clang::FunctionDecl::isInExternCXXContext().
|
inline |
Definition at line 2012 of file DeclBase.h.
References getDeclKind().
Referenced by clang::Sema::ActOnConceptDefinition(), clang::Sema::ActOnDeclarator(), clang::Sema::ActOnFinishObjCImplementation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnOpenMPRequiresDirective(), clang::Sema::ActOnPragmaFloatControl(), clang::Sema::ActOnPragmaMSAllocText(), clang::Sema::ActOnPragmaMSFunction(), clang::Sema::ActOnPragmaMSOptimize(), clang::Sema::ActOnStartOpenMPDeclareTargetContext(), clang::Sema::ActOnTag(), clang::Sema::ActOnTagFinishDefinition(), clang::ASTUnit::addFileLevelDecl(), clang::ODRHash::AddFunctionDecl(), clang::Sema::adjustContextForLocalExternDecl(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckRedeclarationExported(), clang::Sema::CheckTemplateDeclScope(), CheckTemplateSpecializationScope(), clang::Sema::CodeCompleteNamespaceDecl(), clang::Sema::CodeCompleteQualifiedId(), CollectEnclosingNamespace(), clang::LinkageComputer::computeLVForDecl(), computeShadowedDeclKind(), CppNamespaceLookup(), clang::Sema::CreateCapturedStmtRecordDecl(), clang::Sema::createLambdaClosureType(), clang::Sema::FinalizeDeclaration(), clang::Sema::FindInstantiatedDecl(), getEnclosingNamespaceContext(), getLookupParent(), clang::Decl::getParentFunctionOrMethod(), getTagInjectionContext(), handleWeakRefAttr(), InEnclosingNamespaceSetOf(), clang::LookupResult::isAvailableForLookup(), clang::CXXRecordDecl::isCurrentInstantiation(), isDependentContext(), isInInlineFunction(), isNamespaceOrTranslationUnitScope(), isNamespaceScope(), isUsingDeclNotAtClassScope(), clang::Sema::LookupQualifiedName(), LookupQualifiedNameInUsingDirectives(), mapCodeCompletionContext(), MightInstantiateTo(), shouldConsiderLinkage(), clang::Sema::ShouldEnterDeclaratorScope(), clang::Sema::shouldLinkDependentDeclWithPrevious(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
|
inline |
Definition at line 1994 of file DeclBase.h.
References getDeclKind().
Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIfStmt(), clang::Sema::ActOnLambdaClosureQualifiers(), clang::Sema::ActOnSEHTryBlock(), clang::Sema::ActOnTag(), clang::Sema::ActOnVariableDeclarator(), clang::CodeCompletionBuilder::addParentContext(), clang::Sema::adjustContextForLocalExternDecl(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckParmsForFunctionDef(), CheckTemplateSpecializationScope(), computeCachedProperties(), clang::LinkageComputer::computeLVForDecl(), clang::Sema::CreateCapturedStmtRecordDecl(), clang::Sema::createLambdaClosureType(), diagnoseUncapturableValueReferenceOrBinding(), DoMarkPotentialCapture(), clang::Sema::FilterUsingLookup(), clang::Sema::FindInstantiatedDecl(), getContextForScopeMatching(), getFunctionStorageClass(), clang::CodeCompletionTUInfo::getParentName(), clang::LifetimeExtendedTemporaryDecl::getStorageDuration(), getTagInjectionContext(), clang::Sema::HandleDeclarator(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), isConsumerInterestedIn(), clang::IdentifierResolver::isDeclInScope(), isDeclWithinFunction(), clang::VarDecl::isFunctionOrMethodVarDecl(), clang::Decl::isInLocalScopeForInstantiation(), isLookupContext(), clang::Sema::isMicrosoftMissingTypename(), isOutOfScopePreviousDeclaration(), IsRecordContextStructurallyEquivalent(), mergeTypeWithPrevious(), clang::serialization::needsAnonymousDeclarationNumber(), clang::Sema::ParsedFreeStandingDeclSpec(), clang::Sema::ParseTypedefDecl(), clang::NamedDecl::printNestedNameSpecifier(), clang::Sema::PushUsingDirective(), shouldConsiderLinkage(), ShouldDiagnoseUnusedDecl(), clang::Sema::tryCaptureVariable(), clang::TemplateDeclInstantiator::VisitBaseUsingDecls(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::ASTNodeImporter::VisitFunctionTemplateDecl(), clang::ASTNodeImporter::VisitLabelDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitTypeAliasTemplateDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTDeclReader::VisitVarDeclImpl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and warnAboutAmbiguousFunction().
bool DeclContext::isInlineNamespace | ( | ) | const |
Definition at line 1188 of file DeclBase.cpp.
References isNamespace().
Referenced by CollectEnclosingNamespace(), IsRecordContextStructurallyEquivalent(), and clang::NamedDecl::printNestedNameSpecifier().
|
inline |
Test whether the context supports looking up names.
Definition at line 2007 of file DeclBase.h.
References getDeclKind(), and isFunctionOrMethod().
|
inline |
Definition at line 2026 of file DeclBase.h.
References getDeclKind().
Referenced by clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::BuildAnonymousStructOrUnion(), isDeclContextInNamespace(), clang::FunctionDecl::isGlobal(), isInlineNamespace(), clang::Sema::IsInsideALocalClassWithinATemplateFunction(), isStdNamespace(), and clang::tooling::stdlib::Recognizer::operator()().
|
inline |
Definition at line 1981 of file DeclBase.h.
References getDeclKind().
Referenced by clang::Sema::ActOnDeclarator(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnMethodDeclaration(), clang::Sema::CodeCompleteObjCAtDirective(), and clang::Sema::CodeCompleteObjCMethodDecl().
|
inline |
Definition at line 2021 of file DeclBase.h.
References getDeclKind().
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnTag(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildAnonymousStructOrUnion(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildUsingDeclaration(), clang::Sema::BuildUsingEnumDeclaration(), clang::Sema::CheckAddressOfOperand(), clang::Sema::CheckClassTemplate(), CheckExplicitInstantiationScope(), clang::Sema::CheckFunctionDeclaration(), CheckMultiVersionAdditionalDecl(), clang::Sema::CheckParameter(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckShadow(), CheckTemplateSpecializationScope(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::CheckUsingDeclRedeclaration(), clang::Sema::CheckUsingShadowDecl(), clang::LinkageComputer::computeLVForDecl(), clang::Sema::CreateCapturedStmtRecordDecl(), clang::Sema::createLambdaClosureType(), CreateNewFunctionDecl(), clang::Sema::diagnoseQualifiedDeclaration(), getDeclLanguageLinkage(), GetFullTypeForDeclarator(), getLookupParent(), getOuterLexicalRecordContext(), getRedeclContext(), clang::Sema::getShadowedDeclaration(), clang::Sema::HandleDeclarator(), haveIncompatibleLanguageLinkages(), clang::Sema::InstantiateVariableDefinition(), clang::NamedDecl::isCXXClassMember(), isDeclExternC(), isDeclWithinFunction(), clang::RecordDecl::isInjectedClassName(), clang::Sema::isMicrosoftMissingTypename(), isOutOfScopePreviousDeclaration(), clang::VarDecl::isStaticDataMember(), mapCodeCompletionContext(), clang::Sema::MergeFunctionDecl(), clang::Sema::MergeVarDecl(), clang::Sema::ParsedFreeStandingDeclSpec(), shouldConsiderLinkage(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarDecl().
bool DeclContext::isStdNamespace | ( | ) | const |
Definition at line 1193 of file DeclBase.cpp.
References getParent(), getRedeclContext(), isNamespace(), clang::IdentifierInfo::isStr(), and isTranslationUnit().
Referenced by clang::Sema::BuildUsingDeclaration(), CheckSimplerImplicitMovesMSVCWorkaround(), clang::BodyFarm::getBody(), clang::Decl::isInStdNamespace(), isInStlNamespace(), and clang::ento::smartptr::isStdSmartPtr().
|
inline |
Definition at line 2017 of file DeclBase.h.
References getDeclKind().
Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnTag(), clang::Sema::ActOnTypedefNameDecl(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::AddKnownFunctionAttributes(), clang::CodeCompletionBuilder::addParentContext(), AddTopLevelDeclarationToHash(), clang::Sema::BuildAnonymousStructOrUnion(), createFriendTagNNSFixIt(), clang::TypeName::createNestedNameSpecifierForScopeOf(), clang::TypeName::createOuterNNS(), diagnoseOpenCLTypes(), dumpDeclContext(), clang::FormatASTNodeDiagnosticArgument(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), clang::Sema::getTemplateInstantiationArgs(), clang::Decl::getTranslationUnitDecl(), clang::Sema::HandleDeclarator(), clang::ento::CheckerContext::isCLibraryFunction(), isDeclContextInNamespace(), clang::Sema::IsInsideALocalClassWithinATemplateFunction(), IsRecordContextStructurallyEquivalent(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::NamedDecl::isReserved(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), isStdNamespace(), clang::dataflow::isTopLevelNamespaceWithName(), LookupDirect(), clang::tooling::stdlib::Recognizer::operator()(), RedeclForcesDefC99(), clang::Sema::RegisterLocallyScopedExternCDecl(), and clang::IdentifierResolver::tryAddTopLevelDecl().
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 1243 of file DeclBase.cpp.
References getDeclKind().
Referenced by clang::Sema::CheckClassTemplate(), clang::Sema::CheckFunctionConstraints(), getNonTransparentContext(), and getRedeclContext().
void DeclContext::localUncachedLookup | ( | DeclarationName | Name, |
SmallVectorImpl< NamedDecl * > & | Results | ||
) |
A simplistic name lookup mechanism that performs name lookup into this declaration context without consulting the external source.
This function should almost never be used, because it subverts the usual relationship between a DeclContext and the external source. See the ASTImporter for the (few, but important) use cases.
FIXME: This is very inefficient; replace uses of it with uses of noload_lookup.
Definition at line 1825 of file DeclBase.cpp.
References clang::DeclContextLookupResult::begin(), clang::DeclContextLookupResult::end(), FirstDecl, clang::Decl::getNextDeclInContext(), hasExternalLexicalStorage(), hasExternalVisibleStorage(), and lookup().
DeclContext::lookup_result DeclContext::lookup | ( | DeclarationName | Name | ) | const |
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 1728 of file DeclBase.cpp.
References buildLookup(), clang::ExternalASTSource::FindExternalVisibleDeclsByName(), getDeclKind(), clang::ASTContext::getExternalSource(), getParent(), getParentASTContext(), getPrimaryContext(), hasExternalVisibleStorage(), and lookup().
Referenced by clang::Sema::AddOverriddenMethods(), clang::Sema::BuildBlockForLambdaConversion(), clang::Sema::BuildCXXDefaultInitExpr(), checkGlobalOrExternCConflict(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), ClassImplementsAllMethodsAndProperties(), clang::ASTReader::CompleteRedeclChain(), configureBlocksRuntimeObject(), clang::Sema::DeclareGlobalAllocationFunction(), clang::Sema::DeclareImplicitDeductionGuides(), clang::Sema::FindHiddenVirtualMethods(), findImplicitlyDeclaredEqualityComparisons(), clang::Sema::findInheritingConstructor(), clang::Sema::FindInstantiatedDecl(), clang::Sema::findLocallyScopedExternCDecl(), findOrdinaryMember(), clang::ObjCPropertyDecl::findPropertyDecl(), clang::ASTContext::forEachMultiversionedFunctionVersion(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::Sema::getConstructorName(), clang::CXXMethodDecl::getCorrespondingMethodDeclaredInClass(), clang::CXXRecordDecl::getDestructor(), getErrnoFunc(), clang::ObjCContainerDecl::getIvarDecl(), getLambdaCallOperatorHelper(), getLambdaStaticInvokers(), clang::ObjCContainerDecl::getMethod(), clang::ObjCContainerDecl::getProperty(), GetRuntimeFunctionDecl(), clang::ObjCContainerDecl::HasUserDeclaredSetterMethod(), clang::Sema::InstantiateClassMembers(), clang::NamespaceDecl::isRedundantInlineQualifierFor(), clang::Sema::isUsualDeallocationFunction(), clang::CXXMethodDecl::isUsualDeallocationFunction(), localUncachedLookup(), lookup(), lookupCXXRecordDecl(), clang::CXXRecordDecl::lookupDependentName(), LookupDirect(), clang::Sema::LookupQualifiedName(), clang::Sema::LookupSpecialMember(), lookupStdNamespace(), lookupUnqualifiedTypeNameInBase(), clang::TreeTransform< Derived >::RebuildShuffleVectorExpr(), and using_directives().
|
inline |
Definition at line 75 of file DeclLookups.h.
References buildLookup(), clang::ExternalASTSource::completeVisibleDeclsMap(), clang::ASTContext::getExternalSource(), getParentASTContext(), getPrimaryContext(), and hasExternalVisibleStorage().
Referenced by clang::ASTDumper::dumpLookups().
all_lookups_iterator clang::DeclContext::lookups_begin | ( | ) | const |
Iterators over all possible lookups within this context.
all_lookups_iterator clang::DeclContext::lookups_end | ( | ) | const |
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 1919 of file DeclBase.cpp.
References clang::Decl::getDeclContext(), and getPrimaryContext().
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnPropertyImplDecl(), clang::Sema::ActOnTag(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckImplementationIvars(), clang::Sema::RegisterLocallyScopedExternCDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
|
inline |
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.
Definition at line 2205 of file DeclBase.h.
References noload_decls_begin(), and noload_decls_end().
Referenced by CXXRecordAllNonInlineVirtualsHaveAttr(), and clang::ASTNodeTraverser< Derived, NodeDelegateType >::dumpDeclContext().
|
inline |
|
inline |
Definition at line 2209 of file DeclBase.h.
Referenced by noload_decls().
DeclContext::lookup_result DeclContext::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.
Definition at line 1793 of file DeclBase.cpp.
References getDeclKind(), getPrimaryContext(), and noload_lookup().
Referenced by noload_lookup(), and clang::ASTNodeImporter::VisitRecordDecl().
|
inline |
Definition at line 89 of file DeclLookups.h.
References getLookupPtr(), and getPrimaryContext().
Referenced by clang::ASTDumper::dumpLookups().
all_lookups_iterator clang::DeclContext::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 clang::DeclContext::noload_lookups_end | ( | ) | const |
void DeclContext::removeDecl | ( | Decl * | D | ) |
Removes a declaration from this context.
Definition at line 1561 of file DeclBase.cpp.
References FirstDecl, clang::Decl::getDeclContext(), clang::Decl::getLexicalDeclContext(), LastDecl, clang::Decl::NextInContextAndBits, and shouldBeHidden().
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::HideUsingShadowDecl(), and clang::ASTNodeImporter::ImportDeclContext().
State whether this DeclContext has external storage for declarations lexically in this context.
Definition at line 2518 of file DeclBase.h.
References DeclContextBits.
Referenced by DeclContext(), and clang::HLSLExternalSemaSource::InitializeSema().
State whether this DeclContext has external storage for declarations visible in this context.
Definition at line 2530 of file DeclBase.h.
References DeclContextBits.
Referenced by DeclContext().
|
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 2497 of file DeclBase.h.
References DeclContextBits, and getPrimaryContext().
Definition at line 2543 of file DeclBase.h.
References DeclContextBits.
Referenced by DeclContext(), and clang::Sema::LookupQualifiedName().
|
inline |
Definition at line 2547 of file DeclBase.h.
References DeclContextBits.
Referenced by clang::Sema::LookupQualifiedName().
DeclContext::udir_range DeclContext::using_directives | ( | ) | const |
Returns iterator range [First, Last) of UsingDirectiveDecls stored within this context.
Definition at line 2016 of file DeclBase.cpp.
References lookup(), and clang::Result.
Referenced by LookupQualifiedNameInUsingDirectives().
|
friend |
For makeDeclVisibleInContextImpl.
Definition at line 1404 of file DeclBase.h.
|
friend |
For checking the new bits in the Serialization part.
Definition at line 1406 of file DeclBase.h.
|
friend |
For hasNeedToReconcileExternalVisibleStorage, hasLazyLocalLexicalLookups, hasLazyExternalLexicalLookups.
Definition at line 1414 of file DeclBase.h.
|
friend |
For CreateStoredDeclsMap.
Definition at line 1411 of file DeclBase.h.
|
friend |
For reconcileExternalVisibleStorage, CreateStoredDeclsMap, hasNeedToReconcileExternalVisibleStorage.
Definition at line 1409 of file DeclBase.h.
union { ... } clang::DeclContext::@44 |
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.
BlockDeclBitfields clang::DeclContext::BlockDeclBits |
Definition at line 1884 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().
CXXConstructorDeclBitfields clang::DeclContext::CXXConstructorDeclBits |
Definition at line 1880 of file DeclBase.h.
Referenced by clang::CXXConstructorDecl::getNumCtorInitializers(), clang::CXXConstructorDecl::isInheritingConstructor(), clang::CXXConstructorDecl::setExplicitSpecifier(), clang::CXXConstructorDecl::setInheritingConstructor(), and clang::CXXConstructorDecl::setNumCtorInitializers().
DeclContextBitfields clang::DeclContext::DeclContextBits |
Definition at line 1874 of file DeclBase.h.
Referenced by DeclContext(), getDeclKind(), hasExternalLexicalStorage(), hasExternalVisibleStorage(), setHasExternalLexicalStorage(), setHasExternalVisibleStorage(), setMustBuildLookupTable(), setUseQualifiedLookup(), and shouldUseQualifiedLookup().
EnumDeclBitfields clang::DeclContext::EnumDeclBits |
Definition at line 1876 of file DeclBase.h.
Referenced by clang::EnumDecl::getNumNegativeBits(), clang::EnumDecl::getNumPositiveBits(), clang::EnumDecl::isFixed(), clang::EnumDecl::isScoped(), clang::EnumDecl::isScopedUsingClassTag(), clang::EnumDecl::setFixed(), clang::EnumDecl::setScoped(), and clang::EnumDecl::setScopedUsingClassTag().
|
mutableprotected |
FirstDecl - The first declaration stored within this declaration context.
Definition at line 1912 of file DeclBase.h.
Referenced by addHiddenDecl(), decls_begin(), decls_empty(), clang::RecordDecl::field_begin(), isDeclInLexicalTraversal(), localUncachedLookup(), noload_decls_begin(), removeDecl(), and clang::RecordDecl::reorderDecls().
FunctionDeclBitfields clang::DeclContext::FunctionDeclBits |
Definition at line 1879 of file DeclBase.h.
Referenced by clang::FunctionDecl::doesThisDeclarationHaveABody(), clang::FunctionDecl::FriendConstraintRefersToEnclosingTemplate(), clang::FunctionDecl::FunctionDecl(), clang::FunctionDecl::getConstexprKind(), clang::FunctionDecl::getDefaultedFunctionInfo(), clang::FunctionDecl::getStorageClass(), clang::FunctionDecl::hasImplicitReturnZero(), clang::FunctionDecl::hasInheritedPrototype(), clang::FunctionDecl::hasSkippedBody(), clang::FunctionDecl::hasWrittenPrototype(), clang::FunctionDecl::instantiationIsPending(), clang::CXXDeductionGuideDecl::isCopyDeductionCandidate(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::FunctionDecl::isDeletedAsWritten(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::FunctionDecl::isIneligibleOrNotSelected(), clang::FunctionDecl::isInlined(), clang::FunctionDecl::isInlineSpecified(), clang::FunctionDecl::isLateTemplateParsed(), clang::FunctionDecl::isMultiVersion(), clang::FunctionDecl::isPure(), clang::FunctionDecl::isTrivial(), clang::FunctionDecl::isTrivialForCall(), clang::FunctionDecl::isVirtualAsWritten(), clang::FunctionDecl::setBody(), clang::FunctionDecl::setConstexprKind(), clang::FunctionDecl::setDefaulted(), clang::FunctionDecl::setDefaultedFunctionInfo(), 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::setInstantiationIsPending(), clang::CXXDeductionGuideDecl::setIsCopyDeductionCandidate(), clang::FunctionDecl::setIsMultiVersion(), clang::FunctionDecl::setLateTemplateParsed(), clang::FunctionDecl::setLazyBody(), clang::FunctionDecl::setPure(), 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().
|
mutableprotected |
LastDecl - The last declaration stored within this declaration context.
FIXME: We could probably cache this value somewhere outside of the DeclContext, to reduce the size of DeclContext by another pointer.
Definition at line 1918 of file DeclBase.h.
Referenced by addHiddenDecl(), containsDecl(), isDeclInLexicalTraversal(), removeDecl(), and clang::RecordDecl::reorderDecls().
LinkageSpecDeclBitfields clang::DeclContext::LinkageSpecDeclBits |
Definition at line 1883 of file DeclBase.h.
Referenced by clang::LinkageSpecDecl::getLanguage(), clang::LinkageSpecDecl::hasBraces(), clang::LinkageSpecDecl::setLanguage(), and clang::LinkageSpecDecl::setRBraceLoc().
ObjCContainerDeclBitfields clang::DeclContext::ObjCContainerDeclBits |
Definition at line 1882 of file DeclBase.h.
Referenced by clang::ObjCContainerDecl::getAtStartLoc(), and clang::ObjCContainerDecl::setAtStartLoc().
ObjCMethodDeclBitfields clang::DeclContext::ObjCMethodDeclBits |
Definition at line 1881 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().
OMPDeclareReductionDeclBitfields clang::DeclContext::OMPDeclareReductionDeclBits |
Definition at line 1878 of file DeclBase.h.
Referenced by clang::OMPDeclareReductionDecl::getInitializerKind(), and clang::OMPDeclareReductionDecl::setInitializer().
RecordDeclBitfields clang::DeclContext::RecordDeclBits |
Definition at line 1877 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::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::setHasVolatileMember(), clang::RecordDecl::setIsRandomized(), clang::RecordDecl::setNonTrivialToPrimitiveCopy(), clang::RecordDecl::setNonTrivialToPrimitiveDefaultInitialize(), clang::RecordDecl::setNonTrivialToPrimitiveDestroy(), and clang::RecordDecl::setParamDestroyedInCallee().
TagDeclBitfields clang::DeclContext::TagDeclBits |
Definition at line 1875 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::mayHaveOutOfDateDef(), clang::TagDecl::setBeingDefined(), clang::TagDecl::setCompleteDefinition(), clang::TagDecl::setCompleteDefinitionRequired(), clang::TagDecl::setEmbeddedInDeclarator(), clang::TagDecl::setFreeStanding(), clang::TagDecl::setMayHaveOutOfDateDef(), clang::TagDecl::setTagKind(), and clang::TagDecl::TagDecl().