clang 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
clang::DeclContext Class Reference

DeclContext - This is used only as base class of specific decl types that can act as declaration contexts. More...

#include "clang/AST/DeclBase.h"

Inheritance diagram for clang::DeclContext:
Inheritance graph
[legend]

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
 
DeclContextgetParent ()
 getParent - Returns the containing DeclContext.
 
const DeclContextgetParent () const
 
DeclContextgetLexicalParent ()
 getLexicalParent - Returns the containing lexical DeclContext.
 
const DeclContextgetLexicalParent () const
 
DeclContextgetLookupParent ()
 Find the parent context of this context that will be used for unqualified name lookup.
 
const DeclContextgetLookupParent () const
 
ASTContextgetParentASTContext () const
 
bool isClosure () const
 
const BlockDeclgetInnermostBlockDecl () 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 LinkageSpecDeclgetExternCContext () 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.
 
DeclgetNonClosureAncestor ()
 Find the nearest non-closure ancestor of this context, i.e.
 
const DeclgetNonClosureAncestor () const
 
DeclContextgetNonTransparentContext ()
 
const DeclContextgetNonTransparentContext () const
 
DeclContextgetPrimaryContext ()
 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 DeclContextgetPrimaryContext () const
 
DeclContextgetRedeclContext ()
 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 DeclContextgetRedeclContext () const
 
DeclContextgetEnclosingNamespaceContext ()
 Retrieve the nearest enclosing namespace context.
 
const DeclContextgetEnclosingNamespaceContext () const
 
RecordDeclgetOuterLexicalRecordContext ()
 Retrieve the outermost lexically enclosing record context.
 
const RecordDeclgetOuterLexicalRecordContext () 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).
 
StoredDeclsMapgetLookupPtr () const
 Retrieve the internal representation of the lookup structure.
 
StoredDeclsMapbuildLookup ()
 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
 
   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.
 
DeclFirstDecl = nullptr
 FirstDecl - The first declaration stored within this declaration context.
 
DeclLastDecl = 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.
 

Detailed Description

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 1436 of file DeclBase.h.

Member Typedef Documentation

◆ ddiag_range

Definition at line 2638 of file DeclBase.h.

◆ decl_range

using clang::DeclContext::decl_range = llvm::iterator_range<decl_iterator>

Definition at line 2346 of file DeclBase.h.

◆ lookup_iterator

Definition at line 2555 of file DeclBase.h.

◆ lookup_result

Definition at line 2554 of file DeclBase.h.

◆ lookups_range

Definition at line 2601 of file DeclBase.h.

◆ udir_iterator_base

Definition at line 2620 of file DeclBase.h.

◆ udir_range

using clang::DeclContext::udir_range = llvm::iterator_range<udir_iterator>

Definition at line 2631 of file DeclBase.h.

Constructor & Destructor Documentation

◆ DeclContext()

DeclContext::DeclContext ( Decl::Kind  K)
protected

◆ ~DeclContext()

DeclContext::~DeclContext ( )
default

Member Function Documentation

◆ 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 1766 of file DeclBase.cpp.

References addHiddenDecl(), and D.

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::SemaOpenMP::ActOnOMPIteratorExpr(), clang::SemaOpenMP::ActOnOpenMPAllocateDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionDirectiveStart(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPRequiresDirective(), clang::SemaOpenMP::ActOnOpenMPThreadprivateDirective(), clang::SemaOpenMP::ActOnOpenMPUseDevicePtrClause(), clang::Sema::ActOnPragmaDetectMismatch(), clang::Sema::ActOnPragmaMSComment(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::SemaObjC::ActOnStartCategoryImplementation(), clang::SemaObjC::ActOnStartCategoryInterface(), clang::Sema::ActOnStartExportDecl(), clang::Sema::ActOnStartLinkageSpecification(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnStartTopLevelStmtDecl(), clang::Sema::ActOnTag(), clang::Sema::ActOnTemplatedFriendTag(), clang::Sema::ActOnVarTemplateSpecialization(), clang::ObjCImplDecl::addClassMethod(), addFieldToRecordDecl(), clang::ObjCImplDecl::addInstanceMethod(), clang::ObjCImplDecl::addPropertyImplementation(), clang::Sema::BuildAnonymousStructOrUnion(), clang::ASTContext::buildBuiltinTemplateDecl(), clang::Sema::BuildCaptureField(), buildImplicitMapper(), 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::SemaObjC::CheckImplementationIvars(), clang::Sema::CompleteLambdaCallOperator(), CreateAAPCSABIBuiltinVaListDecl(), CreateAArch64ABIBuiltinVaListDecl(), clang::Sema::CreateCapturedStmtRecordDecl(), CreateHexagonBuiltinVaListDecl(), clang::Sema::createImplicitModuleImportForErrorRecovery(), clang::Sema::createLambdaClosureType(), CreatePowerABIBuiltinVaListDecl(), clang::SemaObjC::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::ASTContext::getObjCSuperType(), clang::Sema::getOrCreateStdNamespace(), clang::ASTContext::InitBuiltinTypes(), clang::HLSLExternalSemaSource::InitializeSema(), clang::SemaObjC::ProcessPropertyDecl(), clang::Sema::PushOnScopeChains(), clang::Sema::PushUsingDirective(), clang::TreeTransform< Derived >::RebuildExceptionDecl(), clang::Sema::SubstSpaceshipAsEqualEqual(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().

◆ 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 1774 of file DeclBase.cpp.

References addHiddenDecl(), and D.

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::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(), 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 1740 of file DeclBase.cpp.

References clang::ASTContext::addedLocalImportDecl(), D, 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().

◆ BuildDeclChain()

std::pair< Decl *, Decl * > DeclContext::BuildDeclChain ( ArrayRef< Decl * >  Decls,
bool  FieldsAlreadyLoaded 
)
staticprotected

Build up a chain of declarations.

Returns
the first/last pair of declarations.

Definition at line 1523 of file DeclBase.cpp.

References D, and clang::Decl::NextInContextAndBits.

Referenced by clang::RecordDecl::reorderDecls().

◆ buildLookup()

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 1789 of file DeclBase.cpp.

References collectAllContexts(), getPrimaryContext(), and hasExternalVisibleStorage().

Referenced by lookup(), and lookups().

◆ classof() [1/2]

bool DeclContext::classof ( const Decl D)
static

Definition at line 1264 of file DeclBase.cpp.

References D, and clang::Decl::getKind().

◆ classof() [2/2]

static bool clang::DeclContext::classof ( const DeclContext D)
inlinestatic

Definition at line 2705 of file DeclBase.h.

◆ collectAllContexts()

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:

namespace N {
int x;
}
namespace N {
int y;
}

The Contexts parameter will contain both definitions of N.

Parameters
ContextsWill 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 1509 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

Checks whether a declaration is in this context.

This also loads the Decls from the external source before the check.

Definition at line 1640 of file DeclBase.cpp.

References containsDecl(), D, and hasExternalLexicalStorage().

◆ ddiags()

DeclContext::ddiag_range clang::DeclContext::ddiags ( ) const
inline

◆ decls()

decl_range clang::DeclContext::decls ( ) const
inline

◆ decls_begin()

DeclContext::decl_iterator DeclContext::decls_begin ( ) const

◆ decls_empty()

bool DeclContext::decls_empty ( ) const

◆ decls_end()

decl_iterator clang::DeclContext::decls_end ( ) const
inline

◆ dumpAsDecl() [1/2]

LLVM_DUMP_METHOD void DeclContext::dumpAsDecl ( ) const

Definition at line 244 of file ASTDumper.cpp.

References dumpAsDecl().

Referenced by dumpAsDecl().

◆ 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

Definition at line 269 of file ASTDumper.cpp.

References dumpLookups().

Referenced by dumpLookups().

◆ dumpLookups() [2/2]

void clang::DeclContext::dumpLookups ( llvm::raw_ostream &  OS,
bool  DumpDecls = false,
bool  Deserialize = false 
) const

◆ Encloses()

bool DeclContext::Encloses ( const DeclContext DC) const

◆ Equals()

bool clang::DeclContext::Equals ( const DeclContext DC) const
inline

◆ getDeclKind()

Decl::Kind clang::DeclContext::getDeclKind ( ) const
inline

◆ getDeclKindName()

const char * DeclContext::getDeclKindName ( ) const

Definition at line 186 of file DeclBase.cpp.

References getDeclKind().

◆ getEnclosingNamespaceContext() [1/2]

DeclContext * DeclContext::getEnclosingNamespaceContext ( )

◆ getEnclosingNamespaceContext() [2/2]

const DeclContext * clang::DeclContext::getEnclosingNamespaceContext ( ) const
inline

Definition at line 2262 of file DeclBase.h.

References getEnclosingNamespaceContext().

◆ getExternCContext()

const LinkageSpecDecl * DeclContext::getExternCContext ( ) const

Retrieve the nearest enclosing C linkage specification context.

Definition at line 1388 of file DeclBase.cpp.

References clang::C, getDeclKind(), and getLexicalParent().

Referenced by clang::Sema::CheckLiteralOperatorDeclaration(), and clang::Sema::CheckTemplateDeclScope().

◆ getInnermostBlockDecl()

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 1300 of file DeclBase.cpp.

References getParent(), and isClosure().

Referenced by clang::SemaObjC::BuildIvarRefExpr(), and diagnoseImplicitlyRetainedSelf().

◆ getLexicalParent() [1/2]

DeclContext * clang::DeclContext::getLexicalParent ( )
inline

◆ getLexicalParent() [2/2]

const DeclContext * clang::DeclContext::getLexicalParent ( ) const
inline

Definition at line 2109 of file DeclBase.h.

References getLexicalParent().

◆ getLookupParent() [1/2]

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 1284 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().

◆ getLookupParent() [2/2]

const DeclContext * clang::DeclContext::getLookupParent ( ) const
inline

Definition at line 2115 of file DeclBase.h.

References getLookupParent().

◆ getLookupPtr()

StoredDeclsMap * clang::DeclContext::getLookupPtr ( ) const
inline

Retrieve the internal representation of the lookup structure.

This may omit some names if we are lazily building the structure.

Definition at line 2658 of file DeclBase.h.

Referenced by clang::IncrementalParser::CleanUpPTU(), and noload_lookups().

◆ getNonClosureAncestor() [1/2]

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 1246 of file DeclBase.cpp.

Referenced by getNonClosureAncestor(), clang::dataflow::Environment::initialize(), clang::SemaObjC::isSelfExpr(), and LookupMethodInReceiverType().

◆ getNonClosureAncestor() [2/2]

const Decl * clang::DeclContext::getNonClosureAncestor ( ) const
inline

Definition at line 2231 of file DeclBase.h.

References getNonClosureAncestor().

◆ getNonTransparentContext() [1/2]

DeclContext * DeclContext::getNonTransparentContext ( )

◆ getNonTransparentContext() [2/2]

const DeclContext * clang::DeclContext::getNonTransparentContext ( ) const
inline

Definition at line 2237 of file DeclBase.h.

References getNonTransparentContext().

◆ getOuterLexicalRecordContext() [1/2]

RecordDecl * DeclContext::getOuterLexicalRecordContext ( )

Retrieve the outermost lexically enclosing record context.

Definition at line 2014 of file DeclBase.cpp.

References getLexicalParent(), and isRecord().

Referenced by clang::Sema::BuildCXXDefaultInitExpr(), getOffsetDifferenceInBits(), getOuterLexicalRecordContext(), and clang::Sema::InstantiateInClassInitializer().

◆ getOuterLexicalRecordContext() [2/2]

const RecordDecl * clang::DeclContext::getOuterLexicalRecordContext ( ) const
inline

Definition at line 2268 of file DeclBase.h.

References getOuterLexicalRecordContext().

◆ getParent() [1/2]

DeclContext * clang::DeclContext::getParent ( )
inline

getParent - Returns the containing DeclContext.

Definition at line 2090 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::BuildCallToMemberFunction(), 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::CheckIfFunctionSpecializationIsImmediate(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), checkModuleImportContext(), clang::Sema::CheckParmsForFunctionDef(), clang::Sema::CheckShadow(), CheckSimplerImplicitMovesMSVCWorkaround(), clang::Sema::CheckUsingShadowDecl(), ClassifyImplicitMemberAccess(), CollectEnclosingNamespace(), clang::interp::ByteCodeEmitter::compileFunc(), 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::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::interp::Function::getParentDecl(), clang::CodeCompletionTUInfo::getParentName(), getPredefinedExprDecl(), getRedeclContext(), clang::AnalysisDeclContext::getSelfDecl(), getTagInjectionContext(), clang::CodeGen::CGCXXABI::getThisArgumentTypeForMethod(), clang::Decl::getTranslationUnitDecl(), clang::sema::handleGslAnnotatedTypes(), InEnclosingNamespaceSetOf(), clang::Sema::InstantiateFunctionDeclaration(), clang::Sema::InstantiateFunctionDefinition(), 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::SemaOpenMP::isOpenMPCapturedDecl(), IsRecordContextStructurallyEquivalent(), clang::NamespaceDecl::isRedundantInlineQualifierFor(), isReferenceToNonConstCapture(), isStdNamespace(), clang::dataflow::isTopLevelNamespaceWithName(), IsUsingDirectiveInToplevelContext(), isWithinStdNamespace(), lookup(), clang::MangleContext::mangleBlock(), MaybeAddOverrideCalls(), noload_lookup(), clang::tooling::stdlib::Recognizer::operator()(), clang::CodeGen::CGRecordLayout::print(), clang::NamedDecl::printNestedNameSpecifier(), recoverFromMSUnqualifiedLookup(), recoverFromTypeInKnownDependentBase(), rewriteBuiltinFunctionDecl(), clang::Sema::SubstituteExplicitTemplateArguments(), clang::interp::MemberPointer::toPointer(), clang::Sema::tryCaptureVariable(), tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs(), clang::FunctionCallFilterCCC::ValidateCandidate(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), and clang::interp::Compiler< Emitter >::VisitMemberExpr().

◆ getParent() [2/2]

const DeclContext * clang::DeclContext::getParent ( ) const
inline

Definition at line 2093 of file DeclBase.h.

References getParent().

◆ getParentASTContext()

ASTContext & clang::DeclContext::getParentASTContext ( ) const
inline

◆ getPrimaryContext() [1/2]

DeclContext * DeclContext::getPrimaryContext ( )

◆ getPrimaryContext() [2/2]

const DeclContext * clang::DeclContext::getPrimaryContext ( ) const
inline

Definition at line 2248 of file DeclBase.h.

References getPrimaryContext().

◆ getRedeclContext() [1/2]

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 1988 of file DeclBase.cpp.

References getDeclKind(), clang::ASTContext::getLangOpts(), getParent(), getParentASTContext(), isRecord(), and isTransparentContext().

Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnPragmaFloatControl(), clang::Sema::ActOnPragmaMSAllocText(), clang::Sema::ActOnPragmaMSFunction(), clang::Sema::ActOnPragmaMSOptimize(), clang::Sema::ActOnStartConceptDefinition(), 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::CheckDeductionGuideDeclarator(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), CheckExplicitInstantiationScope(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::Sema::CheckMain(), CheckMultiVersionFunction(), clang::SemaObjC::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(), handleExcludeFromExplicitInstantiationAttr(), handleWeakRefAttr(), isAcceptableTagRedeclContext(), clang::ento::CheckerContext::isCLibraryFunction(), clang::NamedDecl::isCXXClassMember(), clang::IdentifierResolver::isDeclInScope(), clang::VarDecl::isFunctionOrMethodVarDecl(), IsInternalDeclFromFileContext(), clang::FunctionDecl::isMain(), isMainVar(), clang::FunctionDecl::isMSVCRTEntryPoint(), isOutOfScopePreviousDeclaration(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::NamedDecl::isReserved(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), clang::ASTContext::isSameEntity(), isStdNamespace(), clang::Sema::LookupName(), clang::Sema::ProcessAPINotes(), clang::Sema::PushOnScopeChains(), clang::Sema::RegisterLocallyScopedExternCDecl(), clang::ASTImporterLookupTable::remove(), shouldConsiderLinkage(), clang::Sema::ShouldEnterDeclaratorScope(), ShouldWarnAboutMissingPrototype(), clang::IdentifierResolver::tryAddTopLevelDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().

◆ getRedeclContext() [2/2]

const DeclContext * clang::DeclContext::getRedeclContext ( ) const
inline

Definition at line 2256 of file DeclBase.h.

References getRedeclContext().

◆ hasExternalLexicalStorage()

bool clang::DeclContext::hasExternalLexicalStorage ( ) const
inline

Whether this DeclContext has external storage containing additional declarations that are lexically in this context.

Definition at line 2665 of file DeclBase.h.

References DeclContextBits.

Referenced by containsDeclAndLoad(), clang::ClassTemplateSpecializationDecl::Create(), decls_begin(), decls_empty(), clang::RecordDecl::field_begin(), clang::HLSLExternalSemaSource::InitializeSema(), IsStructurallyEquivalent(), and localUncachedLookup().

◆ hasExternalVisibleStorage()

bool clang::DeclContext::hasExternalVisibleStorage ( ) const
inline

Whether this DeclContext has external storage containing additional declarations that are visible in this context.

Definition at line 2677 of file DeclBase.h.

References DeclContextBits.

Referenced by buildLookup(), clang::ExternalSource::completeVisibleDeclsMap(), clang::ASTReader::completeVisibleDeclsMap(), clang::ASTDumper::dumpLookups(), clang::ASTReader::FindExternalVisibleDeclsByName(), localUncachedLookup(), lookup(), and lookups().

◆ hasValidDeclKind()

bool DeclContext::hasValidDeclKind ( ) const

Definition at line 177 of file DeclBase.cpp.

References getDeclKind().

Referenced by dumpAsDecl().

◆ 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 2025 of file DeclBase.cpp.

References Equals(), getParent(), and isFileContext().

Referenced by clang::Sema::CheckDependentFunctionTemplateSpecialization(), CheckExplicitInstantiationScope(), clang::Sema::CheckFunctionTemplateSpecialization(), and clang::IdentifierResolver::isDeclInScope().

◆ isClosure()

bool clang::DeclContext::isClosure ( ) const
inline

◆ isDeclInLexicalTraversal()

bool clang::DeclContext::isDeclInLexicalTraversal ( const Decl D) const
inline

Determine whether the given declaration is stored in the list of declarations lexically within this context.

Definition at line 2691 of file DeclBase.h.

References D, FirstDecl, and LastDecl.

Referenced by clang::ASTReader::FindExternalLexicalDecls().

◆ isDependentContext()

bool DeclContext::isDependentContext ( ) const

Determines whether this context is dependent on a template parameter.

Definition at line 1333 of file DeclBase.cpp.

References clang::Function, 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::SemaOpenMP::ActOnOMPIteratorExpr(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPAllocateClause(), clang::SemaOpenMP::ActOnOpenMPAtomicDirective(), clang::SemaOpenMP::ActOnOpenMPDeviceClause(), clang::SemaOpenMP::ActOnOpenMPDispatchDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPDistScheduleClause(), clang::SemaOpenMP::ActOnOpenMPExecutableDirective(), clang::SemaOpenMP::ActOnOpenMPFilterClause(), clang::SemaOpenMP::ActOnOpenMPFinalClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPHasDeviceAddrClause(), clang::SemaOpenMP::ActOnOpenMPIfClause(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPNocontextClause(), clang::SemaOpenMP::ActOnOpenMPNovariantsClause(), clang::SemaOpenMP::ActOnOpenMPNumTeamsClause(), clang::SemaOpenMP::ActOnOpenMPNumThreadsClause(), clang::SemaOpenMP::ActOnOpenMPParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaOpenMP::ActOnOpenMPReverseDirective(), clang::SemaOpenMP::ActOnOpenMPScheduleClause(), clang::SemaOpenMP::ActOnOpenMPSharedClause(), clang::SemaOpenMP::ActOnOpenMPTargetParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPThreadLimitClause(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), clang::SemaOpenMP::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::BuildStaticAssertDeclaration(), buildUserDefinedMapperRef(), clang::Sema::BuildVariableInstantiation(), clang::Sema::canFullyTypeCheckRedeclaration(), checkAllocateClauses(), clang::Sema::checkAndRewriteMustTailAttr(), clang::Sema::checkCall(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckExplicitlyDefaultedFunction(), clang::Sema::CheckFunctionConstraints(), clang::Sema::CheckFunctionDeclaration(), 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(), clang::Sema::DeclareAggregateDeductionGuideFromInitList(), clang::Sema::DeclareImplicitDeductionGuides(), clang::ASTContext::DeclMustBeEmitted(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), DelayDependentAccess(), clang::SemaOpenMP::EndOpenMPDSABlock(), clang::Sema::FinalizeVarWithDestructor(), findRecordWithDependentBasesOfEnclosingMethod(), finishLinearClauses(), clang::Sema::getConstructorName(), clang::Sema::getCurrentMangleNumberContext(), clang::Sema::getEmissionStatus(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), clang::Sema::getTypeName(), clang::Sema::HandleDeclarator(), clang::CXXRecordDecl::hasAnyDependentBases(), hasUserDefinedMapper(), clang::Sema::InstantiateClass(), clang::CXXRecordDecl::isCurrentInstantiation(), isDependentContext(), isDependentContextAtLevel(), clang::TagDecl::isDependentType(), IsDerivedFromInclusive(), clang::Decl::isInLocalScopeForInstantiation(), isNonNegativeIntegerValue(), 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(), clang::serialization::needsAnonymousDeclarationNumber(), ProcessOpenMPDoacrossClauseCommon(), clang::Sema::RequireCompleteDeclContext(), clang::Sema::shouldLinkDependentDeclWithPrevious(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), clang::SourceLocExpr::SourceLocExpr(), clang::SemaOpenMP::tryCaptureOpenMPLambdas(), tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs(), clang::ASTNodeImporter::VisitClassTemplateDecl(), and clang::ASTNodeImporter::VisitRecordDecl().

◆ isExternCContext()

bool DeclContext::isExternCContext ( ) const

◆ isExternCXXContext()

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 1399 of file DeclBase.cpp.

References clang::CXX, and isLinkageSpecContext().

Referenced by clang::SemaOpenMP::ActOnStartOpenMPDeclareTargetContext(), clang::Sema::CheckMain(), clang::VarDecl::isInExternCXXContext(), clang::FunctionDecl::isInExternCXXContext(), and clang::Sema::ProcessAPINotes().

◆ isFileContext()

bool clang::DeclContext::isFileContext ( ) const
inline

Definition at line 2161 of file DeclBase.h.

References getDeclKind().

Referenced by clang::Sema::ActOnDeclarator(), clang::SemaObjC::ActOnFinishObjCImplementation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::SemaOpenMP::ActOnOpenMPRequiresDirective(), clang::Sema::ActOnPragmaFloatControl(), clang::Sema::ActOnPragmaMSAllocText(), clang::Sema::ActOnPragmaMSFunction(), clang::Sema::ActOnPragmaMSOptimize(), clang::Sema::ActOnStartConceptDefinition(), clang::SemaOpenMP::ActOnStartOpenMPDeclareTargetContext(), clang::Sema::ActOnTag(), clang::ASTUnit::addFileLevelDecl(), clang::ODRHash::AddFunctionDecl(), clang::Sema::adjustContextForLocalExternDecl(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckRedeclarationExported(), clang::Sema::CheckTemplateDeclScope(), CheckTemplateSpecializationScope(), clang::SemaCodeCompletion::CodeCompleteNamespaceDecl(), clang::SemaCodeCompletion::CodeCompleteQualifiedId(), CollectEnclosingNamespace(), clang::LinkageComputer::computeLVForDecl(), computeShadowedDeclKind(), CppNamespaceLookup(), clang::Sema::CreateCapturedStmtRecordDecl(), clang::Sema::createLambdaClosureType(), clang::Sema::FinalizeDeclaration(), clang::Sema::FindInstantiatedDecl(), getEnclosingNamespaceContext(), clang::ASTContext::getInlineVariableDefinitionKind(), getLookupParent(), clang::Decl::getParentFunctionOrMethod(), getTagInjectionContext(), handleWeakRefAttr(), InEnclosingNamespaceSetOf(), clang::LookupResult::isAvailableForLookup(), clang::CXXRecordDecl::isCurrentInstantiation(), isDependentContext(), isInInlineFunction(), IsInternalDeclFromFileContext(), isNamespaceOrTranslationUnitScope(), isNamespaceScope(), isUsingDeclNotAtClassScope(), clang::Sema::LookupQualifiedName(), LookupQualifiedNameInUsingDirectives(), mapCodeCompletionContext(), MightInstantiateTo(), clang::Sema::ProcessAPINotes(), shouldConsiderLinkage(), clang::Sema::ShouldEnterDeclaratorScope(), clang::Sema::shouldLinkDependentDeclWithPrevious(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().

◆ isFunctionOrMethod()

bool clang::DeclContext::isFunctionOrMethod ( ) const
inline

Definition at line 2142 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(), CheckAnonMemberRedeclaration(), clang::Sema::CheckParmsForFunctionDef(), CheckTemplateSpecializationScope(), 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::Sema::ImplicitlyDefineFunction(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::IdentifierResolver::isDeclInScope(), isDeclWithinFunction(), clang::VarDecl::isFunctionOrMethodVarDecl(), clang::Decl::isInLocalScopeForInstantiation(), isLookupContext(), clang::Sema::isMicrosoftMissingTypename(), isOutOfScopePreviousDeclaration(), clang::NamedDecl::isPlaceholderVar(), IsRecordContextStructurallyEquivalent(), mergeTypeWithPrevious(), clang::serialization::needsAnonymousDeclarationNumber(), clang::Sema::ParsedFreeStandingDeclSpec(), clang::Sema::ParseTypedefDecl(), clang::NamedDecl::printNestedNameSpecifier(), clang::Sema::PushUsingDirective(), shouldConsiderLinkage(), ShouldDiagnoseUnusedDecl(), clang::Sema::tryCaptureVariable(), clang::Sema::UseArgumentDependentLookup(), 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().

◆ isInlineNamespace()

bool DeclContext::isInlineNamespace ( ) const

◆ isLookupContext()

bool clang::DeclContext::isLookupContext ( ) const
inline

Test whether the context supports looking up names.

Definition at line 2156 of file DeclBase.h.

References getDeclKind(), and isFunctionOrMethod().

◆ isNamespace()

bool clang::DeclContext::isNamespace ( ) const
inline

◆ isObjCContainer()

bool clang::DeclContext::isObjCContainer ( ) const
inline

◆ isRecord()

bool clang::DeclContext::isRecord ( ) const
inline

Definition at line 2170 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(), CheckAnonMemberRedeclaration(), clang::Sema::CheckClassTemplate(), CheckExplicitInstantiationScope(), clang::Sema::CheckExplicitObjectMemberFunction(), clang::Sema::CheckFunctionDeclaration(), CheckMultiVersionAdditionalDecl(), 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(), clang::exceptionSpecNotKnownYet(), 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(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarDecl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().

◆ isRequiresExprBody()

bool clang::DeclContext::isRequiresExprBody ( ) const
inline

Definition at line 2175 of file DeclBase.h.

References getDeclKind().

Referenced by clang::Sema::tryCaptureVariable().

◆ isStdNamespace()

bool DeclContext::isStdNamespace ( ) const

◆ isTranslationUnit()

bool clang::DeclContext::isTranslationUnit ( ) const
inline

Definition at line 2166 of file DeclBase.h.

References getDeclKind().

Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnTag(), clang::Sema::ActOnTypedefNameDecl(), clang::Sema::AddKnownFunctionAttributes(), clang::CodeCompletionBuilder::addParentContext(), AddTopLevelDeclarationToHash(), clang::Sema::BuildAnonymousStructOrUnion(), clang::Sema::CheckMain(), createFriendTagNNSFixIt(), clang::TypeName::createNestedNameSpecifierForScopeOf(), clang::TypeName::createOuterNNS(), diagnoseOpenCLTypes(), dumpDeclContext(), clang::FormatASTNodeDiagnosticArgument(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), clang::Decl::getTranslationUnitDecl(), clang::Sema::HandleDeclarator(), clang::Sema::ImplicitlyDefineFunction(), clang::ento::CheckerContext::isCLibraryFunction(), isDeclContextInNamespace(), clang::Sema::IsInsideALocalClassWithinATemplateFunction(), clang::FunctionDecl::isMain(), isMainVar(), 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().

◆ 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:

enum E {
Val1
};
Expr * E

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 1367 of file DeclBase.cpp.

References getDeclKind().

Referenced by clang::Sema::CheckClassTemplate(), clang::Sema::CheckFunctionConstraints(), getNonTransparentContext(), and getRedeclContext().

◆ localUncachedLookup()

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 1949 of file DeclBase.cpp.

References clang::DeclContextLookupResult::begin(), D, clang::DeclContextLookupResult::end(), FirstDecl, clang::Decl::getNextDeclInContext(), hasExternalLexicalStorage(), hasExternalVisibleStorage(), and lookup().

◆ 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 1852 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::DiagRedefinedPlaceholderFieldDecl(), clang::ExternalSource::FindExternalVisibleDeclsByName(), 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(), getGlobalStreamPointerByName(), clang::ObjCContainerDecl::getIvarDecl(), getLambdaCallOperatorHelper(), getLambdaStaticInvokers(), clang::ObjCContainerDecl::getMethod(), clang::ObjCContainerDecl::getProperty(), GetRuntimeFunctionDecl(), hasConflictingOverload(), clang::ObjCContainerDecl::HasUserDeclaredSetterMethod(), clang::Sema::InstantiateClassMembers(), clang::TemplateDeclInstantiator::InstantiateTypeAliasTemplateDecl(), 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(), shouldAddReversedEqEq(), clang::Sema::tryLookupUnambiguousFieldDecl(), and using_directives().

◆ lookups()

DeclContext::lookups_range clang::DeclContext::lookups ( ) const
inline

◆ lookups_begin()

all_lookups_iterator clang::DeclContext::lookups_begin ( ) const

Iterators over all possible lookups within this context.

◆ lookups_end()

all_lookups_iterator clang::DeclContext::lookups_end ( ) const

◆ 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 2043 of file DeclBase.cpp.

References D, 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::RegisterLocallyScopedExternCDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().

◆ noload_decls()

decl_range clang::DeclContext::noload_decls ( ) const
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 2358 of file DeclBase.h.

References noload_decls_begin(), and noload_decls_end().

Referenced by CXXRecordNonInlineHasAttr(), and clang::ASTNodeTraverser< Derived, NodeDelegateType >::dumpDeclContext().

◆ noload_decls_begin()

decl_iterator clang::DeclContext::noload_decls_begin ( ) const
inline

Definition at line 2361 of file DeclBase.h.

References FirstDecl.

Referenced by noload_decls().

◆ noload_decls_end()

decl_iterator clang::DeclContext::noload_decls_end ( ) const
inline

Definition at line 2362 of file DeclBase.h.

Referenced by noload_decls().

◆ noload_lookup()

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 1917 of file DeclBase.cpp.

References getDeclKind(), getParent(), getPrimaryContext(), and noload_lookup().

Referenced by noload_lookup(), clang::ASTDeclWriter::VisitClassTemplateDecl(), and clang::ASTNodeImporter::VisitRecordDecl().

◆ noload_lookups()

DeclContext::lookups_range clang::DeclContext::noload_lookups ( bool  PreserveInternalState) const
inline

Definition at line 89 of file DeclLookups.h.

References getLookupPtr(), and getPrimaryContext().

Referenced by clang::ASTDumper::dumpLookups().

◆ noload_lookups_begin()

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.

◆ noload_lookups_end()

all_lookups_iterator clang::DeclContext::noload_lookups_end ( ) const

◆ removeDecl()

void DeclContext::removeDecl ( Decl D)

◆ setHasExternalLexicalStorage()

void clang::DeclContext::setHasExternalLexicalStorage ( bool  ES = true) const
inline

State whether this DeclContext has external storage for declarations lexically in this context.

Definition at line 2671 of file DeclBase.h.

References DeclContextBits.

Referenced by clang::ExternalSource::completeVisibleDeclsMap(), DeclContext(), and clang::HLSLExternalSemaSource::InitializeSema().

◆ setHasExternalVisibleStorage()

void clang::DeclContext::setHasExternalVisibleStorage ( bool  ES = true) const
inline

State whether this DeclContext has external storage for declarations visible in this context.

Definition at line 2683 of file DeclBase.h.

References DeclContextBits.

Referenced by DeclContext(), and clang::IncrementalSyntaxOnlyAction::ExecuteAction().

◆ 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 2650 of file DeclBase.h.

References DeclContextBits, and getPrimaryContext().

◆ setUseQualifiedLookup()

void clang::DeclContext::setUseQualifiedLookup ( bool  use = true) const
inline

Definition at line 2696 of file DeclBase.h.

References DeclContextBits.

Referenced by DeclContext(), and clang::Sema::LookupQualifiedName().

◆ shouldUseQualifiedLookup()

bool clang::DeclContext::shouldUseQualifiedLookup ( ) const
inline

Definition at line 2700 of file DeclBase.h.

References DeclContextBits.

Referenced by clang::Sema::LookupQualifiedName().

◆ using_directives()

DeclContext::udir_range DeclContext::using_directives ( ) const

Returns iterator range [First, Last) of UsingDirectiveDecls stored within this context.

Definition at line 2140 of file DeclBase.cpp.

References lookup(), and clang::Result.

Referenced by LookupQualifiedNameInUsingDirectives().

Friends And Related Function Documentation

◆ ASTDeclReader

friend class ASTDeclReader
friend

For makeDeclVisibleInContextImpl.

Definition at line 1438 of file DeclBase.h.

◆ ASTDeclWriter

friend class ASTDeclWriter
friend

For checking the new bits in the Serialization part.

Definition at line 1440 of file DeclBase.h.

◆ ASTWriter

friend class ASTWriter
friend

For hasNeedToReconcileExternalVisibleStorage, hasLazyLocalLexicalLookups, hasLazyExternalLexicalLookups.

Definition at line 1448 of file DeclBase.h.

◆ DependentDiagnostic

friend class DependentDiagnostic
friend

For CreateStoredDeclsMap.

Definition at line 1445 of file DeclBase.h.

◆ ExternalASTSource

friend class ExternalASTSource
friend

For reconcileExternalVisibleStorage, CreateStoredDeclsMap, hasNeedToReconcileExternalVisibleStorage.

Definition at line 1443 of file DeclBase.h.

Member Data Documentation

◆ 

union { ... } clang::DeclContext::@47

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

BlockDeclBitfields clang::DeclContext::BlockDeclBits

◆ CXXConstructorDeclBits

CXXConstructorDeclBitfields clang::DeclContext::CXXConstructorDeclBits

◆ DeclContextBits

DeclContextBitfields clang::DeclContext::DeclContextBits

◆ EnumDeclBits

EnumDeclBitfields clang::DeclContext::EnumDeclBits

◆ FirstDecl

Decl* clang::DeclContext::FirstDecl = nullptr
mutableprotected

FirstDecl - The first declaration stored within this declaration context.

Definition at line 2060 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().

◆ FunctionDeclBits

FunctionDeclBitfields clang::DeclContext::FunctionDeclBits

Definition at line 2025 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::getDefalutedOrDeletedInfo(), 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::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::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

Decl* clang::DeclContext::LastDecl = nullptr
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 2066 of file DeclBase.h.

Referenced by addHiddenDecl(), containsDecl(), isDeclInLexicalTraversal(), removeDecl(), and clang::RecordDecl::reorderDecls().

◆ LinkageSpecDeclBits

LinkageSpecDeclBitfields clang::DeclContext::LinkageSpecDeclBits

◆ NamespaceDeclBits

NamespaceDeclBitfields clang::DeclContext::NamespaceDeclBits

◆ ObjCContainerDeclBits

ObjCContainerDeclBitfields clang::DeclContext::ObjCContainerDeclBits

◆ ObjCMethodDeclBits

ObjCMethodDeclBitfields clang::DeclContext::ObjCMethodDeclBits

◆ OMPDeclareReductionDeclBits

OMPDeclareReductionDeclBitfields clang::DeclContext::OMPDeclareReductionDeclBits

◆ RecordDeclBits

RecordDeclBitfields clang::DeclContext::RecordDeclBits

Definition at line 2023 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().

◆ TagDeclBits

TagDeclBitfields clang::DeclContext::TagDeclBits

The documentation for this class was generated from the following files: