|
clang
5.0.0
|
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 | |
| typedef llvm::iterator_range < decl_iterator > | decl_range |
| typedef DeclContextLookupResult | lookup_result |
| typedef lookup_result::iterator | lookup_iterator |
| typedef llvm::iterator_range < all_lookups_iterator > | lookups_range |
| typedef llvm::iterator_adaptor_base < udir_iterator, lookup_iterator, std::random_access_iterator_tag, UsingDirectiveDecl * > | udir_iterator_base |
| typedef llvm::iterator_range < udir_iterator > | udir_range |
| typedef llvm::iterator_range < DeclContext::ddiag_iterator > | ddiag_range |
Public Member Functions | |
| ~DeclContext () | |
| Decl::Kind | getDeclKind () const |
| const char * | getDeclKindName () const |
| DeclContext * | getParent () |
| getParent - Returns the containing DeclContext. More... | |
| const DeclContext * | getParent () const |
| DeclContext * | getLexicalParent () |
| getLexicalParent - Returns the containing lexical DeclContext. More... | |
| const DeclContext * | getLexicalParent () const |
| DeclContext * | getLookupParent () |
| Find the parent context of this context that will be used for unqualified name lookup. More... | |
| const DeclContext * | getLookupParent () const |
| ASTContext & | getParentASTContext () const |
| bool | isClosure () const |
| bool | isObjCContainer () const |
| bool | isFunctionOrMethod () const |
| bool | isLookupContext () const |
| Test whether the context supports looking up names. More... | |
| 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. More... | |
| 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. More... | |
| bool | isExternCContext () const |
| Determines whether this context or some of its ancestors is a linkage specification context that specifies C linkage. More... | |
| const LinkageSpecDecl * | getExternCContext () const |
| Retrieve the nearest enclosing C linkage specification context. More... | |
| bool | isExternCXXContext () const |
| Determines whether this context or some of its ancestors is a linkage specification context that specifies C++ linkage. More... | |
| bool | Equals (const DeclContext *DC) const |
| Determine whether this declaration context is equivalent to the declaration context DC. More... | |
| bool | Encloses (const DeclContext *DC) const |
| Determine whether this declaration context encloses the declaration context DC. More... | |
| Decl * | getNonClosureAncestor () |
| Find the nearest non-closure ancestor of this context, i.e. More... | |
| const Decl * | getNonClosureAncestor () 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. More... | |
| 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. More... | |
| const DeclContext * | getRedeclContext () const |
| DeclContext * | getEnclosingNamespaceContext () |
| Retrieve the nearest enclosing namespace context. More... | |
| const DeclContext * | getEnclosingNamespaceContext () const |
| RecordDecl * | getOuterLexicalRecordContext () |
| Retrieve the outermost lexically enclosing record context. More... | |
| 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. More... | |
| void | collectAllContexts (SmallVectorImpl< DeclContext * > &Contexts) |
| Collects all of the declaration contexts that are semantically connected to this declaration context. More... | |
| decl_range | decls () const |
| decls_begin/decls_end - Iterate over the declarations stored in this context. More... | |
| 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. More... | |
| decl_iterator | noload_decls_begin () const |
| decl_iterator | noload_decls_end () const |
| void | addDecl (Decl *D) |
| Add the declaration D into this context. More... | |
| void | addDeclInternal (Decl *D) |
| Add the declaration D into this context, but suppress searches for external declarations with the same name. More... | |
| void | addHiddenDecl (Decl *D) |
| Add the declaration D to this context without modifying any lookup tables. More... | |
| void | removeDecl (Decl *D) |
| Removes a declaration from this context. More... | |
| bool | containsDecl (Decl *D) const |
| Checks whether a declaration is in this context. More... | |
| lookup_result | lookup (DeclarationName Name) const |
| lookup - Find the declarations (if any) with the given Name in this context. More... | |
| 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. More... | |
| 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. More... | |
| void | makeDeclVisibleInContext (NamedDecl *D) |
| Makes a declaration visible within this context. More... | |
| lookups_range | lookups () const |
| lookups_range | noload_lookups () const |
| all_lookups_iterator | lookups_begin () const |
| Iterators over all possible lookups within this context. More... | |
| 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. More... | |
| all_lookups_iterator | noload_lookups_end () const |
| udir_range | using_directives () const |
| Returns iterator range [First, Last) of UsingDirectiveDecls stored within this context. More... | |
| 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). More... | |
| StoredDeclsMap * | getLookupPtr () const |
| Retrieve the internal representation of the lookup structure. More... | |
| StoredDeclsMap * | buildLookup () |
| Ensure the lookup structure is fully-built and return it. More... | |
| bool | hasExternalLexicalStorage () const |
| Whether this DeclContext has external storage containing additional declarations that are lexically in this context. More... | |
| void | setHasExternalLexicalStorage (bool ES=true) |
| State whether this DeclContext has external storage for declarations lexically in this context. More... | |
| bool | hasExternalVisibleStorage () const |
| Whether this DeclContext has external storage containing additional declarations that are visible in this context. More... | |
| void | setHasExternalVisibleStorage (bool ES=true) |
| State whether this DeclContext has external storage for declarations visible in this context. More... | |
| bool | isDeclInLexicalTraversal (const Decl *D) const |
| Determine whether the given declaration is stored in the list of declarations lexically within this context. More... | |
| bool | setUseQualifiedLookup (bool use=true) |
| bool | shouldUseQualifiedLookup () 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. More... | |
Protected Attributes | |
| Decl * | FirstDecl |
| FirstDecl - The first declaration stored within this declaration context. More... | |
| Decl * | LastDecl |
| LastDecl - The last declaration stored within this declaration context. More... | |
Friends | |
| class | ExternalASTSource |
| class | ASTDeclReader |
| class | ASTWriter |
| class | DependentDiagnostic |
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 NamespaceDecl FunctionDecl TagDecl ObjCMethodDecl ObjCContainerDecl LinkageSpecDecl ExportDecl BlockDecl OMPDeclareReductionDecl
Definition at line 1215 of file DeclBase.h.
| typedef llvm::iterator_range<DeclContext::ddiag_iterator> clang::DeclContext::ddiag_range |
Definition at line 1812 of file DeclBase.h.
| typedef llvm::iterator_range<decl_iterator> clang::DeclContext::decl_range |
Definition at line 1533 of file DeclBase.h.
Definition at line 1737 of file DeclBase.h.
Definition at line 1736 of file DeclBase.h.
| typedef llvm::iterator_range<all_lookups_iterator> clang::DeclContext::lookups_range |
Definition at line 1781 of file DeclBase.h.
| typedef llvm::iterator_adaptor_base<udir_iterator, lookup_iterator, std::random_access_iterator_tag, UsingDirectiveDecl *> clang::DeclContext::udir_iterator_base |
Definition at line 1798 of file DeclBase.h.
| typedef llvm::iterator_range<udir_iterator> clang::DeclContext::udir_range |
Definition at line 1807 of file DeclBase.h.
|
inlineprotected |
Definition at line 1277 of file DeclBase.h.
| DeclContext::~DeclContext | ( | ) |
Definition at line 970 of file DeclBase.cpp.
| 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 1396 of file DeclBase.cpp.
References addHiddenDecl().
Referenced by clang::Sema::ActOnBlockStart(), clang::Sema::ActOnCapturedRegionStart(), clang::Sema::ActOnEmptyDeclaration(), clang::Sema::ActOnExceptionDeclarator(), clang::Sema::ActOnFileScopeAsmDecl(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFriendTypeDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnModuleImport(), clang::Sema::ActOnOpenMPDeclareReductionDirectiveStart(), clang::Sema::ActOnOpenMPFirstprivateClause(), 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(), addAsFieldToClosureType(), addBlockPointerConversion(), clang::ObjCImplDecl::addClassMethod(), addFieldToRecordDecl(), addFunctionPointerConversion(), clang::ObjCImplDecl::addInstanceMethod(), clang::ObjCImplDecl::addPropertyImplementation(), clang::Sema::BuildAnonymousStructOrUnion(), clang::ASTContext::buildBuiltinTemplateDecl(), clang::Sema::buildInitCaptureField(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildModuleInclude(), clang::Sema::BuildStaticAssertDeclaration(), clang::Sema::BuildUsingDeclaration(), clang::Sema::BuildUsingPackDecl(), clang::Sema::BuildUsingShadowDecl(), captureInCapturedRegion(), captureThis(), captureVariablyModifiedType(), clang::Sema::CheckImplementationIvars(), CreateAAPCSABIBuiltinVaListDecl(), CreateAArch64ABIBuiltinVaListDecl(), clang::Sema::CreateCapturedStmtRecordDecl(), 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::HandleField(), clang::Sema::HandleMSProperty(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::Sema::LazilyCreateBuiltin(), clang::Sema::ProcessPropertyDecl(), clang::Sema::PushUsingDirective(), 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 1404 of file DeclBase.cpp.
References addHiddenDecl().
Referenced by clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTNodeImporter::VisitLabelDecl(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), 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::VisitRecordDecl(), clang::ASTNodeImporter::VisitStaticAssertDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitVarDecl(), 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 1370 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 1173 of file DeclBase.cpp.
References I, and clang::Decl::NextInContextAndBits.
| 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 1445 of file DeclBase.cpp.
References collectAllContexts(), Contexts, getPrimaryContext(), and hasExternalVisibleStorage().
Definition at line 952 of file DeclBase.cpp.
References clang::Decl::getKind().
|
inlinestatic |
Definition at line 1878 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 1156 of file DeclBase.cpp.
References clang::NamedDecl::getMostRecentDecl(), and clang::Decl::getPreviousDecl().
Referenced by buildLookup(), and noload_lookup().
Checks whether a declaration is in this context.
Definition at line 1319 of file DeclBase.cpp.
References clang::Decl::getLexicalDeclContext(), LastDecl, and clang::Decl::NextInContextAndBits.
Referenced by clang::Sema::ActOnFunctionDeclarator(), and clang::Sema::CreateUnaryExprOrTypeTraitExpr().
|
inline |
Definition at line 174 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 1537 of file DeclBase.h.
References decls_begin(), and decls_end().
Referenced by clang::Sema::ActOnFields(), clang::Sema::ActOnStartOfFunctionDef(), clang::ODRHash::AddCXXRecordDecl(), AddInterfaceResults(), clang::CallGraph::addNodesForBlocks(), AddProtocolResults(), clang::Sema::BuildAnonymousStructOrUnion(), CheckAbstractClassUsage(), clang::Sema::checkClassLevelDLLAttribute(), checkForMultipleExportedDefaultConstructors(), checkMemberDecomposition(), clang::Sema::CodeCompleteObjCInterfaceCategory(), diagnoseBadDirectAccess(), DiagnoseNamespaceInlineMismatch(), clang::Sema::DiagnoseUnusedNestedTypedefs(), findDefaultInitializer(), clang::tooling::getNamedDeclAt(), GroupNewVirtualOverloads(), clang::ASTNodeImporter::ImportDeclContext(), clang::index::IndexingContext::indexDeclContext(), InjectAnonymousStructOrUnionMembers(), clang::Sema::InstantiateClass(), clang::Sema::InstantiateClassMembers(), clang::serialization::numberAnonymousDeclsWithin(), ReferenceDllExportedMethods(), Scan(), and clang::Sema::SetCtorInitializers().
| DeclContext::decl_iterator DeclContext::decls_begin | ( | ) | const |
Definition at line 1306 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::LinkageSpecDecl::getLocEnd(), 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(), and clang::ObjCImplDecl::propimpl_begin().
| bool DeclContext::decls_empty | ( | ) | const |
Definition at line 1312 of file DeclBase.cpp.
References FirstDecl, and hasExternalLexicalStorage().
Referenced by clang::LinkageSpecDecl::getLocEnd().
|
inline |
Definition at line 1539 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(), and clang::ObjCImplDecl::propimpl_end().
| LLVM_DUMP_METHOD void DeclContext::dumpDeclContext | ( | ) | const |
Definition at line 188 of file DeclPrinter.cpp.
References getParent(), clang::ASTContext::getPrintingPolicy(), and isTranslationUnit().
| LLVM_DUMP_METHOD void DeclContext::dumpLookups | ( | ) | const |
Definition at line 2550 of file ASTDumper.cpp.
| 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 1080 of file DeclBase.cpp.
References Encloses(), getParent(), and getPrimaryContext().
Referenced by clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::CheckClassTemplate(), CheckExplicitInstantiationScope(), clang::Sema::CheckShadow(), CheckTemplateSpecializationScope(), diagnoseInstanceReference(), clang::Sema::diagnoseQualifiedDeclaration(), DiagnoseTwoPhaseLookup(), DoMarkVarDeclReferenced(), Encloses(), findOuterContext(), getRequiredQualification(), isAcceptableTagRedeclContext(), and clang::Sema::PushOnScopeChains().
|
inline |
Determine whether this declaration context is equivalent to the declaration context DC.
Definition at line 1414 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::NamedDecl::declarationReplaces(), diagnoseInstanceReference(), clang::Sema::diagnoseQualifiedDeclaration(), clang::Sema::FindInstantiatedDecl(), findOuterContext(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), InEnclosingNamespaceSetOf(), isAcceptableTagRedeclContext(), clang::CXXRecordDecl::isCurrentInstantiation(), clang::IdentifierResolver::isDeclInScope(), clang::Decl::isOutOfLine(), isOutOfScopePreviousDeclaration(), isSameEntity(), clang::Sema::LookupName(), LookupVisibleDecls(), MaybeAddOverrideCalls(), clang::Sema::PushOnScopeChains(), and clang::Sema::tryCaptureVariable().
|
inline |
Definition at line 1288 of file DeclBase.h.
Referenced by clang::Decl::castFromDeclContext(), clang::serialization::getDefinitiveDeclContext(), getExternCContext(), getKind(), clang::Sema::getObjCContainerKind(), getOutermostFuncOrBlockContext(), clang::VarDecl::isFunctionOrMethodVarDecl(), isLinkageSpecContext(), and IsUsingDirectiveInToplevelContext().
| const char * DeclContext::getDeclKindName | ( | ) | const |
Definition at line 134 of file DeclBase.cpp.
| DeclContext * DeclContext::getEnclosingNamespaceContext | ( | ) |
Retrieve the nearest enclosing namespace context.
Definition at line 1642 of file DeclBase.cpp.
References getParent(), getPrimaryContext(), and isFileContext().
Referenced by clang::Sema::ActOnTag(), CheckExplicitInstantiationScope(), CheckTemplateSpecializationScope(), getEnclosingNamespaceContext(), clang::AnalysisDeclContext::isInStdNamespace(), and isOutOfScopePreviousDeclaration().
|
inline |
Definition at line 1451 of file DeclBase.h.
References getEnclosingNamespaceContext().
| const LinkageSpecDecl * DeclContext::getExternCContext | ( | ) | const |
Retrieve the nearest enclosing C linkage specification context.
Definition at line 1064 of file DeclBase.cpp.
References getDeclKind(), getLexicalParent(), and clang::LinkageSpecDecl::lang_c.
Referenced by clang::Sema::CheckLiteralOperatorDeclaration(), and clang::Sema::CheckTemplateDeclScope().
|
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 1310 of file DeclBase.h.
Referenced by clang::Sema::ActOnModuleBegin(), clang::Sema::ActOnModuleEnd(), clang::Sema::ActOnReenterFunctionContext(), basicGVALinkageForVariable(), clang::Sema::CheckShadow(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::getContainingDC(), clang::Sema::getCurrentMangleNumberContext(), getExternCContext(), getLexicalParent(), getLookupParent(), getOuterLexicalRecordContext(), isDependentContext(), clang::Decl::isExported(), isInInlineFunction(), clang::Decl::isLexicallyWithinFunctionOrMethod(), and isLinkageSpecContext().
|
inline |
Definition at line 1313 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 978 of file DeclBase.cpp.
References getLexicalParent(), getParent(), getRedeclContext(), isFileContext(), and isRecord().
Referenced by clang::Sema::CheckClassTemplate(), clang::Sema::CheckTemplateIdType(), findRecordWithDependentBasesOfEnclosingMethod(), getLookupParent(), LookupVisibleDecls(), and synthesizeCurrentNestedNameSpecifier().
|
inline |
Definition at line 1319 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 1833 of file DeclBase.h.
Referenced by 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 944 of file DeclBase.cpp.
References getNonClosureContext().
Referenced by getNonClosureAncestor(), clang::Sema::isSelfExpr(), and LookupMethodInReceiverType().
|
inline |
Definition at line 1426 of file DeclBase.h.
References getNonClosureAncestor().
| RecordDecl * DeclContext::getOuterLexicalRecordContext | ( | ) |
Retrieve the outermost lexically enclosing record context.
Definition at line 1650 of file DeclBase.cpp.
References getLexicalParent(), and isRecord().
Referenced by clang::Sema::BuildCXXDefaultInitExpr(), getOuterLexicalRecordContext(), and clang::Sema::InstantiateInClassInitializer().
|
inline |
Definition at line 1457 of file DeclBase.h.
References getOuterLexicalRecordContext().
|
inline |
getParent - Returns the containing DeclContext.
Definition at line 1294 of file DeclBase.h.
Referenced by clang::Sema::ActOnFinishFullExpr(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnSEHTryBlock(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::ActOnSuperScopeSpecifier(), clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::ODRHash::AddCXXRecordDecl(), clang::Sema::adjustContextForLocalExternDecl(), adjustCVQualifiersForCXXThisWithinLambda(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckAddressOfOperand(), clang::Sema::CheckCompareOperands(), CheckConstexprFunction(), clang::Sema::CheckConstructorAccess(), checkDeclInTargetContext(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), checkModuleImportContext(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckShadow(), clang::Sema::CheckUsingShadowDecl(), ClassifyImplicitMemberAccess(), CollectEnclosingNamespace(), clang::PredefinedExpr::ComputeName(), clang::Sema::CreateCapturedStmtRecordDecl(), createFriendTagNNSFixIt(), clang::Sema::createLambdaClosureType(), clang::ASTContext::DeclMustBeEmitted(), diagnoseBadDirectAccess(), clang::Sema::DiagnoseClassNameShadow(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), DiagnoseNamespaceInlineMismatch(), clang::Sema::diagnoseQualifiedDeclaration(), DiagnoseTwoPhaseLookup(), diagnoseUncapturableValueReference(), dumpDeclContext(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(), Encloses(), clang::Sema::FindInstantiatedDecl(), findOuterContext(), clang::ObjCMethodDecl::findPropertyDecl(), findRecordWithDependentBasesOfEnclosingMethod(), getAllNamedNamespaces(), getBestNamespaceSubstr(), clang::Sema::getCurMethodDecl(), clang::Sema::getCurrentMangleNumberContext(), getEnclosingNamespaceContext(), clang::ento::LikelyFalsePositiveSuppressionBRVisitor::getEndPath(), clang::Sema::getFunctionLevelDeclContext(), clang::getLambdaAwareParentOfDeclContext(), getLookupParent(), getLVForNamespaceScopeDecl(), getNonClosureContext(), getNullabilityCompletenessCheckFileID(), getOutermostEnclosingLambda(), getOutermostFuncOrBlockContext(), getParent(), clang::CXXMethodDecl::getParent(), clang::CodeCompletionTUInfo::getParentName(), getRedeclContext(), clang::AnalysisDeclContext::getSelfDecl(), getTagInjectionContext(), clang::Sema::getTemplateInstantiationArgs(), clang::Decl::getTranslationUnitDecl(), handleIBOutletCollection(), clang::Sema::handleTagNumbering(), clang::CodeGen::CodeGenModule::HasHiddenLTOVisibility(), InEnclosingNamespaceSetOf(), clang::CXXRecordDecl::isCurrentInstantiation(), isDependentContext(), clang::Decl::isInAnonymousNamespace(), clang::Sema::IsInsideALocalClassWithinATemplateFunction(), clang::AnalysisDeclContext::isInStdNamespace(), clang::Expr::isPotentialConstantExpr(), isReferenceToNonConstCapture(), isStdNamespace(), IsUsingDirectiveInToplevelContext(), clang::MangleContext::mangleBlock(), clang::Sema::MatchTemplateParametersToScopeSpecifier(), MaybeAddOverrideCalls(), clang::CodeGen::CGRecordLayout::print(), clang::NamedDecl::printQualifiedName(), recoverFromMSUnqualifiedLookup(), clang::Sema::SubstituteExplicitTemplateArguments(), clang::Sema::tryCaptureVariable(), clang::FunctionCallFilterCCC::ValidateCandidate(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), clang::ASTDeclWriter::VisitDecl(), and clang::ASTDeclWriter::VisitNamespaceDecl().
|
inline |
Definition at line 1297 of file DeclBase.h.
References getParent().
|
inline |
Definition at line 1323 of file DeclBase.h.
Referenced by clang::CXXRecordDecl::getLambdaContextDecl(), clang::Type::getObjCSubstitutions(), lookup(), lookups(), clang::ExternalASTSource::SetExternalVisibleDeclsForName(), clang::ExternalASTSource::SetNoExternalVisibleDeclsForName(), and clang::QualType::substObjCMemberType().
| 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 1090 of file DeclBase.cpp.
References clang::ObjCInterfaceDecl::getDefinition(), clang::ObjCProtocolDecl::getDefinition(), clang::TagDecl::getDefinition(), clang::TypeDecl::getTypeForDecl(), and clang::TagDecl::isBeingDefined().
Referenced by buildLookup(), CollectEnclosingNamespace(), ddiags(), Encloses(), Equals(), clang::ASTReader::FindExternalVisibleDeclsByName(), findRecordWithDependentBasesOfEnclosingMethod(), getEnclosingNamespaceContext(), getPrimaryContext(), clang::Sema::getScopeForContext(), clang::Sema::getScopeForDeclContext(), lookup(), lookups(), LookupVisibleDecls(), makeDeclVisibleInContext(), MightInstantiateTo(), noload_lookup(), noload_lookups(), setMustBuildLookupTable(), synthesizeCurrentNestedNameSpecifier(), and clang::ASTDeclWriter::VisitNamespaceDecl().
|
inline |
Definition at line 1437 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 1634 of file DeclBase.cpp.
References getParent(), and isTransparentContext().
Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnTag(), clang::Sema::ActOnTypedefNameDecl(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), CheckExplicitInstantiationScope(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::Sema::CheckObjCDeclScope(), CheckOperatorNewDeleteDeclarationScope(), clang::Sema::CheckShadow(), clang::Sema::CheckTemplateDeclScope(), CheckTemplateSpecializationScope(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::CheckUsingDeclRedeclaration(), clang::ASTReader::CompleteRedeclChain(), computeLVForDecl(), createFriendTagNNSFixIt(), clang::TypeName::createNestedNameSpecifierForScopeOf(), clang::NamedDecl::declarationReplaces(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::FinalizeDeclaration(), getContextForScopeMatching(), getDeclForLocalLookup(), getFunctionStorageClass(), getLookupParent(), getLVForClosure(), getLVForNamespaceScopeDecl(), 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::FunctionDecl::isReservedGlobalPlacementOperator(), isSameEntity(), isStdNamespace(), clang::Sema::LookupName(), clang::Sema::PushOnScopeChains(), clang::Sema::RegisterLocallyScopedExternCDecl(), shouldConsiderLinkage(), clang::Sema::ShouldEnterDeclaratorScope(), clang::IdentifierResolver::tryAddTopLevelDecl(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTDeclWriter::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitObjCInterfaceDecl(), clang::ASTNodeImporter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), clang::ASTNodeImporter::VisitObjCProtocolDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
|
inline |
Definition at line 1445 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 1840 of file DeclBase.h.
Referenced by decls_begin(), decls_empty(), clang::RecordDecl::field_begin(), clang::ASTContext::getASTRecordLayout(), localUncachedLookup(), and clang::ASTNodeImporter::VisitRecordDecl().
|
inline |
Whether this DeclContext has external storage containing additional declarations that are visible in this context.
Definition at line 1850 of file DeclBase.h.
Referenced by buildLookup(), clang::ASTReader::completeVisibleDeclsMap(), clang::ASTReader::FindExternalVisibleDeclsByName(), localUncachedLookup(), lookup(), lookups(), and noload_lookup().
| 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 1661 of file DeclBase.cpp.
References Equals(), getParent(), isFileContext(), and clang::NamespaceDecl::isInline().
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), CheckExplicitInstantiationScope(), clang::Sema::CheckFunctionTemplateSpecialization(), CheckTemplateSpecializationScope(), clang::IdentifierResolver::isDeclInScope(), and clang::Sema::isStdInitializerList().
|
inline |
Definition at line 1327 of file DeclBase.h.
Referenced by clang::FormatASTNodeDiagnosticArgument().
Determine whether the given declaration is stored in the list of declarations lexically within this context.
Definition at line 1862 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 1009 of file DeclBase.cpp.
References getLexicalParent(), getParent(), isDependentContext(), and isFileContext().
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnCXXEnterDeclaratorScope(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnDependentTemplateName(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), ActOnOMPReductionKindClause(), clang::Sema::ActOnOpenMPAtomicDirective(), clang::Sema::ActOnOpenMPDependClause(), clang::Sema::ActOnOpenMPDistributeDirective(), clang::Sema::ActOnOpenMPDistributeParallelForDirective(), clang::Sema::ActOnOpenMPDistributeParallelForSimdDirective(), clang::Sema::ActOnOpenMPDistributeSimdDirective(), clang::Sema::ActOnOpenMPDistScheduleClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPForDirective(), clang::Sema::ActOnOpenMPForSimdDirective(), clang::Sema::ActOnOpenMPLastprivateClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPParallelForDirective(), clang::Sema::ActOnOpenMPParallelForSimdDirective(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::ActOnOpenMPScheduleClause(), clang::Sema::ActOnOpenMPSharedClause(), clang::Sema::ActOnOpenMPSimdDirective(), clang::Sema::ActOnOpenMPTargetParallelForDirective(), clang::Sema::ActOnOpenMPTargetParallelForSimdDirective(), clang::Sema::ActOnOpenMPTargetSimdDirective(), clang::Sema::ActOnOpenMPTargetTeamsDistributeDirective(), clang::Sema::ActOnOpenMPTargetTeamsDistributeParallelForDirective(), clang::Sema::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(), clang::Sema::ActOnOpenMPTargetTeamsDistributeSimdDirective(), clang::Sema::ActOnOpenMPTaskLoopDirective(), clang::Sema::ActOnOpenMPTaskLoopSimdDirective(), clang::Sema::ActOnOpenMPTeamsDistributeDirective(), clang::Sema::ActOnOpenMPTeamsDistributeParallelForDirective(), clang::Sema::ActOnOpenMPTeamsDistributeParallelForSimdDirective(), clang::Sema::ActOnOpenMPTeamsDistributeSimdDirective(), clang::Sema::ActOnVariableDeclarator(), clang::ASTRecordWriter::AddFunctionDefinition(), AddOrdinaryNameResults(), clang::CXXMethodDecl::addOverriddenMethod(), AddRecordMembersCompletionResults(), clang::Sema::adjustContextForLocalExternDecl(), clang::Sema::BuildBaseInitializer(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildDelegatingInitializer(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::buildOverloadedCallSet(), clang::Sema::BuildVariableInstantiation(), CanDeclareSpecialMemberFunction(), clang::Sema::CheckClassTemplate(), checkForMultipleExportedDefaultConstructors(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), checkMoveAssignmentForRepeatedMove(), CheckOpenMPIterationSpace(), CheckOpenMPLoop(), clang::Sema::CheckParmsForFunctionDef(), clang::Sema::CheckPureMethod(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplatePartialSpecializationArgs(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::checkVarDeclRedefinition(), computeDeclRefDependence(), ddiags(), clang::Sema::DeclareImplicitDeductionGuides(), clang::ASTContext::DeclMustBeEmitted(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), DiagnoseBaseOrMemInitializerOrder(), clang::CodeGen::CodeGenModule::EmitTopLevelDecl(), clang::Sema::FinalizeVarWithDestructor(), clang::Sema::FindInstantiatedDecl(), findRecordWithDependentBasesOfEnclosingMethod(), clang::CXXRecordDecl::forallBases(), getCurrentInstantiationOf(), clang::Sema::getDestructorName(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), clang::Sema::getTypeName(), clang::Sema::HandleDeclarator(), clang::CXXRecordDecl::hasAnyDependentBases(), clang::CXXRecordDecl::isCurrentInstantiation(), clang::TemplateArgument::isDependent(), isDependentContext(), IsDerivedFromInclusive(), clang::TemplateArgument::isInstantiationDependent(), IsKnownEmitted(), 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::SetCtorInitializers(), clang::Sema::shouldLinkDependentDeclWithPrevious(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), and clang::Sema::startLambdaDefinition().
| 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 1060 of file DeclBase.cpp.
References isLinkageSpecContext(), and clang::LinkageSpecDecl::lang_c.
Referenced by clang::Sema::ActOnFields(), clang::Sema::ActOnStartOpenMPDeclareTargetDirective(), clang::Sema::CheckTemplateDeclScope(), clang::VarDecl::isInExternCContext(), and clang::FunctionDecl::isInExternCContext().
| 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 1076 of file DeclBase.cpp.
References isLinkageSpecContext(), and clang::LinkageSpecDecl::lang_cxx.
Referenced by clang::Sema::ActOnStartOpenMPDeclareTargetDirective(), clang::VarDecl::isInExternCXXContext(), and clang::FunctionDecl::isInExternCXXContext().
|
inline |
Definition at line 1360 of file DeclBase.h.
Referenced by clang::Sema::ActOnDeclarator(), clang::Sema::ActOnFinishObjCImplementation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnStartOpenMPDeclareTargetDirective(), clang::Sema::ActOnTag(), clang::Sema::ActOnTagFinishDefinition(), clang::ASTUnit::addFileLevelDecl(), clang::Sema::adjustContextForLocalExternDecl(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckTemplateDeclScope(), clang::Sema::CodeCompleteNamespaceDecl(), CollectEnclosingNamespace(), computeLVForDecl(), computeShadowedDeclKind(), CppNamespaceLookup(), clang::Sema::CreateCapturedStmtRecordDecl(), clang::Sema::createLambdaClosureType(), clang::Sema::FinalizeDeclaration(), clang::Sema::FindInstantiatedDecl(), findOuterContext(), getDefiningModule(), clang::Sema::getDestructorName(), getEnclosingNamespaceContext(), clang::ASTContext::getInlineVariableDefinitionKind(), getLookupParent(), getLVForNamespaceScopeDecl(), getTagInjectionContext(), clang::Sema::getTemplateInstantiationArgs(), clang::Sema::HandleDeclarator(), clang::Sema::hasVisibleMemberSpecialization(), InEnclosingNamespaceSetOf(), clang::CXXRecordDecl::isCurrentInstantiation(), isDependentContext(), isInInlineFunction(), isNamespaceOrTranslationUnitScope(), isNamespaceScope(), clang::Sema::LookupQualifiedName(), LookupQualifiedNameInUsingDirectives(), mapCodeCompletionContext(), MightInstantiateTo(), shouldConsiderLinkage(), clang::Sema::ShouldEnterDeclaratorScope(), clang::Sema::shouldLinkDependentDeclWithPrevious(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
|
inline |
Definition at line 1343 of file DeclBase.h.
Referenced by clang::Sema::ActOnDecompositionDeclarator(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnSEHTryBlock(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::ActOnTag(), clang::Sema::ActOnVariableDeclarator(), clang::CodeCompletionBuilder::addParentContext(), clang::Sema::adjustContextForLocalExternDecl(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildUsingDeclaration(), clang::Sema::BuildVariableInstantiation(), CheckTemplateSpecializationScope(), computeCachedProperties(), computeLVForDecl(), clang::Sema::CreateCapturedStmtRecordDecl(), clang::Sema::createLambdaClosureType(), diagnoseUncapturableValueReference(), DoMarkVarDeclReferenced(), clang::Sema::FindInstantiatedDecl(), getContextForScopeMatching(), getFunctionStorageClass(), clang::CodeCompletionTUInfo::getParentName(), clang::MaterializeTemporaryExpr::getStorageDuration(), getTagInjectionContext(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), isConsumerInterestedIn(), clang::IdentifierResolver::isDeclInScope(), isDeclWithinFunction(), clang::VarDecl::isFunctionOrMethodVarDecl(), clang::Decl::isLexicallyWithinFunctionOrMethod(), isLookupContext(), isOutOfScopePreviousDeclaration(), LookupVisibleDecls(), clang::Sema::MergeFunctionDecl(), mergeTypeWithPrevious(), clang::Sema::ParsedFreeStandingDeclSpec(), clang::Sema::ParseTypedefDecl(), clang::NamedDecl::printQualifiedName(), clang::Sema::PushOnScopeChains(), clang::Sema::PushUsingDirective(), shouldConsiderLinkage(), ShouldDiagnoseUnusedDecl(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::ASTNodeImporter::VisitLabelDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTDeclReader::VisitVarDeclImpl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and warnAboutAmbiguousFunction().
| bool DeclContext::isInlineNamespace | ( | ) | const |
Definition at line 988 of file DeclBase.cpp.
References isNamespace().
Referenced by CollectEnclosingNamespace().
|
inline |
Test whether the context supports looking up names.
Definition at line 1355 of file DeclBase.h.
References isFunctionOrMethod().
|
inline |
Definition at line 1372 of file DeclBase.h.
Referenced by clang::Sema::ActOnOpenMPIdExpression(), clang::FunctionDecl::isGlobal(), isInlineNamespace(), clang::Sema::IsInsideALocalClassWithinATemplateFunction(), isStdNamespace(), and isStdNamespace().
|
inline |
Definition at line 1331 of file DeclBase.h.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnMethodDeclaration(), clang::Sema::CodeCompleteObjCAtDirective(), and clang::Sema::CodeCompleteObjCMethodDecl().
|
inline |
Definition at line 1368 of file DeclBase.h.
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnTag(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildAnonymousStructOrUnion(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckAddressOfOperand(), clang::Sema::CheckClassTemplate(), clang::comments::Sema::checkDeprecatedCommand(), CheckExplicitInstantiationScope(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckParameter(), clang::Sema::CheckQualifiedMemberReference(), CheckTemplateSpecializationScope(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::CheckUsingDeclRedeclaration(), clang::Sema::CheckUsingShadowDecl(), ClassifyMemberExpr(), CollectEnclosingNamespace(), computeLVForDecl(), clang::Sema::CreateCapturedStmtRecordDecl(), clang::Sema::createLambdaClosureType(), CreateNewFunctionDecl(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::diagnoseQualifiedDeclaration(), getDeclLanguageLinkage(), GetFullTypeForDeclarator(), getLookupParent(), getOuterLexicalRecordContext(), clang::Sema::getShadowedDeclaration(), clang::Sema::HandleDeclarator(), haveIncompatibleLanguageLinkages(), clang::Sema::InstantiateVariableDefinition(), clang::NamedDecl::isCXXClassMember(), isDeclExternC(), isDeclWithinFunction(), clang::RecordDecl::isInjectedClassName(), isOutOfScopePreviousDeclaration(), clang::VarDecl::isStaticDataMember(), mapCodeCompletionContext(), clang::Sema::MergeVarDecl(), shouldConsiderLinkage(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
| bool DeclContext::isStdNamespace | ( | ) | const |
Definition at line 993 of file DeclBase.cpp.
References clang::NamedDecl::getIdentifier(), getParent(), getRedeclContext(), clang::NamespaceDecl::isInline(), isNamespace(), isStdNamespace(), clang::IdentifierInfo::isStr(), and isTranslationUnit().
Referenced by clang::Sema::BuildUsingDeclaration(), clang::AnalysisDeclContext::isInStdNamespace(), clang::Decl::isInStdNamespace(), clang::Sema::isLibstdcxxEagerExceptionSpecHack(), and isStdNamespace().
|
inline |
Definition at line 1364 of file DeclBase.h.
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(), createFriendTagNNSFixIt(), clang::TypeName::createNestedNameSpecifierForScopeOf(), clang::TypeName::createOuterNNS(), dumpDeclContext(), clang::FormatASTNodeDiagnosticArgument(), clang::Decl::getParentFunctionOrMethod(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), clang::Sema::getTemplateInstantiationArgs(), clang::Decl::getTranslationUnitDecl(), clang::ento::CheckerContext::isCLibraryFunction(), clang::Sema::IsInsideALocalClassWithinATemplateFunction(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), isStdNamespace(), LookupDirect(), 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), and C++ linkage specifications.
Definition at line 1041 of file DeclBase.cpp.
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckQualifiedMemberReference(), CollectEnclosingNamespace(), clang::Sema::getNonFieldDeclScope(), getRedeclContext(), getTagInjectionScope(), clang::IdentifierResolver::isDeclInScope(), clang::Sema::LookupName(), and clang::Sema::PushOnScopeChains().
| 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 1597 of file DeclBase.cpp.
References clang::DeclContextLookupResult::begin(), clang::DeclContextLookupResult::end(), FirstDecl, clang::Decl::getNextDeclInContext(), hasExternalLexicalStorage(), hasExternalVisibleStorage(), lookup(), and Name.
Referenced by clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTNodeImporter::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitObjCInterfaceDecl(), clang::ASTNodeImporter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), clang::ASTNodeImporter::VisitObjCProtocolDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
| 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 1507 of file DeclBase.cpp.
References buildLookup(), clang::ExternalASTSource::FindExternalVisibleDeclsByName(), clang::ASTContext::getExternalSource(), getParentASTContext(), getPrimaryContext(), hasExternalVisibleStorage(), I, and lookup().
Referenced by clang::Sema::ArgumentDependentLookup(), clang::Sema::BuildBlockForLambdaConversion(), clang::Sema::BuildCXXDefaultInitExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::CheckCompletedCXXClass(), checkGlobalOrExternCConflict(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), CheckPropertyAgainstProtocol(), ClassImplementsAllMethodsAndProperties(), clang::ASTReader::CompleteRedeclChain(), configureBlocksRuntimeObject(), clang::Sema::DeclareGlobalAllocationFunction(), clang::Sema::DeclareImplicitDeductionGuides(), clang::CodeGen::CodeGenFunction::EmitBuiltinNewDeleteCall(), clang::CodeGen::emitUserDefinedReduction(), clang::Sema::FindHiddenVirtualMethods(), clang::Sema::findInheritingConstructor(), clang::Sema::FindInstantiatedDecl(), clang::Sema::findLocallyScopedExternCDecl(), clang::CXXRecordDecl::FindNestedNameSpecifierMember(), clang::CXXRecordDecl::FindOMPReductionMember(), findOrdinaryMember(), clang::ObjCPropertyDecl::findPropertyDecl(), clang::CXXRecordDecl::FindTagMember(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::CXXMethodDecl::getCorrespondingMethodInClass(), clang::CXXRecordDecl::getDestructor(), clang::ObjCContainerDecl::getIvarDecl(), clang::CXXRecordDecl::getLambdaCallOperator(), clang::CXXRecordDecl::getLambdaStaticInvoker(), clang::ObjCContainerDecl::getMethod(), GetRuntimeFunctionDecl(), hasMember(), clang::ObjCContainerDecl::HasUserDeclaredSetterMethod(), clang::Sema::InstantiateClassMembers(), clang::CXXMethodDecl::isUsualDeallocationFunction(), localUncachedLookup(), lookup(), LookupAnyMember(), clang::Sema::LookupConstructors(), clang::CXXRecordDecl::lookupDependentName(), LookupDirect(), clang::Sema::LookupSpecialMember(), lookupUnqualifiedTypeNameInBase(), clang::TreeTransform< Derived >::RebuildShuffleVectorExpr(), threadSafetyCheckIsSmartPointer(), using_directives(), and clang::ASTDeclReader::VisitDecl().
|
inline |
Definition at line 71 of file DeclLookups.h.
References buildLookup(), clang::ExternalASTSource::completeVisibleDeclsMap(), clang::ASTContext::getExternalSource(), getParentASTContext(), getPrimaryContext(), and hasExternalVisibleStorage().
Referenced by lookups_begin(), lookups_end(), and LookupVisibleDecls().
|
inline |
Iterators over all possible lookups within this context.
Definition at line 84 of file DeclLookups.h.
References lookups().
|
inline |
Definition at line 88 of file DeclLookups.h.
References lookups().
| 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 1679 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(), DiagnoseNamespaceInlineMismatch(), clang::Sema::RegisterLocallyScopedExternCDecl(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), 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 1545 of file DeclBase.h.
References noload_decls_begin(), and noload_decls_end().
Referenced by clang::StructuralEquivalenceContext::findUntaggedStructOrUnionIndex(), and getFieldIndex().
|
inline |
|
inline |
Definition at line 1549 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 1569 of file DeclBase.cpp.
References collectAllContexts(), Contexts, getPrimaryContext(), hasExternalVisibleStorage(), I, and noload_lookup().
Referenced by noload_lookup().
|
inline |
Definition at line 92 of file DeclLookups.h.
References getLookupPtr(), and getPrimaryContext().
Referenced by noload_lookups_begin(), and noload_lookups_end().
|
inline |
Iterators over all possible lookups within this context that are currently loaded; don't attempt to retrieve anything from an external source.
Definition at line 104 of file DeclLookups.h.
References noload_lookups().
|
inline |
Definition at line 109 of file DeclLookups.h.
References noload_lookups().
| void DeclContext::removeDecl | ( | Decl * | D | ) |
Removes a declaration from this context.
Definition at line 1324 of file DeclBase.cpp.
References FirstDecl, clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::Decl::getLexicalDeclContext(), I, LastDecl, and clang::Decl::NextInContextAndBits.
Referenced by clang::Sema::ActOnFunctionDeclarator(), and clang::Sema::HideUsingShadowDecl().
State whether this DeclContext has external storage for declarations lexically in this context.
Definition at line 1844 of file DeclBase.h.
State whether this DeclContext has external storage for declarations visible in this context.
Definition at line 1854 of file DeclBase.h.
|
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 1825 of file DeclBase.h.
References getPrimaryContext().
Definition at line 1867 of file DeclBase.h.
Referenced by clang::Sema::LookupQualifiedName().
|
inline |
Definition at line 1873 of file DeclBase.h.
| DeclContext::udir_range DeclContext::using_directives | ( | ) | const |
Returns iterator range [First, Last) of UsingDirectiveDecls stored within this context.
Definition at line 1788 of file DeclBase.cpp.
References clang::DeclContextLookupResult::begin(), clang::DeclContextLookupResult::end(), lookup(), and clang::Result.
Referenced by LookupQualifiedNameInUsingDirectives(), and LookupVisibleDecls().
|
friend |
Definition at line 1268 of file DeclBase.h.
|
friend |
Definition at line 1269 of file DeclBase.h.
|
friend |
Definition at line 1897 of file DeclBase.h.
|
friend |
Definition at line 1267 of file DeclBase.h.
|
mutableprotected |
FirstDecl - The first declaration stored within this declaration context.
Definition at line 1259 of file DeclBase.h.
Referenced by addHiddenDecl(), decls_begin(), decls_empty(), clang::RecordDecl::field_begin(), isDeclInLexicalTraversal(), localUncachedLookup(), noload_decls_begin(), and removeDecl().
|
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 1265 of file DeclBase.h.
Referenced by addHiddenDecl(), containsDecl(), isDeclInLexicalTraversal(), and removeDecl().
1.8.6