clang 22.0.0git
|
Decl - This represents one declaration (or definition), e.g. More...
#include "clang/AST/DeclBase.h"
Classes | |
struct | EmptyShell |
A placeholder type used to construct an empty shell of a decl-derived type that will be filled in later (e.g., by some deserialization method). More... | |
class | redecl_iterator |
Iterates through all the redeclarations of the same decl. More... |
Public Types | |
enum | Kind |
Lists the kind of concrete classes of Decl. More... | |
enum | IdentifierNamespace { IDNS_Label = 0x0001 , IDNS_Tag = 0x0002 , IDNS_Type = 0x0004 , IDNS_Member = 0x0008 , IDNS_Namespace = 0x0010 , IDNS_Ordinary = 0x0020 , IDNS_ObjCProtocol = 0x0040 , IDNS_OrdinaryFriend = 0x0080 , IDNS_TagFriend = 0x0100 , IDNS_Using = 0x0200 , IDNS_NonMemberOperator = 0x0400 , IDNS_LocalExtern = 0x0800 , IDNS_OMPReduction = 0x1000 , IDNS_OMPMapper = 0x2000 } |
IdentifierNamespace - The different namespaces in which declarations may appear. More... | |
enum | ObjCDeclQualifier { OBJC_TQ_None = 0x0 , OBJC_TQ_In = 0x1 , OBJC_TQ_Inout = 0x2 , OBJC_TQ_Out = 0x4 , OBJC_TQ_Bycopy = 0x8 , OBJC_TQ_Byref = 0x10 , OBJC_TQ_Oneway = 0x20 , OBJC_TQ_CSNullability = 0x40 } |
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declarations. More... | |
enum class | ModuleOwnershipKind : unsigned char { Unowned , Visible , VisibleWhenImported , ReachableWhenImported , ModulePrivate } |
The kind of ownership a declaration has, for visibility purposes. More... | |
enum | FriendObjectKind { FOK_None , FOK_Declared , FOK_Undeclared } |
using | attr_iterator = AttrVec::const_iterator |
using | attr_range = llvm::iterator_range<attr_iterator> |
using | redecl_range = llvm::iterator_range<redecl_iterator> |
Public Member Functions | |
Decl ()=delete | |
Decl (const Decl &)=delete | |
Decl (Decl &&)=delete | |
Decl & | operator= (const Decl &)=delete |
Decl & | operator= (Decl &&)=delete |
virtual SourceRange | getSourceRange () const LLVM_READONLY |
Source range that this declaration covers. | |
SourceLocation | getBeginLoc () const LLVM_READONLY |
SourceLocation | getEndLoc () const LLVM_READONLY |
SourceLocation | getLocation () const |
void | setLocation (SourceLocation L) |
Kind | getKind () const |
const char * | getDeclKindName () const |
Decl * | getNextDeclInContext () |
const Decl * | getNextDeclInContext () const |
DeclContext * | getDeclContext () |
const DeclContext * | getDeclContext () const |
DeclContext * | getNonTransparentDeclContext () |
Return the non transparent context. | |
const DeclContext * | getNonTransparentDeclContext () const |
Decl * | getNonClosureContext () |
Find the innermost non-closure ancestor of this declaration, walking up through blocks, lambdas, etc. | |
const Decl * | getNonClosureContext () const |
TranslationUnitDecl * | getTranslationUnitDecl () |
const TranslationUnitDecl * | getTranslationUnitDecl () const |
bool | isInAnonymousNamespace () const |
bool | isInStdNamespace () const |
bool | isFileContextDecl () const |
ASTContext & | getASTContext () const LLVM_READONLY |
const LangOptions & | getLangOpts () const LLVM_READONLY |
Helper to get the language options from the ASTContext. | |
void | setAccess (AccessSpecifier AS) |
AccessSpecifier | getAccess () const |
AccessSpecifier | getAccessUnsafe () const |
Retrieve the access specifier for this declaration, even though it may not yet have been properly set. | |
bool | hasAttrs () const |
void | setAttrs (const AttrVec &Attrs) |
AttrVec & | getAttrs () |
const AttrVec & | getAttrs () const |
void | dropAttrs () |
void | addAttr (Attr *A) |
attr_range | attrs () const |
attr_iterator | attr_begin () const |
attr_iterator | attr_end () const |
template<typename... Ts> | |
void | dropAttrs () |
template<typename T> | |
void | dropAttr () |
template<typename T> | |
llvm::iterator_range< specific_attr_iterator< T > > | specific_attrs () const |
template<typename T> | |
specific_attr_iterator< T > | specific_attr_begin () const |
template<typename T> | |
specific_attr_iterator< T > | specific_attr_end () const |
template<typename T> | |
T * | getAttr () const |
template<typename T> | |
bool | hasAttr () const |
unsigned | getMaxAlignment () const |
getMaxAlignment - return the maximum alignment specified by attributes on this decl, 0 if there are none. | |
void | setInvalidDecl (bool Invalid=true) |
setInvalidDecl - Indicates the Decl had a semantic error. | |
bool | isInvalidDecl () const |
bool | isImplicit () const |
isImplicit - Indicates whether the declaration was implicitly generated by the implementation. | |
void | setImplicit (bool I=true) |
bool | isUsed (bool CheckUsedAttr=true) const |
Whether any (re-)declaration of the entity was used, meaning that a definition is required. | |
void | setIsUsed () |
Set whether the declaration is used, in the sense of odr-use. | |
void | markUsed (ASTContext &C) |
Mark the declaration used, in the sense of odr-use. | |
bool | isReferenced () const |
Whether any declaration of this entity was referenced. | |
bool | isThisDeclarationReferenced () const |
Whether this declaration was referenced. | |
void | setReferenced (bool R=true) |
void | invalidateCachedLinkage () |
When doing manipulations which might change the computed linkage, such as changing the DeclContext after the declaration has already been used, invalidating the cache will make sure its linkage will be recomputed. | |
bool | isTopLevelDeclInObjCContainer () const |
Whether this declaration is a top-level declaration (function, global variable, etc.) that is lexically inside an objc container definition. | |
void | setTopLevelDeclInObjCContainer (bool V=true) |
ExternalSourceSymbolAttr * | getExternalSourceSymbolAttr () const |
Looks on this and related declarations for an applicable external source symbol attribute. | |
bool | isModulePrivate () const |
Whether this declaration was marked as being private to the module in which it was defined. | |
bool | isModuleLocal () const |
Whether this declaration was a local declaration to a C++20 named module. | |
bool | isInExportDeclContext () const |
Whether this declaration was exported in a lexical context. | |
bool | isInvisibleOutsideTheOwningModule () const |
bool | isInAnotherModuleUnit () const |
Whether this declaration comes from another module unit. | |
bool | isInCurrentModuleUnit () const |
Whether this declaration comes from the same module unit being compiled. | |
bool | shouldEmitInExternalSource () const |
Whether the definition of the declaration should be emitted in external sources. | |
bool | isFromExplicitGlobalModule () const |
Whether this declaration comes from explicit global module. | |
bool | isFromGlobalModule () const |
Whether this declaration comes from global module. | |
bool | isInNamedModule () const |
Whether this declaration comes from a named module. | |
bool | isFromHeaderUnit () const |
Whether this declaration comes from a header unit. | |
bool | hasDefiningAttr () const |
Return true if this declaration has an attribute which acts as definition of the entity, such as 'alias' or 'ifunc'. | |
const Attr * | getDefiningAttr () const |
Return this declaration's defining attribute if it has one. | |
void | setFromASTFile () |
Set the FromASTFile flag. | |
void | setOwningModuleID (unsigned ID) |
Set the owning module ID. | |
AvailabilityResult | getAvailability (std::string *Message=nullptr, VersionTuple EnclosingVersion=VersionTuple(), StringRef *RealizedPlatform=nullptr) const |
Determine the availability of the given declaration. | |
VersionTuple | getVersionIntroduced () const |
Retrieve the version of the target platform in which this declaration was introduced. | |
bool | isDeprecated (std::string *Message=nullptr) const |
Determine whether this declaration is marked 'deprecated'. | |
bool | isUnavailable (std::string *Message=nullptr) const |
Determine whether this declaration is marked 'unavailable'. | |
bool | isWeakImported () const |
Determine whether this is a weak-imported symbol. | |
bool | canBeWeakImported (bool &IsDefinition) const |
Determines whether this symbol can be weak-imported, e.g., whether it would be well-formed to add the weak_import attribute. | |
bool | isFromASTFile () const |
Determine whether this declaration came from an AST file (such as a precompiled header or module) rather than having been parsed. | |
GlobalDeclID | getGlobalID () const |
Retrieve the global declaration ID associated with this declaration, which specifies where this Decl was loaded from. | |
unsigned | getOwningModuleID () const |
Retrieve the global ID of the module that owns this particular declaration. | |
Module * | getImportedOwningModule () const |
Get the imported owning module, if this decl is from an imported (non-local) module. | |
Module * | getLocalOwningModule () const |
Get the local owning module, if known. | |
void | setLocalOwningModule (Module *M) |
bool | hasOwningModule () const |
Is this declaration owned by some module? | |
Module * | getOwningModule () const |
Get the module that owns this declaration (for visibility purposes). | |
Module * | getTopLevelOwningNamedModule () const |
Get the top level owning named module that owns this declaration if any. | |
Module * | getOwningModuleForLinkage () const |
Get the module that owns this declaration for linkage purposes. | |
bool | isUnconditionallyVisible () const |
Determine whether this declaration is definitely visible to name lookup, independent of whether the owning module is visible. | |
bool | isReachable () const |
void | setVisibleDespiteOwningModule () |
Set that this declaration is globally visible, even if it came from a module that is not visible. | |
ModuleOwnershipKind | getModuleOwnershipKind () const |
Get the kind of module ownership for this declaration. | |
void | setModuleOwnershipKind (ModuleOwnershipKind MOK) |
Set whether this declaration is hidden from name lookup. | |
unsigned | getIdentifierNamespace () const |
bool | isInIdentifierNamespace (unsigned NS) const |
bool | hasTagIdentifierNamespace () const |
DeclContext * | getLexicalDeclContext () |
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC). | |
const DeclContext * | getLexicalDeclContext () const |
virtual bool | isOutOfLine () const |
Determine whether this declaration is declared out of line (outside its semantic context). | |
void | setDeclContext (DeclContext *DC) |
setDeclContext - Set both the semantic and lexical DeclContext to DC. | |
void | setLexicalDeclContext (DeclContext *DC) |
bool | isTemplated () const |
Determine whether this declaration is a templated entity (whether it is. | |
unsigned | getTemplateDepth () const |
Determine the number of levels of template parameter surrounding this declaration. | |
bool | isDefinedOutsideFunctionOrMethod () const |
isDefinedOutsideFunctionOrMethod - This predicate returns true if this scoped decl is defined outside the current function or method. | |
bool | isInLocalScopeForInstantiation () const |
Determine whether a substitution into this declaration would occur as part of a substitution into a dependent local scope. | |
const DeclContext * | getParentFunctionOrMethod (bool LexicalParent=false) const |
If this decl is defined inside a function/method/block it returns the corresponding DeclContext, otherwise it returns null. | |
DeclContext * | getParentFunctionOrMethod (bool LexicalParent=false) |
virtual Decl * | getCanonicalDecl () |
Retrieves the "canonical" declaration of the given declaration. | |
const Decl * | getCanonicalDecl () const |
bool | isCanonicalDecl () const |
Whether this particular Decl is a canonical one. | |
redecl_range | redecls () const |
Returns an iterator range for all the redeclarations of the same decl. | |
redecl_iterator | redecls_begin () const |
redecl_iterator | redecls_end () const |
Decl * | getPreviousDecl () |
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration. | |
const Decl * | getPreviousDecl () const |
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration. | |
bool | isFirstDecl () const |
True if this is the first declaration in its redeclaration chain. | |
Decl * | getMostRecentDecl () |
Retrieve the most recent declaration that declares the same entity as this declaration (which may be this declaration). | |
const Decl * | getMostRecentDecl () const |
Retrieve the most recent declaration that declares the same entity as this declaration (which may be this declaration). | |
virtual Stmt * | getBody () const |
getBody - If this Decl represents a declaration for a body of code, such as a function or method definition, this method returns the top-level Stmt* of that body. | |
virtual bool | hasBody () const |
Returns true if this Decl represents a declaration for a body of code, such as a function or method definition. | |
SourceLocation | getBodyRBrace () const |
getBodyRBrace - Gets the right brace of the body, if a body exists. | |
bool | isTemplateParameter () const |
isTemplateParameter - Determines whether this declaration is a template parameter. | |
bool | isTemplateParameterPack () const |
isTemplateParameter - Determines whether this declaration is a template parameter pack. | |
bool | isParameterPack () const |
Whether this declaration is a parameter pack. | |
bool | isTemplateDecl () const |
returns true if this declaration is a template | |
bool | isFunctionOrFunctionTemplate () const |
Whether this declaration is a function or function template. | |
TemplateDecl * | getDescribedTemplate () const |
If this is a declaration that describes some template, this method returns that template declaration. | |
const TemplateParameterList * | getDescribedTemplateParams () const |
If this is a declaration that describes some template or partial specialization, this returns the corresponding template parameter list. | |
FunctionDecl * | getAsFunction () LLVM_READONLY |
Returns the function itself, or the templated function if this is a function template. | |
const FunctionDecl * | getAsFunction () const |
void | setLocalExternDecl () |
Changes the namespace of this declaration to reflect that it's a function-local extern declaration. | |
bool | isLocalExternDecl () const |
Determine whether this is a block-scope declaration with linkage. | |
void | setObjectOfFriendDecl (bool PerformFriendInjection=false) |
Changes the namespace of this declaration to reflect that it's the object of a friend declaration. | |
void | clearIdentifierNamespace () |
Clears the namespace of this declaration. | |
FriendObjectKind | getFriendObjectKind () const |
Determines whether this declaration is the object of a friend declaration and, if so, what kind. | |
void | setNonMemberOperator () |
Specifies that this declaration is a C++ overloaded non-member. | |
void | print (raw_ostream &Out, unsigned Indentation=0, bool PrintInstantiation=false) const |
void | print (raw_ostream &Out, const PrintingPolicy &Policy, unsigned Indentation=0, bool PrintInstantiation=false) const |
void | dump () const |
void | dumpColor () const |
void | dump (raw_ostream &Out, bool Deserialize=false, ASTDumpOutputFormat OutputFormat=ADOF_Default) const |
int64_t | getID () const |
const FunctionType * | getFunctionType (bool BlocksToo=true) const |
Looks through the Decl's underlying type to extract a FunctionType when possible. | |
bool | isFunctionPointerType () const |
Static Public Member Functions | |
static bool | isFlexibleArrayMemberLike (const ASTContext &Context, const Decl *D, QualType Ty, LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, bool IgnoreTemplateOrMacroSubstitution) |
Whether it resembles a flexible array member. | |
static unsigned | getIdentifierNamespaceForKind (Kind DK) |
static bool | isTagIdentifierNamespace (unsigned NS) |
static void | add (Kind k) |
static void | EnableStatistics () |
static void | PrintStats () |
static bool | classofKind (Kind K) |
static DeclContext * | castToDeclContext (const Decl *) |
static Decl * | castFromDeclContext (const DeclContext *) |
static void | printGroup (Decl **Begin, unsigned NumDecls, raw_ostream &Out, const PrintingPolicy &Policy, unsigned Indentation=0) |
Protected Member Functions | |
void * | operator new (std::size_t Size, const ASTContext &Ctx, GlobalDeclID ID, std::size_t Extra=0) |
Allocate memory for a deserialized declaration. | |
void * | operator new (std::size_t Size, const ASTContext &Ctx, DeclContext *Parent, std::size_t Extra=0) |
Allocate memory for a non-deserialized declaration. | |
Decl (Kind DK, DeclContext *DC, SourceLocation L) | |
Decl (Kind DK, EmptyShell Empty) | |
virtual | ~Decl () |
Linkage | getCachedLinkage () const |
void | setCachedLinkage (Linkage L) const |
bool | hasCachedLinkage () const |
void | setModulePrivate () |
Specify that this declaration was marked as being private to the module in which it was defined. | |
bool | hasLocalOwningModuleStorage () const |
virtual Decl * | getNextRedeclarationImpl () |
Returns the next redeclaration or itself if this is the only decl. | |
virtual Decl * | getPreviousDeclImpl () |
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain. | |
virtual Decl * | getMostRecentDeclImpl () |
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chain. | |
ASTMutationListener * | getASTMutationListener () const |
Protected Attributes | |
llvm::PointerIntPair< Decl *, 3, ModuleOwnershipKind > | NextInContextAndBits |
The next declaration within the same lexical DeclContext. | |
unsigned | Access: 2 |
Access - Used by C++ decls for the access specifier. | |
unsigned | FromASTFile: 1 |
Whether this declaration was loaded from an AST file. | |
unsigned | IdentifierNamespace: 14 |
IdentifierNamespace - This specifies what IDNS_* namespace this lives in. | |
unsigned | CacheValidAndLinkage: 3 |
If 0, we have not computed the linkage of this declaration. |
Friends | |
class | DeclContext |
class | ASTDeclMerger |
class | ASTDeclReader |
class | ASTDeclWriter |
class | ASTNodeImporter |
class | ASTReader |
class | CXXClassMemberWrapper |
class | LinkageComputer |
class | RecordDecl |
template<typename decl_type> | |
class | Redeclarable |
Decl - This represents one declaration (or definition), e.g.
a variable, typedef, function, struct, etc.
Note: There are objects tacked on before the beginning of Decl (and its subclasses) in its Decl::operator new(). Proper alignment of all subclasses (not requiring more than the alignment of Decl) is asserted in DeclBase.cpp.
Definition at line 86 of file DeclBase.h.
using clang::Decl::attr_iterator = AttrVec::const_iterator |
Definition at line 532 of file DeclBase.h.
using clang::Decl::attr_range = llvm::iterator_range<attr_iterator> |
Definition at line 533 of file DeclBase.h.
using clang::Decl::redecl_range = llvm::iterator_range<redecl_iterator> |
Definition at line 1045 of file DeclBase.h.
Enumerator | |
---|---|
FOK_None | Not a friend object. |
FOK_Declared | A friend of a previously-declared entity. |
FOK_Undeclared | A friend of a previously-undeclared entity. |
Definition at line 1216 of file DeclBase.h.
IdentifierNamespace - The different namespaces in which declarations may appear.
According to C99 6.2.3, there are four namespaces, labels, tags, members and ordinary identifiers. C++ describes lookup completely differently: certain lookups merely "ignore" certain kinds of declarations, usually based on whether the declaration is of a type, etc.
These are meant as bitmasks, so that searches in C++ can look into the "tag" namespace during ordinary lookup.
Decl currently provides 15 bits of IDNS bits.
Enumerator | |
---|---|
IDNS_Label | Labels, declared with 'x:' and referenced with 'goto x'. |
IDNS_Tag | Tags, declared with 'struct foo;' and referenced with 'struct foo'. All tags are also types. This is what elaborated-type-specifiers look for in C. This also contains names that conflict with tags in the same scope but that are otherwise ordinary names (non-type template parameters and indirect field declarations). |
IDNS_Type | Types, declared with 'struct foo', typedefs, etc. This is what elaborated-type-specifiers look for in C++, but note that it's ill-formed to find a non-tag. |
IDNS_Member | Members, declared with object declarations within tag definitions. In C, these can only be found by "qualified" lookup in member expressions. In C++, they're found by normal lookup. |
IDNS_Namespace | Namespaces, declared with 'namespace foo {}'. Lookup for nested-name-specifiers find these. |
IDNS_Ordinary | Ordinary names. In C, everything that's not a label, tag, member, or function-local extern ends up here. |
IDNS_ObjCProtocol | Objective C @protocol. |
IDNS_OrdinaryFriend | This declaration is a friend function. A friend function declaration is always in this namespace but may also be in IDNS_Ordinary if it was previously declared. |
IDNS_TagFriend | This declaration is a friend class. A friend class declaration is always in this namespace but may also be in IDNS_Tag|IDNS_Type if it was previously declared. |
IDNS_Using | This declaration is a using declaration. A using declaration introduces a number of other declarations into the current scope, and those declarations use the IDNS of their targets, but the actual using declarations go in this namespace. |
IDNS_NonMemberOperator | This declaration is a C++ operator declared in a non-class context. All such operators are also in IDNS_Ordinary. C++ lexical operator lookup looks for these. |
IDNS_LocalExtern | This declaration is a function-local extern declaration of a variable or function. This may also be IDNS_Ordinary if it has been declared outside any function. These act mostly like invisible friend declarations, but are also visible to unqualified lookup within the scope of the declaring function. |
IDNS_OMPReduction | This declaration is an OpenMP user defined reduction construction. |
IDNS_OMPMapper | This declaration is an OpenMP user defined mapper. |
Definition at line 115 of file DeclBase.h.
enum clang::Decl::Kind |
Lists the kind of concrete classes of Decl.
Definition at line 89 of file DeclBase.h.
|
strong |
The kind of ownership a declaration has, for visibility purposes.
This enumeration is designed such that higher values represent higher levels of name hiding.
Enumerator | |
---|---|
Unowned | This declaration is not owned by a module. |
Visible | This declaration has an owning module, but is globally visible (typically because its owning module is visible and we know that modules cannot later become hidden in this compilation). After serialization and deserialization, this will be converted to VisibleWhenImported. |
VisibleWhenImported | This declaration has an owning module, and is visible when that module is imported. |
ReachableWhenImported | This declaration has an owning module, and is visible to lookups that occurs within that module. And it is reachable in other module when the owning module is transitively imported. |
ModulePrivate | This declaration has an owning module, but is only visible to lookups that occur within that module. The discarded declarations in global module fragment belongs to this group too. |
Definition at line 216 of file DeclBase.h.
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declarations.
Other than remembering them and mangling them into the method's signature string, these are ignored by the compiler; they are consumed by certain remote-messaging frameworks.
in, inout, and out are mutually exclusive and apply only to method parameters. bycopy and byref are mutually exclusive and apply only to method parameters (?). oneway applies only to results. All of these expect their corresponding parameter to have a particular type. None of this is currently enforced by clang.
This should be kept in sync with ObjCDeclSpec::ObjCDeclQualifier.
Definition at line 198 of file DeclBase.h.
|
delete |
Referenced by clang::ExportDecl::ASTDeclReader, clang::LifetimeExtendedTemporaryDecl::ASTDeclReader, clang::PragmaCommentDecl::ASTDeclWriter, clang::PragmaDetectMismatchDecl::ASTDeclWriter, clang::TopLevelStmtDecl::ASTDeclWriter, clang::ImportDecl::ASTReader, clang::interp::IntPointer::atOffset(), clang::BlockDecl::BlockDecl(), castFromDeclContext(), castToDeclContext(), clang::AccessSpecDecl::classof(), clang::BlockDecl::classof(), clang::CapturedDecl::classof(), clang::EmptyDecl::classof(), clang::ExportDecl::classof(), clang::ExternCContextDecl::classof(), clang::FileScopeAsmDecl::classof(), clang::FriendDecl::classof(), clang::FriendTemplateDecl::classof(), clang::ImplicitConceptSpecializationDecl::classof(), clang::ImportDecl::classof(), clang::LifetimeExtendedTemporaryDecl::classof(), clang::LinkageSpecDecl::classof(), clang::NamedDecl::classof(), clang::ObjCPropertyImplDecl::classof(), clang::OpenACCConstructDecl::classof(), clang::OutlinedFunctionDecl::classof(), clang::PragmaCommentDecl::classof(), clang::PragmaDetectMismatchDecl::classof(), clang::RequiresExprBodyDecl::classof(), clang::StaticAssertDecl::classof(), clang::TopLevelStmtDecl::classof(), clang::TranslationUnitDecl::classof(), clang::FriendDecl::CXXRecordDecl::friend_iterator, Decl(), Decl(), getAsFunction(), getAttrs(), clang::BlockDecl::getBlockManglingContextDecl(), getCanonicalDecl(), getCanonicalDecl(), getDeclContext(), getExternalSourceSymbolAttr(), getID(), getLexicalDeclContext(), getMostRecentDecl(), getMostRecentDecl(), clang::NamedDecl::getMostRecentDecl(), getMostRecentDeclImpl(), getNextDeclInContext(), getNextDeclInContext(), getNextRedeclarationImpl(), getNonClosureContext(), getNonClosureContext(), getNonTransparentDeclContext(), getParentFunctionOrMethod(), getPreviousDecl(), getPreviousDecl(), getPreviousDeclImpl(), getTemplateDepth(), getTranslationUnitDecl(), isFlexibleArrayMemberLike(), isUsed(), clang::NamedDecl::NamedDecl(), clang::OpenACCConstructDecl::OpenACCConstructDecl(), clang::OpenACCConstructDecl::OpenACCConstructDecl(), operator new(), operator new(), clang::Decl::redecl_iterator::operator++(), operator=(), operator=(), print(), printGroup(), clang::Decl::redecl_iterator::redecl_iterator(), redecls_begin(), clang::BlockDecl::setBlockMangling(), setLocalExternDecl(), setObjectOfFriendDecl(), and clang::Sema::UnifySection().
|
inlineprotected |
Definition at line 392 of file DeclBase.h.
References Access, add(), clang::AS_none, CacheValidAndLinkage, DeclContext, false, FromASTFile, getIdentifierNamespaceForKind(), clang::Invalid, NextInContextAndBits, and clang::nullptr.
|
inlineprotected |
Definition at line 402 of file DeclBase.h.
References Access, add(), clang::AS_none, CacheValidAndLinkage, clang::Empty, false, FromASTFile, getIdentifierNamespaceForKind(), and clang::Invalid.
|
protectedvirtualdefault |
|
static |
Definition at line 226 of file DeclBase.cpp.
void Decl::addAttr | ( | Attr * | A | ) |
Definition at line 1022 of file DeclBase.cpp.
References getAttrs(), hasAttrs(), clang::Attr::isInherited(), and setAttrs().
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFields(), clang::SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaObjC::ActOnMethodDeclaration(), clang::SemaOpenMP::ActOnOpenMPDeclareSimdDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareTargetName(), clang::SemaOpenMP::ActOnOpenMPDeclareVariantDirective(), clang::Sema::ActOnPragmaRedefineExtname(), clang::Sema::ActOnPragmaUnused(), clang::Sema::ActOnPragmaWeakID(), clang::SemaHLSL::ActOnTopLevelFunction(), clang::Sema::ActOnTypedefNameDecl(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::AddAlignedAttr(), clang::Sema::AddAlignedAttr(), clang::Sema::AddAlignmentAttributesForRecord(), clang::Sema::AddAlignValueAttr(), clang::Sema::AddAllocAlignAttr(), clang::SemaAMDGPU::addAMDGPUFlatWorkGroupSizeAttr(), clang::SemaAMDGPU::addAMDGPUMaxNumWorkGroupsAttr(), clang::SemaAMDGPU::addAMDGPUWavesPerEUAttr(), clang::Sema::AddAssumeAlignedAttr(), clang::SemaObjC::AddCFAuditedAttribute(), addImplicitBindingAttrToDecl(), clang::Sema::AddImplicitMSFunctionNoBuiltinAttr(), clang::Sema::AddKnownFunctionAttributes(), clang::Sema::AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(), clang::Sema::AddLaunchBoundsAttr(), clang::Sema::AddModeAttr(), clang::Sema::AddMsStructLayoutForRecord(), clang::Sema::AddOptnoneAttributeIfNoConflicts(), clang::SemaSwift::AddParameterABIAttr(), AddPropertyAttrs(), clang::Sema::AddPushedVisibilityAttribute(), clang::Sema::AddSectionMSAllocText(), applyOMPAllocateAttribute(), assignInheritanceModel(), clang::ASTContext::buildImplicitRecord(), buildVarDecl(), clang::SemaObjC::CheckARCMethodDecl(), clang::Sema::checkClassLevelDLLAttribute(), clang::Sema::CheckClassTemplate(), clang::SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(), checkDLLAttributeRedeclaration(), clang::Sema::CheckFunctionDeclaration(), clang::SemaObjC::checkInitMethod(), clang::Sema::CheckNontrivialField(), clang::SemaOpenMP::CheckOMPThreadPrivateDecl(), clang::Sema::CheckStaticLocalForDllExport(), copyAttrFromTypedefToDecl(), copyAttrIfPresent(), createHostLayoutStruct(), createHostLayoutStructForBuffer(), createPrivatesRecordDecl(), clang::Sema::DeclApplyPragmaWeak(), clang::SemaHLSL::diagnoseSystemSemanticAttr(), clang::Sema::FinalizeDeclaration(), handleAbiTagAttr(), clang::SemaOpenCL::handleAccessAttr(), handleAcquireCapabilityAttr(), handleAcquiredAfterAttr(), handleAcquiredBeforeAttr(), handleAcquireHandleAttr(), handleAliasAttr(), handleAlignedAttr(), handleAllocSizeAttr(), handleAlwaysInlineAttr(), clang::SemaAMDGPU::handleAMDGPUNumSGPRAttr(), clang::SemaAMDGPU::handleAMDGPUNumVGPRAttr(), handleAnalyzerNoReturnAttr(), handleAnnotateAttr(), clang::SemaX86::handleAnyInterruptAttr(), handleArgumentWithTypeTagAttr(), handleAssertCapabilityAttr(), clang::SemaSwift::handleAsyncAttr(), clang::SemaSwift::handleAsyncError(), clang::SemaSwift::handleAsyncName(), clang::SemaSwift::handleAttrAttr(), handleAttrWithMessage(), handleAvailabilityAttr(), clang::SemaObjC::handleBlocksAttr(), clang::SemaSwift::handleBridge(), clang::SemaObjC::handleBridgeAttr(), clang::SemaObjC::handleBridgeMutableAttr(), clang::SemaObjC::handleBridgeRelatedAttr(), handleBTFDeclTagAttr(), clang::SemaARM::handleBuiltinAliasAttr(), handleBuiltinAliasAttr(), handleCallableWhenAttr(), handleCallbackAttr(), handleCallConvAttr(), handleCalledOnceAttr(), handleCapabilityAttr(), handleCFGuardAttr(), handleCFIUncheckedCalleeAttr(), handleCleanupAttr(), clang::SemaARM::handleCmseNSEntryAttr(), handleCodeModelAttr(), handleCodeSegAttr(), handleCommonAttr(), handleConstantAttr(), handleConstructorAttr(), handleConsumableAttr(), handleCPUSpecificAttr(), handleDeclspecThreadAttr(), handleDelayedForbiddenType(), handleDependencyAttr(), handleDeprecatedAttr(), clang::SemaObjC::handleDesignatedInitializer(), handleDestructorAttr(), handleDeviceAttr(), handleDiagnoseAsBuiltinAttr(), handleDiagnoseIfAttr(), handleDLLAttr(), handleEnableIfAttr(), handleEnforceTCBAttr(), handleEnumExtensibilityAttr(), clang::SemaSwift::handleError(), handleErrorAttr(), handleExcludeFromExplicitInstantiationAttr(), handleExternalSourceSymbolAttr(), clang::SemaX86::handleForceAlignArgPointerAttr(), handleFormatArgAttr(), handleFormatAttr(), handleFormatMatchesAttr(), handleFunctionReturnThunksAttr(), handleGlobalAttr(), handleGNUInlineAttr(), handleGridConstantAttr(), handleGuardedByAttr(), handleHandleAttr(), clang::SemaObjC::handleIBOutlet(), clang::SemaObjC::handleIBOutletCollection(), handleIFuncAttr(), clang::SemaObjC::handleIndependentClass(), handleInitPriorityAttr(), handleInternalLinkageAttr(), clang::SemaARM::handleInterruptAttr(), clang::SemaM68k::handleInterruptAttr(), clang::SemaMIPS::handleInterruptAttr(), clang::SemaMSP430::handleInterruptAttr(), clang::SemaRISCV::handleInterruptAttr(), clang::SemaARM::handleInterruptSaveFPAttr(), clang::SemaSYCL::handleKernelEntryPointAttr(), handleLayoutVersion(), handleLifetimeCaptureByAttr(), handleLockReturnedAttr(), handleLocksExcludedAttr(), handleManagedAttr(), clang::SemaObjC::handleMethodFamilyAttr(), handleMinSizeAttr(), handleMinVectorWidthAttr(), handleMSConstexprAttr(), handleMSInheritanceAttr(), handleNakedAttr(), clang::SemaSwift::handleName(), clang::SemaARM::handleNewAttr(), clang::SemaSwift::handleNewType(), handleNoBuiltinAttr(), handleNoDebugAttr(), handleNoEscapeAttr(), handleNoMergeAttr(), handleNonNullAttr(), handleNonNullAttrParameter(), handleNonStringAttr(), handleNoRandomizeLayoutAttr(), handleNoReturnAttr(), handleNoSanitizeAttr(), handleNoSanitizeSpecificAttr(), handleNoSpecializations(), handleNoUniqueAddressAttr(), clang::SemaObjC::handleNSErrorDomain(), clang::SemaObjC::handleNSObject(), clang::SemaHLSL::handleNumThreadsAttr(), clang::SemaOpenMP::handleOMPAssumeAttr(), handleOptimizeNoneAttr(), handleOwnershipAttr(), handlePackedAttr(), clang::SemaHLSL::handlePackOffsetAttr(), clang::SemaHLSL::handleParamModifierAttr(), handleParamTypestateAttr(), handlePassObjectSizeAttr(), handlePatchableFunctionEntryAttr(), clang::SemaObjC::handlePreciseLifetimeAttr(), handlePreferredName(), handlePreferredTypeAttr(), handlePtGuardedByAttr(), handlePtGuardedVarAttr(), handleRandomizeLayoutAttr(), handleReentrantCapabilityAttr(), handleReleaseCapabilityAttr(), handleRequiresCapabilityAttr(), clang::SemaObjC::handleRequiresSuperAttr(), clang::SemaHLSL::handleResourceBindingAttr(), handleRestrictAttr(), clang::SemaObjC::handleReturnsInnerPointerAttr(), handleReturnsNonNullAttr(), handleReturnTypestateAttr(), clang::SemaHLSL::handleRootSignatureAttr(), clang::SemaObjC::handleRuntimeName(), handleSectionAttr(), handleSentinelAttr(), handleSetTypestateAttr(), clang::SemaHLSL::handleShaderAttr(), handleSharedAttr(), clang::handleSimpleAttribute(), handleStandardNoReturnAttr(), clang::SemaOpenCL::handleSubGroupSize(), clang::SemaObjC::handleSuppresProtocolAttr(), handleSuppressAttr(), handleTargetAttr(), handleTargetClonesAttr(), handleTargetVersionAttr(), handleTestTypestateAttr(), handleTLSModelAttr(), handleTransparentUnionAttr(), handleTryAcquireCapabilityAttr(), handleTypeTagForDatatypeAttr(), handleUninitializedAttr(), handleUnsafeBufferUsage(), handleUnusedAttr(), handleUuidAttr(), handleVecReturnAttr(), handleVecTypeHint(), handleVisibilityAttr(), clang::SemaHLSL::handleVkBindingAttr(), clang::SemaHLSL::handleVkConstantIdAttr(), clang::SemaHLSL::handleVkExtBuiltinInputAttr(), handleVTablePointerAuthentication(), handleWarnUnusedResult(), clang::SemaHLSL::handleWaveSizeAttr(), handleWeakImportAttr(), handleWeakRefAttr(), clang::SemaWasm::handleWebAssemblyExportNameAttr(), handleWorkGroupSize(), handleXRayLogArgsAttr(), handleZeroCallUsedRegsAttr(), clang::ASTImporter::Import(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), InjectAnonymousStructOrUnionMembers(), InsertOCLBuiltinDeclarationsFromTable(), instantiateDependentHLSLParamModifierAttr(), instantiateDependentOpenACCRoutineDeclAttr(), clang::Sema::makeUnavailableInSystemHeader(), clang::SemaCUDA::MaybeAddConstantAttr(), clang::SemaCUDA::maybeAddHostDeviceAttrs(), mergeDeclAttribute(), mergeInterfaceMethodToImpl(), patchDefaultTargetVersion(), ProcessAPINotes(), ProcessAPINotes(), ProcessAPINotes(), clang::SemaObjC::ProcessPropertyDecl(), propagateAttribute(), clang::Sema::propagateDLLAttrToBaseClassTemplate(), rewriteBuiltinFunctionDecl(), clang::RecordDecl::setCapturedRecord(), clang::Sema::updateAttrsForLateParsedTemplate(), clang::ASTDeclReader::UpdateDecl(), and GlobalDeclRefChecker::VisitDeclRefExpr().
|
inline |
Definition at line 539 of file DeclBase.h.
References getAttrs(), and hasAttrs().
Referenced by attrs(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), specific_attr_begin(), and ValidateMultipleRegisterAnnotations().
|
inline |
Definition at line 542 of file DeclBase.h.
References getAttrs(), and hasAttrs().
Referenced by attrs(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), specific_attr_end(), and ValidateMultipleRegisterAnnotations().
|
inline |
Definition at line 535 of file DeclBase.h.
References attr_begin(), and attr_end().
Referenced by checkNonMultiVersionCompatAttributes(), clang::SemaOpenACC::CheckRoutineDecl(), DeclHasAttr(), clang::tooling::getAssociatedRange(), getAttrForPlatform(), getAvailability(), getVersionIntroduced(), handleAPINotedRetainCountAttribute(), hasAttribute(), hasUnsupportedSpecifiers(), InjectAnonymousStructOrUnionMembers(), clang::threadSafety::BeforeSet::insertAttrExprs(), clang::Sema::InstantiateAttrs(), clang::Sema::InstantiateAttrsForDecl(), isWeakImported(), ProcessAPINotes(), clang::Sema::updateAttrsForLateParsedTemplate(), and clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
Determines whether this symbol can be weak-imported, e.g., whether it would be well-formed to add the weak_import attribute.
IsDefinition | Set to true to indicate that this declaration cannot be weak-imported because it has a definition. |
Definition at line 819 of file DeclBase.cpp.
References getASTContext(), getLangOpts(), clang::ObjCRuntime::hasWeakClassImport(), and clang::isa().
Referenced by handleWeakImportAttr(), and isWeakImported().
|
static |
Definition at line 1050 of file DeclBase.cpp.
References Decl(), DeclContext, and clang::DeclContext::getDeclKind().
Referenced by clang::Sema::ActOnIfStmt(), clang::PredefinedExpr::ComputeName(), clang::cast_convert_decl_context< ToTy, IsKnownSubtype >::doit(), clang::cast_convert_decl_context< ToTy, IsKnownSubtype >::doit(), getDeclLocsForCommentSearch(), and clang::Sema::getTemplateInstantiationArgs().
|
static |
Definition at line 1063 of file DeclBase.cpp.
References Decl(), DeclContext, and getKind().
Referenced by clang::Sema::CheckTemplateArgumentList(), and clang::CIRGen::CIRGenModule::emitTopLevelDecl().
Definition at line 1242 of file DeclBase.h.
|
inline |
Clears the namespace of this declaration.
This is useful if we want this declaration to be available for redeclaration lookup but otherwise hidden for ordinary name lookups.
Definition at line 1214 of file DeclBase.h.
|
inline |
Definition at line 556 of file DeclBase.h.
References dropAttrs().
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::SemaObjC::ActOnMethodDeclaration(), clang::Sema::ActOnStartOfFunctionDef(), clang::SemaHLSL::ActOnTopLevelFunction(), checkDLLAttributeRedeclaration(), clang::Sema::checkIllFormedTrivialABIStruct(), clang::Sema::CheckOverrideControl(), checkSelectAnyAttr(), checkWeakAttr(), clang::Sema::FinalizeDeclaration(), handleCodeSegAttr(), handleConstantAttr(), handleDeviceAttr(), handleEnforceTCBAttr(), handleFunctionReturnThunksAttr(), clang::SemaARM::handleInterruptSaveFPAttr(), clang::SemaARM::handleNewAttr(), handleNoBuiltinAttr(), handleZeroCallUsedRegsAttr(), clang::Sema::mergeDLLExportAttr(), mergeEnforceTCBAttrImpl(), clang::Sema::mergeErrorAttr(), clang::Sema::mergeMSInheritanceAttr(), clang::SemaSwift::mergeNameAttr(), clang::Sema::mergeOptimizeNoneAttr(), clang::SemaHLSL::mergeParamModifierAttr(), clang::Sema::mergeUuidAttr(), mergeVisibilityAttr(), and clang::Sema::ProcessDeclAttributeList().
void Decl::dropAttrs | ( | ) |
Definition at line 1015 of file DeclBase.cpp.
References clang::ASTContext::eraseDeclAttrs(), and getASTContext().
Referenced by CheckConstPureAttributesUsage(), checkWeakRefAttr(), dropAttr(), propagateAttributes(), and StripImplicitInstantiation().
|
inline |
Definition at line 546 of file DeclBase.h.
References getAttrs(), and clang::isa().
LLVM_DUMP_METHOD void Decl::dump | ( | ) | const |
Definition at line 220 of file ASTDumper.cpp.
References dump().
Referenced by clang::CodeGen::CodeGenTypes::ComputeRecordLayout(), clang::CIRGen::CIRGenTypes::computeRecordLayout(), dump(), and clang::LookupResult::dump().
LLVM_DUMP_METHOD void Decl::dump | ( | raw_ostream & | Out, |
bool | Deserialize = false, | ||
ASTDumpOutputFormat | OutputFormat = ADOF_Default ) const |
Definition at line 222 of file ASTDumper.cpp.
References clang::ADOF_JSON, getASTContext(), clang::ASTContext::getCommentCommandTraits(), clang::ASTContext::getDiagnostics(), clang::ASTContext::getPrintingPolicy(), clang::DiagnosticsEngine::getShowColors(), clang::ASTContext::getSourceManager(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::setDeserialize(), SM, and clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
LLVM_DUMP_METHOD void Decl::dumpColor | ( | ) | const |
Definition at line 239 of file ASTDumper.cpp.
References getASTContext(), and clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
|
static |
Definition at line 198 of file DeclBase.cpp.
Referenced by clang::ParseAST().
|
inline |
Definition at line 507 of file DeclBase.h.
References Access.
Referenced by clang::Sema::ActOnEnumConstant(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnTag(), clang::LookupResult::addDecl(), clang::Sema::BuildAnonymousStructUnionMemberReference(), clang::Sema::BuildCXXMemberCallExpr(), buildImplicitMap(), clang::Sema::BuildUsingPackDecl(), clang::Sema::BuildUsingShadowDecl(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckCompletedCXXClass(), clang::Sema::CheckDestructorAccess(), clang::Sema::CheckFriendAccess(), checkMemberDecomposition(), clang::interp::CmpHelper< Pointer >(), DiagnoseAccessPath(), diagnoseBadDirectAccess(), DiagnoseNonStandardLayoutReason(), EvaluateComparisonBinaryOperator(), clang::Sema::findInheritingConstructor(), clang::CXXRecordDecl::finishedDefaultedOrDeletedMember(), clang::extractapi::DeclarationFragmentsBuilder::getAccessControl(), clang::getConstructorInfo(), hasUnguardedAccess(), clang::TemplateDeclInstantiator::InitMethodInstantiation(), clang::TemplateDeclInstantiator::InstantiateTypeAliasTemplateDecl(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), IsMicrosoftUsingDeclarationAccessBug(), clang::SemaOpenMP::isOpenMPCapturedDecl(), IsStructurallyEquivalent(), IsUnusedPrivateField(), clang::Sema::MergeVarDecl(), processImplicitMapsWithDefaultMappers(), clang::SemaCodeCompletion::ProduceCallSignatureHelp(), clang::TreeTransform< AdjustConstraintDepth >::RebuildMemberExpr(), clang::Sema::SetMemberAccessSpecifier(), clang::TemplateDeclInstantiator::SubstDefaultedFunction(), clang::transformOMPMappableExprListClause(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::JSONNodeDumper::VisitAccessSpecDecl(), clang::TextNodeDumper::VisitAccessSpecDecl(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::ASTNodeImporter::VisitFunctionTemplateDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitTypeAliasTemplateDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitUnresolvedUsingTypenameDecl(), clang::ASTNodeImporter::VisitUnresolvedUsingValueDecl(), clang::ASTNodeImporter::VisitUsingShadowDecl(), clang::ASTNodeImporter::VisitVarDecl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
|
inline |
Retrieve the access specifier for this declaration, even though it may not yet have been properly set.
Definition at line 514 of file DeclBase.h.
References Access.
|
inline |
Definition at line 1141 of file DeclBase.h.
References Decl(), and getAsFunction().
FunctionDecl * Decl::getAsFunction | ( | ) |
Returns the function itself, or the templated function if this is a function template.
Definition at line 251 of file DeclBase.cpp.
Referenced by clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnReenterFunctionContext(), clang::Sema::ActOnSkippedFunctionBody(), AddResultTypeChunk(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::canSkipFunctionBody(), clang::Sema::CheckCompletedCXXClass(), CheckFallThroughForBody(), clang::Sema::CheckFriendAccess(), clang::Sema::CheckFunctionDeclaration(), CheckMultiVersionAdditionalDecl(), CheckMultiVersionFunction(), clang::Sema::CheckOverload(), clang::SemaCUDA::checkTargetOverload(), DiagnoseTypeAwareAllocators(), clang::Sema::DiagnoseUnguardedAvailabilityViolations(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CIRGen::CIRGenFunction::emitBuiltinExpr(), clang::Sema::FindAssociatedClassesAndNamespaces(), clang::ASTContext::forEachMultiversionedFunctionVersion(), getAsFunction(), clang::CIRGen::CIRGenModule::getCIRLinkageForDeclarator(), GetConversionType(), clang::getDeclUsageType(), clang::CallGraphNode::getDefinition(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForFunctionTemplate(), clang::ASTContext::getFunctionFeatureMap(), clang::CodeGen::CodeGenModule::getLLVMLinkageForDeclarator(), getPrintfFormatArgumentNum(), handleCallbackAttr(), clang::ADLResult::insert(), clang::NamedDecl::isCXXInstanceMember(), clang::Sema::LookupLiteralOperator(), clang::Sema::maybeAddDeclWithEffects(), clang::SemaCUDA::maybeAddHostDeviceAttrs(), clang::Sema::MergeFunctionDecl(), PreviousDeclsHaveMultiVersionAttribute(), clang::ProgramPoint::printJson(), resolveAllocationOverloadInterior(), shouldAddReversedEqEq(), SubstituteConstraintExpressionWithoutSatisfaction(), and TryDiagnoseProtectedAccess().
ASTContext & Decl::getASTContext | ( | ) | const |
Definition at line 524 of file DeclBase.cpp.
References clang::TranslationUnitDecl::getASTContext(), and getTranslationUnitDecl().
Referenced by clang::DeclContext::addHiddenDecl(), AddObjCProperties(), clang::StoredDeclsList::addOrReplaceDecl(), clang::CXXMethodDecl::addOverriddenMethod(), clang::CodeGen::CodeGenTypes::addRecordTypeName(), clang::ODRHash::AddStructuralValue(), annotateConsumedSummaryMismatch(), applyGadgets(), clang::CXXMethodDecl::begin_overridden_methods(), canBeWeakImported(), clang::VarDecl::checkForConstantInitialization(), clang::checkUnsafeBufferUsage(), clang::ObjCInterfaceDecl::ClassImplementsProtocol(), CollectEnclosingNamespace(), clang::CXXRecordDecl::completeDefinition(), clang::RecordDecl::completeDefinition(), clang::ExternalASTMerger::CompleteType(), clang::ExternalASTMerger::CompleteType(), clang::LinkageComputer::computeLVForDecl(), clang::PredefinedExpr::ComputeName(), clang::CXXRecordDecl::conversion_begin(), clang::CXXRecordDecl::conversion_end(), clang::LifetimeExtendedTemporaryDecl::Create(), createBufferHandleType(), clang::AvailabilityInfo::createFromDecl(), clang::Sema::DeclClonePragmaWeak(), DiagnoseNonTriviallyCopyableReason(), clang::Sema::DiagnoseUniqueObjectDuplication(), clang::FunctionDecl::doesDeclarationForceExternallyVisibleDefinition(), dropAttrs(), dump(), dumpColor(), clang::CodeGen::CGHLSLRuntime::emitResourceArraySubscriptExpr(), clang::CodeGen::CodeGenModule::EmitTopLevelDecl(), clang::CXXMethodDecl::end_overridden_methods(), clang::VarDecl::ensureEvaluatedStmt(), evaluateCDTSize(), clang::VarDecl::evaluateDestruction(), clang::ExternalASTMerger::FindOriginalDecl(), clang::ClassTemplateDecl::findPartialSpecialization(), clang::RedeclarableTemplateDecl::findSpecializationLocally(), clang::findUnsafePointers(), clang::StructuralEquivalenceContext::findUntaggedStructOrUnionIndex(), fixUPCAddressofArraySubscriptWithSpan(), formatBlockPlaceholder(), clang::CodeGen::CodeGenFunction::GenerateCode(), generateDiagnosticsForCallLike(), clang::index::generateUSRForDecl(), clang::index::generateUSRForDecl(), clang::ASTNameGenerator::Implementation::getAllManglings(), clang::ASTNameGenerator::Implementation::getAllManglings(), clang::MSGuidDecl::getAsAPValue(), clang::tooling::getAssociatedRange(), clang::StoredDeclsList::getASTContext(), getASTMutationListener(), getAttrs(), getAvailability(), clang::extractapi::impl::ExtractAPIVisitorBase< std::conditional_t< std::is_same_v< Derived, void >, ExtractAPIVisitor<>, Derived > >::getBases(), clang::FunctionDecl::getBody(), clang::ObjCMethodDecl::getBody(), clang::FunctionDecl::getBuiltinID(), clang::FunctionDecl::getCallResultType(), clang::RedeclarableTemplateDecl::getCommonPtr(), getConstField(), clang::LinkageComputer::getDeclLinkageAndVisibility(), clang::VarDecl::getDefinition(), clang::VarDecl::getDescribedVarTemplate(), clang::CXXRecordDecl::getDestructor(), clang::CXXRecordDecl::getDeviceLambdaManglingNumber(), getEnclosingStmtLocation(), DerefSimplePtrArithFixableGadget::getFixits(), UPCPreIncrementGadget::getFixits(), UUCAddAssignGadget::getFixits(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForClassTemplatePartialSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForClassTemplateSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForEnum(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForTypedef(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVar(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplate(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplatePartialSpecialization(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForVarTemplateSpecialization(), getID(), clang::ObjCCategoryDecl::getImplementation(), clang::ObjCInterfaceDecl::getImplementation(), clang::FieldDecl::getInClassInitializer(), clang::CXXRecordDecl::getIndirectPrimaryBases(), clang::VarDecl::getInit(), clang::VarDecl::getInitAddress(), getLambdaCallOperatorHelper(), getLambdaStaticInvokers(), getLangOpts(), clang::LinkageComputer::getLVForDecl(), getMaxAlignment(), clang::VarDecl::getMemberSpecializationInfo(), clang::FunctionDecl::getMinRequiredArguments(), clang::CXXRecordDecl::getMSVtorDispMode(), getNDSWDS(), clang::tooling::getOccurrencesOfUSRs(), clang::LifetimeExtendedTemporaryDecl::getOrCreateValue(), getPosAsWritten(), clang::OMPDeclareMapperDecl::getPrevDeclInScope(), clang::OMPDeclareMapperDecl::getPrevDeclInScope(), clang::OMPDeclareReductionDecl::getPrevDeclInScope(), clang::OMPDeclareReductionDecl::getPrevDeclInScope(), clang::getPrimaryMergedDecl(), clang::NamedDecl::getQualifiedNameAsString(), clang::FunctionDecl::getReturnTypeSourceRange(), getSelfInitExpr(), clang::ObjCMethodDecl::getSendResultType(), clang::ObjCMethodDecl::getSendResultType(), clang::ObjCObjectPointerType::getSuperClassType(), clang::CastExpr::getTargetFieldForToUnionCast(), clang::CXXMethodDecl::getThisType(), clang::VarDecl::getTLSKind(), clang::interp::Descriptor::getType(), NonTypeOrVarTemplateParmDecl::getType(), clang::EnumDecl::getValueRange(), getVersionIntroduced(), clang::CXXRecordDecl::getVisibleConversionFunctions(), clang::installapi::getVTableLinkage(), clang::Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(), clang::VarDecl::hasConstantInitialization(), clang::VarDecl::hasDefinition(), clang::VarDecl::hasInitWithSideEffects(), hasLocalOwningModuleStorage(), clang::installapi::hasRTTI(), hasSameCudaAttrs(), hasSameOverloadableAttrs(), clang::Sema::hasStructuralCompatLayout(), clang::installapi::hasVTable(), clang::CXXConstructorDecl::init_begin(), clang::ObjCImplementationDecl::init_begin(), clang::dataflow::Environment::initialize(), clang::ento::CheckerContext::isCLibraryFunction(), clang::CXXMethodDecl::isCopyAssignmentOperator(), clang::CXXConstructorDecl::isCopyOrMoveConstructor(), clang::ParmVarDecl::isDestroyedInCallee(), clang::FunctionDecl::isDestroyingOperatorDelete(), clang::ObjCMethodDecl::isDirectMethod(), clang::ObjCPropertyDecl::isDirectProperty(), IsEquivalentFriend(), isExactClass(), isGRealloc(), isImportedDeclContext(), isInAnotherModuleUnit(), clang::Type::isIncompleteType(), isInCurrentModuleUnit(), clang::FunctionDecl::isInlineBuiltinDeclaration(), clang::installapi::isInlined(), clang::FunctionDecl::isInlineDefinitionExternallyVisible(), clang::VarDecl::isKnownToBeDefined(), clang::CXXRecordDecl::isLiteral(), clang::CXXMethodDecl::isMoveAssignmentOperator(), clang::FunctionDecl::isMSExternInline(), isNonViableMultiVersionOverload(), clang::sema::isNormalAssignmentOperator(), clang::Expr::isPotentialConstantExpr(), clang::Expr::isPotentialConstantExprUnevaluated(), clang::installapi::isRTTIWeakDef(), clang::CXXConstructorDecl::isSpecializationCopyingObject(), isStandardDelete(), isStandardNew(), isStandardRealloc(), isStdStreamVar(), isSubclass(), clang::VarDecl::isThisDeclarationADefinition(), clang::FunctionDecl::isTypeAwareOperatorNewOrDelete(), clang::FunctionDecl::isUsableAsGlobalAllocationFunctionInConstantEvaluation(), clang::CXXMethodDecl::isUsualDeallocationFunction(), isWeakImported(), isZeroSized(), clang::CXXRecordDecl::lambdaIsDefaultConstructibleAndAssignable(), clang::RedeclarableTemplateDecl::loadLazySpecializationsImpl(), clang::RedeclarableTemplateDecl::loadLazySpecializationsImpl(), clang::CXXRecordDecl::lookupInBases(), clang::extractapi::impl::ExtractAPIVisitorBase< std::conditional_t< std::is_same_v< Derived, void >, ExtractAPIVisitor<>, Derived > >::maybeMergeWithAnonymousTag(), clang::RecordDecl::mayInsertExtraPadding(), MultiVersionTypesCompatible(), clang::CXXMethodDecl::overridden_methods(), patchDefaultTargetVersion(), potentiallyWritesIntoIvar(), clang::StoredDeclsList::prependDeclNoReplace(), print(), print(), clang::TemplateParamObjectDecl::printAsExpr(), clang::TemplateParamObjectDecl::printAsInit(), clang::TemplateParamObjectDecl::printAsInit(), clang::NamedDecl::printName(), clang::TagDecl::printName(), clang::NamedDecl::printNestedNameSpecifier(), clang::NamedDecl::printQualifiedName(), clang::ClassTemplatePartialSpecializationDecl::Profile(), clang::ClassTemplateSpecializationDecl::Profile(), clang::VarTemplatePartialSpecializationDecl::Profile(), clang::VarTemplateSpecializationDecl::Profile(), clang::CXXRecordDecl::removeConversion(), saveHash(), clang::ObjCMethodDecl::setAsRedeclaration(), setAttrs(), clang::CXXRecordDecl::setBases(), clang::FieldDecl::setBitWidth(), clang::RecordDecl::setCapturedRecord(), clang::ObjCImplDecl::setClassInterface(), clang::DeclRefExpr::setDecl(), clang::FunctionDecl::setDeletedAsWritten(), clang::VarDecl::setDescribedVarTemplate(), clang::ObjCInterfaceDecl::setExternallyCompleted(), clang::ClassTemplateSpecializationDecl::setExternKeywordLoc(), clang::VarTemplateSpecializationDecl::setExternKeywordLoc(), clang::FunctionDecl::setFunctionTemplateSpecialization(), clang::ObjCCategoryDecl::setImplementation(), clang::ObjCInterfaceDecl::setImplementation(), clang::VarDecl::setInit(), clang::ClassTemplateSpecializationDecl::setInstantiationOf(), clang::VarTemplateSpecializationDecl::setInstantiationOf(), clang::CXXRecordDecl::setInstantiationOfMemberClass(), clang::EnumDecl::setInstantiationOfMemberEnum(), clang::FunctionDecl::setInstantiationOfMemberFunction(), clang::VarDecl::setInstantiationOfStaticDataMember(), clang::FunctionDecl::setIsDestroyingOperatorDelete(), clang::FunctionDecl::setIsTypeAwareOperatorNewOrDelete(), clang::CXXRecordDecl::setLambdaNumbering(), setLexicalDeclContext(), clang::TypedefNameDecl::setModedTypeSourceInfo(), clang::LabelDecl::setMSAsmLabel(), clang::BlockDecl::setParams(), clang::FunctionDecl::setParams(), clang::DeclaratorDecl::setQualifierInfo(), clang::TagDecl::setQualifierInfo(), clang::ClassTemplateSpecializationDecl::setTemplateArgsAsWritten(), clang::VarTemplateSpecializationDecl::setTemplateArgsAsWritten(), clang::ClassTemplateSpecializationDecl::setTemplateKeywordLoc(), clang::VarTemplateSpecializationDecl::setTemplateKeywordLoc(), clang::DeclaratorDecl::setTemplateParameterListsInfo(), clang::TagDecl::setTemplateParameterListsInfo(), clang::FunctionDecl::setTemplateSpecializationKind(), clang::VarDecl::setTemplateSpecializationKind(), clang::DeclaratorDecl::setTrailingRequiresClause(), shouldEmitInExternalSource(), shouldFunctionGenerateHereOnly(), shouldOmitDefinition(), shouldRunOnFunctionOrMethod(), clang::shouldSkipCheckingODR(), shouldVarGenerateHereOnly(), clang::CXXMethodDecl::size_overridden_methods(), clang::TagDecl::startDefinition(), clang::CodeGen::CodeGenFunction::StartFunction(), useInlineVisibilityHidden(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit(), clang::TextNodeDumper::Visit(), clang::installapi::InstallAPIVisitor::VisitFunctionDecl(), clang::TextNodeDumper::VisitImportDecl(), clang::ASTDeclReader::VisitLifetimeExtendedTemporaryDecl(), clang::installapi::InstallAPIVisitor::VisitObjCCategoryDecl(), clang::installapi::InstallAPIVisitor::VisitObjCInterfaceDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::RetainTypeChecker::visitTypedef(), clang::TextNodeDumper::VisitUnresolvedUsingTypenameDecl(), clang::TextNodeDumper::VisitUnresolvedUsingValueDecl(), clang::JSONNodeDumper::VisitUsingDecl(), clang::TextNodeDumper::VisitUsingDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarDecl(), clang::installapi::InstallAPIVisitor::VisitVarDecl(), and clang::TextNodeDumper::VisitVarDecl().
|
protected |
Definition at line 534 of file DeclBase.cpp.
References getASTContext(), and clang::ASTContext::getASTMutationListener().
Referenced by clang::ClassTemplateDecl::AddPartialSpecialization(), clang::VarTemplateDecl::AddPartialSpecialization(), clang::RedeclarableTemplateDecl::addSpecializationImpl(), clang::TagDecl::completeDefinition(), clang::CXXDestructorDecl::setOperatorDelete(), clang::FunctionDecl::setTemplateSpecializationKind(), and clang::VarDecl::setTemplateSpecializationKind().
Definition at line 573 of file DeclBase.h.
References getAttrs(), clang::getSpecificAttr(), hasAttrs(), and clang::T.
Referenced by clang::SemaHLSL::ActOnEndOfTranslationUnit(), clang::Sema::ActOnExplicitInstantiation(), clang::SemaHLSL::ActOnFinishBuffer(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaObjC::ActOnMethodDeclaration(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnStartOfFunctionDef(), clang::SemaHLSL::ActOnTopLevelFunction(), clang::Sema::ActOnVariableDeclarator(), clang::SemaHLSL::ActOnVariableDeclarator(), clang::CodeGen::CGHLSLRuntime::addBuffer(), clang::SemaSwift::AddParameterABIAttr(), AnalyzeBitFieldAssignment(), clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration(), clang::SemaSYCL::BuildSYCLKernelCallStmt(), clang::checkAttrMutualExclusion(), clang::checkAttrMutualExclusion(), clang::SemaRISCV::CheckBuiltinFunctionCall(), clang::Sema::checkCall(), clang::consumed::ConsumedStmtVisitor::checkCallability(), clang::SemaHLSL::CheckCompatibleParameterABI(), CheckDeclarationCausesMultiVersioning(), checkDLLAttributeRedeclaration(), clang::SemaHLSL::CheckEntryPoint(), clang::Sema::CheckFunctionDeclaration(), checkHybridPatchableAttr(), clang::Sema::CheckIfOverriddenFunctionIsMarkedFinal(), clang::Sema::checkIllFormedTrivialABIStruct(), clang::Sema::checkIncorrectVTablePointerAuthenticationAttribute(), checkLifetimeBoundAttr(), clang::Sema::checkLifetimeCaptureBy(), clang::Sema::CheckMain(), CheckMultiVersionAdditionalDecl(), CheckMultiVersionFirstFunction(), CheckMultiVersionFunction(), CheckMultiVersionValue(), clang::SemaObjC::CheckObjCMethodDirectOverrides(), clang::Sema::CheckOverrideControl(), clang::Sema::CheckOverridingFunctionAttributes(), checkPreviousOMPAllocateAttribute(), checkSelectAnyAttr(), clang::SemaHLSL::CheckSemanticAnnotation(), clang::SemaARM::CheckSMEFunctionDefAttributes(), clang::Sema::CheckStaticLocalForDllExport(), clang::SemaSYCL::CheckSYCLEntryPointFunctionDecl(), clang::SemaSYCL::CheckSYCLExternalFunctionDecl(), clang::CodeGen::CodeGenFunction::checkTargetFeatures(), checkWeakAttr(), checkWeakRefAttr(), classifyCapability(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), copyAttrFromTypedefToDecl(), copyAttrIfPresent(), GlobalDeclRefChecker::declareTargetInitializer(), clang::Sema::DiagnoseSentinelCalls(), clang::SemaHLSL::diagnoseSystemSemanticAttr(), DiagnoseUnusedOfDecl(), DoEmitAvailabilityWarning(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), clang::CIRGen::CIRGenFunction::emitAutoVarInit(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), clang::CIRGen::CIRGenFunction::emitCallArgs(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CodeGen::CodeGenModule::EmitGlobal(), EmitGlobalNamedRegister(), emitReadOnlyPlacementAttrWarning(), clang::CodeGen::CGHLSLRuntime::emitResourceArraySubscriptExpr(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::Sema::FinalizeDeclaration(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::index::generateUSRForDecl(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable(), clang::CodeGen::CodeGenModule::GetAddrOfFunction(), clang::FunctionDecl::getBuiltinID(), getCallingConventionForDecl(), getDefiningAttr(), clang::getDLLAttr(), clang::CFGCleanupFunction::getFunctionDecl(), clang::ASTContext::getFunctionFeatureMap(), getGlobalDeclForDirectCall(), getImplicitCodeSegAttrFromClass(), GetMatchingCType(), clang::ObjCMethodDecl::getMethodFamily(), clang::CXXRecordDecl::getMSInheritanceModel(), clang::CXXRecordDecl::getMSVtorDispMode(), getNonNullAttr(), clang::ObjCInterfaceDecl::getObjCRuntimeNameAsString(), clang::ObjCProtocolDecl::getObjCRuntimeNameAsString(), clang::CodeGen::CodeGenModule::getOMPAllocateAlignment(), clang::getOpenCLArgAccess(), clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal(), clang::index::getSymbolInfo(), getVisibilityOf(), clang::CodeGen::CodeGenModule::GetWeakRefReference(), clang::SemaOpenCL::handleAccessAttr(), clang::SemaSwift::handleAsyncAttr(), clang::SemaSwift::handleAsyncError(), clang::SemaSwift::handleBridge(), clang::consumed::ConsumedStmtVisitor::handleCall(), handleCodeSegAttr(), handleConstantAttr(), handleCPUSpecificAttr(), handleDeviceAttr(), clang::CodeGen::CGHLSLRuntime::handleGlobalVarDefinition(), clang::SemaHLSL::handleInitialization(), clang::SemaRISCV::handleInterruptAttr(), handleLifetimeCategoryAttr(), handleMinVectorWidthAttr(), clang::SemaARM::handleNewAttr(), handleNoBuiltinAttr(), clang::SemaHLSL::handleRootSignatureAttr(), clang::SemaOpenCL::handleSubGroupSize(), handleTargetClonesAttr(), handleVecReturnAttr(), handleVecTypeHint(), handleVTablePointerAuthentication(), handleWorkGroupSize(), clang::CodeGen::CGOpenMPRuntime::hasAllocateAttributeForGlobalVar(), clang::CodeGen::CGOpenMPRuntimeGPU::hasAllocateAttributeForGlobalVar(), clang::hasArmZAState(), clang::hasArmZT0State(), hasExplicitAttr(), hasExplicitAttr(), hasIdenticalPassObjectSizeAttrs(), hasImplicitAttr(), hasImplicitAttr(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), clang::Sema::InstantiateDefaultCtorDefaultArgs(), isAllocatableDecl(), isAllocatableDecl(), isBetterMultiversionCandidate(), clang::SemaObjC::isCFError(), clang::EnumDecl::isClosed(), isGeneratedDecl(), clang::FunctionDecl::isInExternCContext(), clang::CXXRecordDecl::isInterfaceLike(), clang::FunctionDecl::isReferenceableKernel(), clang::SemaHLSL::isSemanticValid(), clang::FunctionDecl::isTargetMultiVersionDefault(), clang::VarDecl::isThisDeclarationADefinition(), clang::MangleContext::mangleName(), mangleOverrideDiscrimination(), mapConsumableAttrState(), MaybeAddSentinel(), clang::ASTContext::mayExternalize(), clang::Sema::mergeAlwaysInlineAttr(), clang::Sema::mergeCodeSegAttr(), clang::Sema::mergeDeclAttributes(), clang::Sema::mergeDLLExportAttr(), clang::Sema::mergeErrorAttr(), clang::Sema::mergeMinSizeAttr(), clang::Sema::mergeMSInheritanceAttr(), clang::SemaSwift::mergeNameAttr(), clang::SemaHLSL::mergeNumThreadsAttr(), clang::Sema::mergeOptimizeNoneAttr(), mergeParamDeclAttributes(), clang::SemaHLSL::mergeParamModifierAttr(), clang::Sema::mergeSectionAttr(), clang::SemaHLSL::mergeShaderAttr(), clang::Sema::mergeUuidAttr(), mergeVisibilityAttr(), clang::SemaHLSL::mergeVkConstantIdAttr(), clang::SemaHLSL::mergeWaveSizeAttr(), noteOverloads(), primaryBaseHaseAddressDiscriminatedVTableAuthentication(), clang::Sema::ProcessDeclAttributeList(), clang::SemaObjC::ProcessPropertyDecl(), recordUsesEBO(), clang::ASTContext::registerSYCLEntryPointFunction(), clang::CodeGen::CodeGenModule::setGlobalVisibility(), clang::CodeGen::CGHLSLRuntime::setHLSLEntryAttributes(), clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition(), clang::CodeGen::CodeGenModule::setTLSMode(), clang::CodeGen::CodeGenFunction::StartFunction(), testsFor(), clang::CodeGen::CGOpenMPRuntimeGPU::translateParameter(), clang::Sema::UnifySection(), validatePackoffset(), clang::sema::visitFunctionCallArguments(), and clang::ASTDeclReader::VisitFunctionDecl().
|
inline |
Definition at line 524 of file DeclBase.h.
References Decl().
Referenced by actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPCopyinClause(), clang::SemaOpenMP::ActOnOpenMPCopyprivateClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaOpenMP::ActOnOpenMPUseDevicePtrClause(), addAttr(), attr_begin(), attr_end(), clang::Sema::BuildReturnStmt(), CheckStructurallyEquivalentAttributes(), createPrivatesRecordDecl(), dropAttrs(), clang::CodeGen::CGHLSLRuntime::emitEntryFunction(), clang::SemaOpenMP::EndOpenMPDSABlock(), fillPackoffsetLayout(), getAttr(), getMaxAlignment(), hasAttr(), hasAttr(), clang::ASTImporter::Import(), clang::Sema::mergeAvailabilityAttr(), RedeclarePropertyAccessor(), clang::ASTDeclWriter::VisitDecl(), and clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitLabelStmt().
const AttrVec & Decl::getAttrs | ( | ) | const |
Definition at line 1045 of file DeclBase.cpp.
References getASTContext(), and clang::ASTContext::getDeclAttrs().
AvailabilityResult Decl::getAvailability | ( | std::string * | Message = nullptr, |
VersionTuple | EnclosingVersion = VersionTuple(), | ||
StringRef * | RealizedPlatform = nullptr ) const |
Determine the availability of the given declaration.
This routine will determine the most restrictive availability of the given declaration (e.g., preferring 'unavailable' to 'deprecated').
Message | If non-NULL and the result is not AR_Available , will be set to a (possibly empty) message describing why the declaration has not been introduced, is deprecated, or is unavailable. |
EnclosingVersion | The version to compare with. If empty, assume the deployment target version. |
RealizedPlatform | If non-NULL and the availability result is found in an available attribute it will set to the platform which is written in the available attribute. |
Definition at line 753 of file DeclBase.cpp.
References clang::AR_Available, clang::AR_Deprecated, clang::AR_Unavailable, attrs(), CheckAvailability(), getASTContext(), and clang::Result.
Referenced by clang::SemaObjC::addMethodToGlobalList(), clang::Sema::CanUseDecl(), DiagnoseObjCImplementedDeprecations(), clang::SemaObjC::DiagnoseUnimplementedProperties(), getDeclAvailability(), isDeprecated(), isUnavailable(), clang::Sema::ShouldDiagnoseAvailabilityOfDecl(), and shouldWarnUndefinedMethod().
|
inline |
Definition at line 431 of file DeclBase.h.
References clang::SourceRange::getBegin(), and getSourceRange().
Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::ActOnStartConceptDefinition(), clang::CodeGen::CodeGenModule::AddDeferredUnusedCoverageMapping(), CheckBindingsCount(), checkExportedDecl(), clang::SemaObjC::CheckObjCBridgeRelatedConversions(), CheckUnreachable(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::SemaObjC::diagnoseNullResettableSynthesizedSetters(), clang::CodeGen::CGOpenMPRuntimeGPU::emitFunctionProlog(), clang::EmitIncompleteCountedByPointeeNotes(), GenerateFixForUnusedDecl(), getDeclLocsForCommentSearch(), getSourceRangeToTokenEnd(), clang::SemaX86::handleAnyInterruptAttr(), clang::SemaObjC::handleBridgeAttr(), clang::SemaObjC::handleBridgeMutableAttr(), clang::SemaObjC::handleBridgeRelatedAttr(), clang::SemaObjC::handleExternallyRetainedAttr(), handleMIGServerRoutineAttr(), handleNonStringAttr(), clang::SemaObjC::handleNSErrorDomain(), clang::SemaObjC::handleOwnershipAttr(), handlePassObjectSizeAttr(), clang::SemaObjC::handleRequiresSuperAttr(), clang::SemaHLSL::handleResourceBindingAttr(), clang::SemaObjC::handleReturnsInnerPointerAttr(), clang::handleSimpleAttributeOrDiagnose(), clang::SemaObjC::handleXReturnsXRetainedAttr(), clang::TemplateDeclInstantiator::InstantiateTypeAliasTemplateDecl(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), MatchTemplateParameterKind(), clang::InitializationSequence::Perform(), RedeclarePropertyAccessor(), ShouldDiagnoseAvailabilityInContext(), clang::LexicallyOrderedRecursiveASTVisitor< Derived >::TraverseDeclContextHelper(), clang::ASTDeclWriter::VisitLabelDecl(), clang::ASTNodeImporter::VisitLabelDecl(), clang::ASTDeclWriter::VisitOMPDeclareReductionDecl(), clang::ASTDeclWriter::VisitPragmaCommentDecl(), and clang::ASTDeclWriter::VisitPragmaDetectMismatchDecl().
|
inlinevirtual |
getBody - If this Decl represents a declaration for a body of code, such as a function or method definition, this method returns the top-level Stmt* of that body.
Otherwise this method returns null.
Reimplemented in clang::BlockDecl, clang::CapturedDecl, clang::FunctionDecl, clang::ObjCMethodDecl, and clang::OutlinedFunctionDecl.
Definition at line 1087 of file DeclBase.h.
Referenced by clang::CloneDetector::analyzeCodeBody(), CheckStringRefAssignedTemporary(), clang::checkUnsafeBufferUsage(), clang::ento::PathDiagnosticLocation::createDeclBegin(), emitDiagnostics(), clang::CodeGen::CGOpenMPRuntime::emitTargetFunctions(), getBodyRBrace(), clang::ento::getWidenedLoopState(), hasBody(), clang::TrivialFunctionAnalysisVisitor::IsFunctionTrivial(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), populateExecutedLinesWithFunctionSignature(), and potentiallyWritesIntoIvar().
SourceLocation Decl::getBodyRBrace | ( | ) | const |
getBodyRBrace - Gets the right brace of the body, if a body exists.
This works whether the body is a CompoundStmt or a CXXTryStmt.
Definition at line 1076 of file DeclBase.cpp.
References clang::Definition, and getBody().
Referenced by clang::ento::PathDiagnosticLocation::createDeclEnd(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCMethod(), and clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction().
|
inlineprotected |
Definition at line 413 of file DeclBase.h.
References CacheValidAndLinkage.
Referenced by clang::LinkageComputer::getLVForDecl(), and clang::NamedDecl::isLinkageValid().
|
inlinevirtual |
Retrieves the "canonical" declaration of the given declaration.
Reimplemented in clang::ClassTemplateDecl, clang::ConceptDecl, clang::CXXConstructorDecl, clang::CXXConversionDecl, clang::CXXDestructorDecl, clang::CXXMethodDecl, clang::CXXRecordDecl, clang::EnumConstantDecl, clang::EnumDecl, clang::FieldDecl, clang::FunctionDecl, clang::FunctionTemplateDecl, clang::IndirectFieldDecl, clang::NamespaceAliasDecl, clang::NamespaceDecl, clang::ObjCInterfaceDecl, clang::ObjCIvarDecl, clang::ObjCMethodDecl, clang::ObjCProtocolDecl, clang::RedeclarableTemplateDecl, clang::TagDecl, clang::TemplateParamObjectDecl, clang::TranslationUnitDecl, clang::TypeAliasTemplateDecl, clang::TypedefNameDecl, clang::UnresolvedUsingTypenameDecl, clang::UnresolvedUsingValueDecl, clang::UsingDecl, clang::UsingEnumDecl, clang::UsingPackDecl, clang::UsingShadowDecl, clang::VarDecl, clang::VarTemplateDecl, and FieldDecl.
Definition at line 978 of file DeclBase.h.
References Decl().
Referenced by clang::Sema::ActOnPragmaMSAllocText(), clang::ODRHash::AddDecl(), clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), clang::ASTReader::AssignedLambdaNumbering(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::ASTContext::cacheRawCommentForDecl(), clang::SemaOpenACC::CheckDeclareClause(), CheckIdentityFieldAssignment(), clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentPointerToMember(), compareDeclarations(), clang::NamedDecl::declarationReplaces(), clang::declaresSameEntity(), clang::ASTContext::deduplicateMergedDefinitionsFor(), DiagnoseInvalidRedeclaration(), DiagnoseSelfAssignment(), clang::Sema::DiagnoseSelfMove(), clang::Sema::DiagnoseUseOfDecl(), diagnoseUseOfInternalDeclInInlineFunction(), clang::CodeGen::CGDebugInfo::emitFunctionStart(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), clang::ADLResult::erase(), clang::ClassTemplateDecl::findPartialSpecInstantiatedFromMember(), clang::ASTReader::forEachImportedKeyDecl(), clang::index::generateUSRForDecl(), getCanonicalDecl(), getCanonicalDecl(), getCanonicalDecl(), clang::ASTContext::getCanonicalTemplateArgument(), clang::ASTContext::getCanonicalTemplateName(), clang::ASTContext::getCommentForDecl(), getDeclForLocalLookup(), clang::ASTReader::GetExistingDecl(), clang::ASTWriter::getFirstLocalDecl(), clang::NamedDecl::getFormalLinkage(), clang::ASTReader::getKeyDeclaration(), clang::ASTContext::getModulesWithMergedDefinition(), clang::Sema::getNormalizedAssociatedConstraints(), clang::CallGraph::getOrInsertNode(), clang::ASTContext::getRawCommentForAnyRedecl(), clang::ASTContext::getSubstTemplateTypeParmPackType(), clang::VTableContextBase::getThunkInfo(), handleLifetimeCategoryAttr(), hasRecursiveCallInPath(), clang::ASTNodeImporter::ImportAPValue(), isCanonicalDecl(), clang::ento::isCapturedByReference(), IsEquivalentForUsingDecl(), clang::OverloadCandidateSet::isNewCandidate(), clang::SemaOpenMP::isOpenMPCapturedByRef(), clang::SemaOpenMP::isOpenMPDeclareMapperVarDeclAllowed(), clang::SemaOpenMP::isOpenMPPrivateDecl(), clang::ento::isPossiblyEscaped(), isSameDeclaration(), clang::ASTContext::isSameTemplateArgument(), IsStructurallyEquivalent(), isUsed(), clang::Sema::LookupQualifiedName(), clang::Sema::LookupTemplateName(), MatchesFriend(), clang::ASTContext::mergeDefinitionIntoModule(), clang::Sema::PushSatisfactionStackEntry(), clang::LookupResult::resolveKind(), clang::Sema::SatisfactionStackContains(), setIsUsed(), shouldBeHidden(), clang::Sema::tryCaptureVariable(), clang::ASTDeclReader::UpdateDecl(), clang::ASTDeclReader::Visit(), clang::ASTDeclReader::VisitMSGuidDecl(), clang::ASTDeclReader::VisitUnnamedGlobalConstantDecl(), and wasDifferentDeclUsedForInlining().
|
inline |
Definition at line 979 of file DeclBase.h.
References Decl(), and getCanonicalDecl().
|
inline |
Definition at line 448 of file DeclBase.h.
References DeclContext.
Referenced by clang::Sema::ActOnConversionDeclarator(), clang::Sema::ActOnCXXEnterDeclInitializer(), clang::Sema::ActOnDeclarator(), clang::Sema::ActOnEnumConstant(), clang::SemaObjC::ActOnFinishObjCImplementation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::SemaOpenMP::ActOnOpenMPIteratorVarDecl(), clang::Sema::ActOnReenterTemplateScope(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), clang::Sema::ActOnTag(), clang::SemaHLSL::ActOnTopLevelFunction(), clang::Sema::ActOnTypedefNameDecl(), clang::Sema::ActOnVariableDeclarator(), clang::ASTImporterLookupTable::add(), addAssociatedClassesAndNamespaces(), clang::TypoCorrectionConsumer::addCorrection(), clang::Sema::AddFunctionCandidates(), clang::Sema::AddKnownFunctionAttributes(), clang::Sema::AddMethodCandidate(), clang::CodeGen::CodeGenTypes::addRecordTypeName(), addRedeclaredMethods(), AddTopLevelDeclarationToHash(), adjustCVQualifiersForCXXThisWithinLambda(), adjustDeclContextForDeclaratorDecl(), adjustParent(), areAllValuesNoReturn(), clang::LifetimeExtendedTemporaryDecl::ASTDeclReader, clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildCXXConstructExpr(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), buildImplicitMapper(), clang::Sema::BuildVariableInstantiation(), clang::Sema::BuildVarTemplateInstantiation(), canEmitSpuriousReferenceToVariable(), clang::Sema::CheckAddressOfOperand(), clang::SemaCUDA::checkAllowedInitializer(), checkAtomicPropertyMismatch(), CheckBindingsCount(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckConceptTemplateId(), clang::Sema::CheckCXXDefaultArgExpr(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), CheckExplicitInstantiationScope(), clang::Sema::CheckExplicitlyDefaultedFunction(), clang::Sema::CheckFriendAccess(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::SemaObjC::checkInitMethod(), clang::Sema::CheckLiteralOperatorDeclaration(), CheckMethodOverrideParam(), CheckMethodOverrideReturn(), CheckMultiVersionFunction(), clang::SemaObjC::CheckObjCMethodDirectOverrides(), clang::SemaObjC::CheckObjCMethodOverride(), clang::SemaObjC::CheckObjCMethodOverrides(), checkObjCUnusedIvar(), CheckOperatorNewDeleteDeclarationScope(), clang::Sema::CheckShadow(), clang::Sema::CheckShadowingDeclModification(), CheckSimplerImplicitMovesMSVCWorkaround(), clang::Sema::CheckTemplatePartialSpecializationArgs(), CheckTemplateSpecializationScope(), checkTupleLikeDecomposition(), checkTypeParamListConsistency(), clang::Sema::CheckUsingShadowDecl(), collectViableConversionCandidates(), compareOverloads(), clang::ASTReader::CompleteRedeclChain(), ComputeDefaultedComparisonExceptionSpec(), clang::computeDependence(), clang::LinkageComputer::computeLVForDecl(), clang::PredefinedExpr::ComputeName(), constructBufferConceptDecl(), ConvertDeducedTemplateArguments(), clang::LifetimeExtendedTemporaryDecl::Create(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), createFriendTagNNSFixIt(), clang::extractapi::impl::ExtractAPIVisitorBase< std::conditional_t< std::is_same_v< Derived, void >, ExtractAPIVisitor<>, Derived > >::createHierarchyInformationForDecl(), createHostLayoutStruct(), clang::TypeName::createNestedNameSpecifierForScopeOf(), clang::TypeName::createOuterNNS(), clang::NamedDecl::declarationReplaces(), clang::Sema::DeclClonePragmaWeak(), clang::ASTContext::DeclMustBeEmitted(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), clang::SemaObjC::DefaultSynthesizeProperties(), clang::ObjCMethodDecl::definedInNSObject(), clang::Sema::DiagnoseAmbiguousLookup(), diagnoseBadDirectAccess(), clang::Sema::DiagnoseDependentMemberLookup(), clang::Sema::DiagnoseEmptyLookup(), diagnoseInstanceReference(), DiagnoseInvalidRedeclaration(), DiagnoseLocalRegisterBinding(), diagnoseNoescape(), diagnoseOpenCLTypes(), clang::SemaObjC::DiagnoseOwningPropertyGetterSynthesis(), clang::SemaObjC::DiagnosePropertyMismatch(), clang::Sema::DiagnoseShadowingLambdaDecls(), DiagnoseTypeAwareAllocators(), clang::Sema::DiagnoseUninstantiableTemplate(), clang::Sema::DiagRedefinedPlaceholderFieldDecl(), DoMarkPotentialCapture(), clang::CodeGen::CodeGenFunction::EmitAndRegisterVariableArrayDimensions(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), clang::CodeGen::CGDebugInfo::EmitNamespaceAlias(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), emitPrivatesInit(), clang::CodeGen::CGDebugInfo::EmitUsingDirective(), clang::CodeGen::CGDebugInfo::EmitUsingShadowDecl(), evaluateVarDeclInit(), clang::Sema::FinalizeDeclaration(), findBackingIvar(), FindConversionForRefInit(), FindDeclaringClass(), findExplicitInstancetypeDeclarer(), clang::Sema::FindInstantiatedDecl(), clang::LocalInstantiationScope::findInstantiationOf(), findMetaClassAlloc(), clang::StructuralEquivalenceContext::findUntaggedStructOrUnionIndex(), clang::ASTContext::forEachMultiversionedFunctionVersion(), getAsDeclContextOrEnclosing(), getAssignmentAction(), clang::BodyFarm::getBody(), clang::ObjCMethodDecl::getCanonicalDecl(), clang::ObjCMethodDecl::getCategory(), getCategoryContext(), clang::ObjCMethodDecl::getClassInterface(), clang::ConstructorUsingShadowDecl::getConstructedBaseClass(), clang::ObjCIvarDecl::getContainingInterface(), getContextForScopeMatching(), getDeclAvailability(), getDeclContext(), getDeclContextForTemplateInstationPattern(), getDeclForLocalLookup(), getDeclLocsForCommentSearch(), clang::TemplateArgument::getDependence(), clang::diff::getEnclosingDeclContext(), getExternalSourceSymbolAttr(), clang::ASTImporter::getFieldIndex(), getHostLayoutStructName(), clang::ASTContext::getMemberPointerPathAdjustment(), getMethodReceiverIfKnownImmutable(), getNonInjectedClassName(), getNonTransparentDeclContext(), clang::ASTContext::getObjContainingInterface(), clang::CIRGen::CIRGenModule::getOrCreateStaticVarDecl(), clang::CodeGen::CodeGenModule::getOrCreateStaticVarDecl(), getOutermostFuncOrBlockContext(), clang::ConstructorUsingShadowDecl::getParent(), clang::ConstructorUsingShadowDecl::getParent(), clang::FieldDecl::getParent(), clang::FieldDecl::getParent(), getParentFunctionOrMethod(), clang::diff::SyntaxTree::Impl::getRelativeName(), clang::ObjCMethodDecl::getSendResultType(), clang::Sema::getShadowedDeclaration(), clang::ParmVarDecl::getSourceRange(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), getStaticDeclName(), getStaticDeclName(), clang::extractapi::DeclarationFragmentsBuilder::getSubHeading(), clang::index::getSymbolInfo(), getTemplateDepth(), getTranslationUnitDecl(), clang::ObjCIvarDecl::getUsageType(), clang::ObjCPropertyDecl::getUsageType(), clang::ento::MemRegionManager::getVarRegion(), clang::Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(), clang::SemaARM::handleCmseNSEntryAttr(), clang::index::IndexingContext::handleDecl(), clang::Sema::HandleDelayedAccessCheck(), clang::SemaObjC::handleDesignatedInitializer(), clang::SemaObjC::handleDirectAttr(), handleExcludeFromExplicitInstantiationAttr(), clang::SemaObjC::handleIBOutletCollection(), clang::SemaHLSL::handlePackOffsetAttr(), clang::SemaObjC::HandlePropertyInClassExtension(), clang::SemaHLSL::handleRootSignatureAttr(), handleWeakRefAttr(), hasAcceptableMemberSpecialization(), hasConflictingOverload(), hasCopyOrMoveCtorParam(), clang::dataflow::hasOptionalClassName(), hasWrittenStorageAttribute(), HelperToDiagnoseMismatchedMethodsInGlobalPool(), clang::Sema::HideUsingShadowDecl(), clang::SemaCUDA::IdentifyTarget(), clang::ASTImporter::Import(), clang::ASTNodeImporter::ImportDeclContext(), clang::ASTNodeImporter::ImportDeclParts(), clang::Sema::inferGslPointerAttribute(), InNamespace(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::Sema::InstantiateFunctionDefinition(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::Sema::InstantiateVariableDefinition(), clang::Sema::InstantiateVariableInitializer(), isAncestorDeclContextOf(), IsArtificial(), clang::LookupResult::isAvailableForLookup(), clang::isBetterOverloadCandidate(), isCapturingReferenceToHostVarInCUDADeviceLambda(), clang::dataflow::isCheckLikeMethod(), clang::ento::CheckerContext::isCLibraryFunction(), clang::NamedDecl::isCXXClassMember(), isDebuggingContext(), clang::IdentifierResolver::isDeclInScope(), isDeclWithinFunction(), IsDefaultBufferConstantDecl(), clang::ObjCMethodDecl::isDesignatedInitializerForTheInterface(), isFunctionLocalClass(), clang::FunctionDecl::isGlobal(), isInAnonymousNamespace(), IsInfinityFunction(), clang::CXXRecordDecl::isInjectedClassName(), isInStdNamespace(), clang::sema::isInStlNamespace(), clang::CXXRecordDecl::isInterfaceLike(), IsInternalDeclFromFileContext(), clang::CXXRecordDecl::isLocalClass(), clang::FunctionDecl::isMain(), isMainVar(), isMethodContextSameForKindofLookup(), isMethodDeclaredInRootProtocol(), clang::FunctionDecl::isMSVCRTEntryPoint(), isObjCMethodWithTypeParams(), isOutOfLine(), isOutOfScopePreviousDeclaration(), isParameterOf(), clang::NamedDecl::isPlaceholderVar(), IsRecordContextStructurallyEquivalent(), isReferenceToNonConstCapture(), clang::NamedDecl::isReserved(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), clang::ASTContext::isSameEntity(), isSingleLineLanguageLinkage(), clang::VarDecl::isStaticDataMember(), clang::ento::smartptr::isStdSmartPtr(), isStdStreamVar(), IsStructurallyEquivalent(), IsStructurallyEquivalent(), IsStructurallyEquivalent(), clang::ODRHash::isSubDeclToBeProcessed(), isTemplated(), clang::index::IndexingContext::isTemplateImplicitInstantiation(), isTrackedVar(), clang::FunctionDecl::isUsableAsGlobalAllocationFunctionInConstantEvaluation(), IsUserDefinedConversion(), isUsingDeclNotAtClassScope(), clang::CXXMethodDecl::isUsualDeallocationFunction(), clang::ento::isWithinStdNamespace(), clang::Sema::LookupExistingLabel(), LookupMemberExpr(), clang::DeclContext::makeDeclVisibleInContext(), clang::MangleContext::mangleObjCMethodName(), clang::ASTImporter::MapImported(), MatchesFriend(), clang::Sema::mergeObjCMethodDecls(), mergeParamDeclAttributes(), MightInstantiateTo(), clang::tooling::stdlib::Recognizer::operator()(), clang::NamedDecl::printNestedNameSpecifier(), clang::NamedDecl::printQualifiedName(), clang::Sema::ProcessAPINotes(), clang::SemaObjC::ProcessPropertyDecl(), clang::ASTImporterLookupTable::remove(), clang::DeclContext::removeDecl(), clang::tooling::replaceNestedName(), ResolveConstructorOverload(), clang::FunctionDecl::setIsPureVirtual(), setLexicalDeclContext(), shouldConsiderLinkage(), shouldConsiderLinkage(), ShouldDiagnoseAvailabilityInContext(), ShouldDiagnoseUnusedDecl(), clang::Sema::shouldLinkDependentDeclWithPrevious(), ShouldWarnAboutMissingPrototype(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), clang::CodeGen::CGOpenMPRuntimeGPU::translateParameter(), clang::IdentifierResolver::tryAddTopLevelDecl(), clang::SemaOpenMP::tryCaptureOpenMPLambdas(), clang::Sema::tryCaptureVariable(), clang::Sema::tryLookupUnambiguousFieldDecl(), TryRefInitWithConversionFunction(), TryUserDefinedConversion(), clang::ASTImporterLookupTable::update(), ValidDuplicateEnum(), clang::JSONNodeDumper::Visit(), clang::TextNodeDumper::Visit(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTDeclWriter::VisitClassTemplateDecl(), clang::ASTDeclWriter::VisitClassTemplateSpecializationDecl(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitCXXRecordDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitFieldDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitFieldDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::ASTNodeImporter::VisitFunctionTemplateDecl(), clang::JSONNodeDumper::VisitNamedDecl(), clang::ASTDeclReader::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTNodeImporter::VisitStaticAssertDecl(), clang::ASTDeclWriter::VisitTemplateTypeParmDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTDeclWriter::VisitUsingShadowDecl(), clang::ASTDeclWriter::VisitVarDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarDecl(), clang::installapi::InstallAPIVisitor::VisitVarDecl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
|
inline |
Definition at line 453 of file DeclBase.h.
References Decl(), DeclContext, and getDeclContext().
const char * Decl::getDeclKindName | ( | ) | const |
Definition at line 147 of file DeclBase.cpp.
Referenced by dump(), clang::TextNodeDumper::dumpBareDeclRef(), clang::ASTDeclWriter::Emit(), clang::CIRGen::CIRGenFunction::emitDecl(), clang::CIRGen::CIRGenModule::getCIRLinkageForDeclarator(), clang::ASTNodeImporter::ImportDeclParts(), clang::JSONNodeDumper::Visit(), clang::TextNodeDumper::Visit(), clang::TextNodeDumper::Visit(), clang::ASTNodeImporter::VisitDecl(), clang::ASTNodeImporter::VisitImportDecl(), and clang::TextNodeDumper::VisitObjCIvarRefExpr().
const Attr * Decl::getDefiningAttr | ( | ) | const |
Return this declaration's defining attribute if it has one.
Definition at line 616 of file DeclBase.cpp.
References getAttr().
TemplateDecl * Decl::getDescribedTemplate | ( | ) | const |
If this is a declaration that describes some template, this method returns that template declaration.
Note that this returns nullptr for partial specializations, because they are not modeled as TemplateDecls. Use getDescribedTemplateParams to handle those cases.
Definition at line 263 of file DeclBase.cpp.
Referenced by getDescribedTemplate(), getDescribedTemplateParams(), clang::Sema::getMoreConstrainedFunction(), handleNoSpecializations(), and clang::ASTNodeImporter::VisitFunctionTemplateDecl().
const TemplateParameterList * Decl::getDescribedTemplateParams | ( | ) | const |
If this is a declaration that describes some template or partial specialization, this returns the corresponding template parameter list.
Definition at line 276 of file DeclBase.cpp.
References getDescribedTemplate().
Referenced by getTemplateDepth(), and isTemplated().
|
inline |
Definition at line 435 of file DeclBase.h.
References clang::SourceRange::getEnd(), and getSourceRange().
Referenced by clang::Sema::ActOnFinishFunctionBody(), clang::TemplateDeclInstantiator::adjustForRewrite(), clang::Sema::checkFinalSuspendNoThrow(), checkTypeParamListConsistency(), ComputeDefaultedComparisonExceptionSpec(), clang::Sema::DefineDefaultedComparison(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), clang::FunctionDecl::FunctionDecl(), GenerateFixForUnusedDecl(), clang::tooling::getAssociatedRange(), clang::CoroutineBodyStmt::getEndLoc(), clang::ExportDecl::getEndLoc(), clang::LinkageSpecDecl::getEndLoc(), clang::ObjCTypeParamDecl::getSourceRange(), clang::OMPCapturedExprDecl::getSourceRange(), clang::UnresolvedUsingValueDecl::getSourceRange(), clang::UsingDecl::getSourceRange(), getSourceRangeToTokenEnd(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), clang::Sema::InstantiateFunctionDefinition(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), maybeRecoverWithZeroInitialization(), clang::interp::NoRet(), RedeclarePropertyAccessor(), clang::CodeGen::CodeGenModule::Release(), SuggestInitializationFixit(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), and clang::ASTDeclWriter::VisitImportDecl().
ExternalSourceSymbolAttr * Decl::getExternalSourceSymbolAttr | ( | ) | const |
Looks on this and related declarations for an applicable external source symbol attribute.
Definition at line 590 of file DeclBase.cpp.
References Decl(), clang::Definition, and getDeclContext().
Referenced by GetExternalSourceContainer(), and clang::index::getSymbolInfo().
|
inline |
Determines whether this declaration is the object of a friend declaration and, if so, what kind.
There is currently no direct way to find the associated FriendDecl.
Definition at line 1226 of file DeclBase.h.
References FOK_Declared, FOK_None, FOK_Undeclared, IDNS_Ordinary, IDNS_OrdinaryFriend, IDNS_Tag, and IDNS_TagFriend.
Referenced by clang::Sema::ActOnPureSpecifier(), clang::Sema::ArgumentDependentLookup(), clang::Sema::canFullyTypeCheckRedeclaration(), clang::Sema::checkClassLevelDLLAttribute(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::ASTDeclReader::checkMultipleDefinitionInNamedModules(), CheckMultiVersionAdditionalDecl(), ComputeDefaultedComparisonExceptionSpec(), DiagnoseInvalidRedeclaration(), clang::Sema::FindInstantiatedDecl(), clang::Sema::FriendConstraintsDependOnEnclosingTemplate(), getTemplateDepth(), clang::Sema::GetTemplateParameterList(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::FunctionDecl::getTemplateSpecializationKindForInstantiation(), clang::Sema::InstantiateClass(), clang::Sema::InstantiateDefaultArgument(), clang::FunctionDecl::isMemberLikeConstrainedFriend(), isTemplated(), clang::FunctionDecl::isThisDeclarationInstantiatedFromAFriendDefinition(), clang::Sema::MergeCXXFunctionDecl(), clang::Sema::MergeFunctionDecl(), clang::serialization::needsAnonymousDeclarationNumber(), clang::ASTDeclReader::ReadFunctionDefinition(), shouldBeHidden(), clang::Sema::shouldLinkDependentDeclWithPrevious(), SubstituteConstraintExpressionWithoutSatisfaction(), clang::TextNodeDumper::Visit(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitFunctionDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
const FunctionType * Decl::getFunctionType | ( | bool | BlocksToo = true | ) | const |
Looks through the Decl's underlying type to extract a FunctionType when possible.
This includes direct FunctionDecls, along with various function types and typedefs. This includes function pointers/references, member function pointers, and optionally if BlocksToo
is set Objective-C block pointers. Returns nullptr if the type underlying the Decl does not have a FunctionType.
Definition at line 1199 of file DeclBase.cpp.
References clang::Type::castAs(), clang::Type::getAs(), getPointeeType(), clang::isa(), clang::Type::isBlockPointerType(), clang::Type::isFunctionPointerType(), clang::Type::isFunctionReferenceType(), clang::Type::isMemberFunctionPointerType(), and clang::QualType::isNull().
Referenced by clang::Sema::checkCall(), clang::Sema::FunctionNonObjectParamTypesAreEqual(), clang::Sema::getFormatStringInfo(), clang::getFunctionOrMethodNumParams(), clang::getFunctionOrMethodParamType(), clang::getFunctionOrMethodResultType(), clang::SemaRISCV::handleInterruptAttr(), clang::SemaARM::handleNewAttr(), handleNonNullAttrParameter(), handleSentinelAttr(), handleWarnUnusedResult(), clang::hasFunctionProto(), clang::isFuncOrMethodForAttrSubject(), clang::isFunctionOrMethodVariadic(), and isKernelDecl().
GlobalDeclID Decl::getGlobalID | ( | ) | const |
Retrieve the global declaration ID associated with this declaration, which specifies where this Decl was loaded from.
Definition at line 107 of file DeclBase.cpp.
References isFromASTFile().
Referenced by clang::ASTWriter::getDeclID(), clang::ASTWriter::GetDeclRef(), and clang::ASTReader::getOwningModuleFile().
int64_t Decl::getID | ( | ) | const |
Definition at line 1195 of file DeclBase.cpp.
References Decl(), clang::ASTContext::getAllocator(), and getASTContext().
Referenced by clang::ento::ParamVarRegion::dumpToStream().
|
inline |
Definition at line 889 of file DeclBase.h.
Referenced by clang::Sema::ArgumentDependentLookup(), CalculateHiddenNames(), clang::Sema::FilterUsingLookup(), hasTagIdentifierNamespace(), isInIdentifierNamespace(), setLocalExternDecl(), setObjectOfFriendDecl(), clang::UsingShadowDecl::setTargetDecl(), shouldBeHidden(), clang::ASTDeclWriter::VisitFunctionDecl(), clang::ASTDeclWriter::VisitRedeclarableTemplateDecl(), clang::ASTDeclWriter::VisitTagDecl(), and clang::ASTDeclWriter::VisitUsingShadowDecl().
Definition at line 867 of file DeclBase.cpp.
References clang::Block, BuiltinTemplate, clang::Concept, clang::Empty, clang::Enum, clang::Friend, clang::Function, clang::FunctionTemplate, IDNS_Label, IDNS_Member, IDNS_Namespace, IDNS_ObjCProtocol, IDNS_OMPMapper, IDNS_OMPReduction, IDNS_Ordinary, IDNS_Tag, IDNS_Type, IDNS_Using, clang::TypeAlias, clang::TypeAliasTemplate, clang::Typedef, and clang::VarTemplate.
|
inline |
Get the imported owning module, if this decl is from an imported (non-local) module.
Definition at line 812 of file DeclBase.h.
References hasOwningModule(), and isFromASTFile().
Referenced by clang::Sema::CheckTemplateParameterList(), getOwningModule(), clang::extractapi::impl::ExtractAPIVisitorBase< std::conditional_t< std::is_same_v< Derived, void >, ExtractAPIVisitor<>, Derived > >::getOwningModuleName(), clang::ODRDiagsEmitter::getOwningModuleNameForDiagnostic(), clang::extractapi::TypedefUnderlyingTypeResolver::getSymbolReferenceForType(), and clang::ASTReader::mergeDefinitionVisibility().
|
inline |
Definition at line 442 of file DeclBase.h.
Referenced by clang::Sema::ActOnFields(), clang::Sema::ActOnFunctionDeclarator(), clang::ODRHash::AddDecl(), clang::CodeGen::CodeGenModule::AddDeferredUnusedCoverageMapping(), clang::ASTDeclReader::attachLatestDecl(), clang::ASTDeclReader::attachPreviousDecl(), clang::Sema::BuildDeclarationNameExpr(), castToDeclContext(), clang::AccessSpecDecl::classof(), clang::BaseUsingDecl::classof(), clang::BindingDecl::classof(), clang::BlockDecl::classof(), clang::BuiltinTemplateDecl::classof(), clang::CapturedDecl::classof(), clang::ClassTemplateDecl::classof(), clang::ClassTemplatePartialSpecializationDecl::classof(), clang::ClassTemplateSpecializationDecl::classof(), clang::ConceptDecl::classof(), clang::ConstructorUsingShadowDecl::classof(), clang::CXXConstructorDecl::classof(), clang::CXXConversionDecl::classof(), clang::CXXDeductionGuideDecl::classof(), clang::CXXDestructorDecl::classof(), clang::CXXMethodDecl::classof(), clang::CXXRecordDecl::classof(), clang::DeclaratorDecl::classof(), clang::DeclContext::classof(), clang::DecompositionDecl::classof(), clang::EmptyDecl::classof(), clang::EnumConstantDecl::classof(), clang::EnumDecl::classof(), clang::ExportDecl::classof(), clang::ExternCContextDecl::classof(), clang::FieldDecl::classof(), clang::FileScopeAsmDecl::classof(), clang::FriendDecl::classof(), clang::FriendTemplateDecl::classof(), clang::FunctionDecl::classof(), clang::FunctionTemplateDecl::classof(), clang::HLSLBufferDecl::classof(), clang::HLSLRootSignatureDecl::classof(), clang::ImplicitConceptSpecializationDecl::classof(), clang::ImplicitParamDecl::classof(), clang::IndirectFieldDecl::classof(), clang::LabelDecl::classof(), clang::LifetimeExtendedTemporaryDecl::classof(), clang::LinkageSpecDecl::classof(), clang::MSGuidDecl::classof(), clang::MSPropertyDecl::classof(), clang::NamedDecl::classof(), clang::NamespaceAliasDecl::classof(), clang::NamespaceBaseDecl::classof(), clang::NamespaceDecl::classof(), clang::NonTypeTemplateParmDecl::classof(), clang::ObjCAtDefsFieldDecl::classof(), clang::ObjCCategoryDecl::classof(), clang::ObjCCategoryImplDecl::classof(), clang::ObjCCompatibleAliasDecl::classof(), clang::ObjCContainerDecl::classof(), clang::ObjCImplDecl::classof(), clang::ObjCImplementationDecl::classof(), clang::ObjCInterfaceDecl::classof(), clang::ObjCIvarDecl::classof(), clang::ObjCMethodDecl::classof(), clang::ObjCPropertyDecl::classof(), clang::ObjCPropertyImplDecl::classof(), clang::ObjCProtocolDecl::classof(), clang::ObjCTypeParamDecl::classof(), clang::OMPAllocateDecl::classof(), clang::OMPDeclareMapperDecl::classof(), clang::OMPDeclareReductionDecl::classof(), clang::OMPRequiresDecl::classof(), clang::OMPThreadPrivateDecl::classof(), clang::OpenACCConstructDecl::classof(), clang::OpenACCDeclareDecl::classof(), clang::OpenACCRoutineDecl::classof(), clang::OutlinedFunctionDecl::classof(), clang::ParmVarDecl::classof(), clang::PragmaCommentDecl::classof(), clang::PragmaDetectMismatchDecl::classof(), clang::RecordDecl::classof(), clang::RedeclarableTemplateDecl::classof(), clang::RequiresExprBodyDecl::classof(), clang::StaticAssertDecl::classof(), clang::TagDecl::classof(), clang::TemplateDecl::classof(), clang::TemplateParamObjectDecl::classof(), clang::TemplateTemplateParmDecl::classof(), clang::TopLevelStmtDecl::classof(), clang::TranslationUnitDecl::classof(), clang::TypeAliasDecl::classof(), clang::TypeAliasTemplateDecl::classof(), clang::TypeDecl::classof(), clang::TypedefDecl::classof(), clang::TypedefNameDecl::classof(), clang::UnnamedGlobalConstantDecl::classof(), clang::UnresolvedUsingIfExistsDecl::classof(), clang::UnresolvedUsingTypenameDecl::classof(), clang::UnresolvedUsingValueDecl::classof(), clang::UsingDecl::classof(), clang::UsingDirectiveDecl::classof(), clang::UsingEnumDecl::classof(), clang::UsingPackDecl::classof(), clang::UsingShadowDecl::classof(), clang::ValueDecl::classof(), clang::VarDecl::classof(), clang::VarTemplateDecl::classof(), clang::VarTemplatePartialSpecializationDecl::classof(), clang::VarTemplateSpecializationDecl::classof(), compareDeclarations(), clang::ASTReader::CompleteRedeclChain(), clang::LinkageComputer::computeLVForDecl(), clang::NamedDecl::declarationReplaces(), DeduceTemplateArgumentsByTypeMatch(), clang::ODRDiagsEmitter::diagnoseMismatch(), dumpPreviousDecl(), clang::CodeGen::CodeGenFunction::EmitDecl(), clang::CIRGen::CIRGenFunction::emitDecl(), clang::CodeGen::CodeGenModule::EmitDeferredUnusedCoverageMappings(), clang::CodeGen::CodeGenModule::EmitTopLevelDecl(), clang::ASTReader::FindExternalLexicalDecls(), clang::ObjCContainerDecl::FindPropertyDeclaration(), clang::getCursorKindForDecl(), getDefaultTemplateArgumentOrNone(), clang::ASTNodeKind::getFromNode(), getKind(), clang::ASTDeclReader::getMostRecentDecl(), clang::Sema::getNamedReturnInfo(), clang::getReplacedTemplateParameterList(), clang::index::getSymbolInfo(), clang::NamedDecl::getUnderlyingDecl(), clang::ExplicitSpecifier::isEquivalent(), clang::VarDecl::isFileVarDecl(), clang::VarDecl::isFunctionOrMethodVarDecl(), isInstantiationOf(), clang::VarDecl::isLocalVarDecl(), clang::VarDecl::isLocalVarDeclOrParm(), clang::ASTContext::isSameEntity(), clang::ASTContext::isSameTemplateParameter(), clang::VarDecl::isStaticDataMember(), IsStructurallyEquivalent(), clang::ODRHash::isSubDeclToBeProcessed(), isTemplateParameter(), clang::TemplateDecl::isTypeAlias(), MatchTemplateParameterKind(), clang::ento::CheckerManager::runCheckersOnASTDecl(), setNonMemberOperator(), clang::RecursiveASTVisitor< Derived >::TraverseDecl(), clang::declvisitor::Base< Ptr, ImplClass, RetTy >::Visit(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitFieldDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclReader::VisitRedeclarableTemplateDecl(), and clang::ASTDeclWriter::VisitVarDecl().
const LangOptions & Decl::getLangOpts | ( | ) | const |
Helper to get the language options from the ASTContext.
Defined out of line to avoid depending on ASTContext.h.
Definition at line 530 of file DeclBase.cpp.
References getASTContext(), and clang::ASTContext::getLangOpts().
Referenced by canBeWeakImported(), clang::VarDecl::checkForConstantInitialization(), clang::CodeGen::CGDebugInfo::completeRequiredType(), clang::CXXRecordDecl::defaultedDefaultConstructorIsConstexpr(), clang::CXXRecordDecl::defaultedDestructorIsConstexpr(), clang::FunctionDecl::getBuiltinID(), clang::GlobalDecl::getDefaultKernelReference(), clang::FunctionDecl::getMinRequiredArguments(), clang::VarDecl::getTLSKind(), clang::VarDecl::hasConstantInitialization(), clang::CXXRecordDecl::isLiteral(), clang::FunctionDecl::isMain(), clang::VarDecl::isUsableInConstantExpressions(), clang::tooling::stdlib::Recognizer::operator()(), and clang::RetainTypeChecker::visitTranslationUnitDecl().
|
inline |
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
May be different from getDeclContext() (SemanticDC). e.g.:
namespace A { void f(); // SemanticDC == LexicalDC == 'namespace A' } void A::f(); // SemanticDC == namespace 'A' // LexicalDC == global namespace
Definition at line 918 of file DeclBase.h.
References DeclContext.
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaOpenACC::ActOnVariableInit(), clang::ASTUnit::addFileLevelDecl(), clang::DeclContext::addHiddenDecl(), clang::Sema::AddInitializerToDecl(), adjustDeclContextForDeclaratorDecl(), clang::Sema::AreConstraintExpressionsEqual(), clang::Sema::ArgumentDependentLookup(), clang::Sema::BuildVariableInstantiation(), CalculateTemplateDepthForConstraints(), clang::Sema::canFullyTypeCheckRedeclaration(), clang::SemaOpenACC::CheckDeclareClause(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::Sema::CheckForFunctionRedefinition(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::ASTDeclReader::checkMultipleDefinitionInNamedModules(), clang::Sema::CheckRedeclarationExported(), checkTupleLikeDecomposition(), clang::ASTReader::CompleteRedeclChain(), ComputeDefaultedComparisonExceptionSpec(), clang::DeclContext::containsDecl(), clang::Sema::DiagnoseDeletedDefaultedFunction(), DiagUninitUse(), clang::exceptionSpecNotKnownYet(), clang::Sema::FindInstantiatedDecl(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary(), clang::ASTWriter::getAnonymousDeclarationNumber(), getContextForScopeMatching(), getDefiningModule(), getEnclosingExportDecl(), getFriendCountAndPosition(), clang::ASTContext::getInlineVariableDefinitionKind(), getLexicalDeclContext(), getParentFunctionOrMethod(), getTemplateDepth(), clang::Sema::HandleDelayedAccessCheck(), hasAcceptableMemberSpecialization(), clang::ASTNodeImporter::ImportDeclContext(), clang::index::IndexingContext::indexBody(), clang::index::IndexingContext::indexNestedNameSpecifierLoc(), clang::index::IndexingContext::indexTypeLoc(), clang::Sema::InstantiateDefaultArgument(), clang::Sema::InstantiateExceptionSpec(), clang::Sema::InstantiateFunctionDefinition(), clang::Sema::InstantiateVariableDefinition(), clang::ClassTemplateSpecializationDecl::isClassScopeExplicitSpecialization(), clang::VarTemplateSpecializationDecl::isClassScopeExplicitSpecialization(), clang::VarDecl::isFileVarDecl(), clang::VarDecl::isFunctionOrMethodVarDecl(), isInExportDeclContext(), clang::FunctionDecl::isInExternCContext(), clang::VarDecl::isInExternCContext(), clang::FunctionDecl::isInExternCXXContext(), clang::VarDecl::isInExternCXXContext(), isInLocalScopeForInstantiation(), clang::VarDecl::isLocalVarDecl(), isOutOfLine(), IsOverloadOrOverrideImpl(), clang::ento::BugSuppression::isSuppressed(), isTemplated(), clang::Sema::MergeFunctionDecl(), mergeTypeWithPrevious(), clang::Sema::MergeVarDecl(), clang::serialization::needsAnonymousDeclarationNumber(), RedeclForcesDefC99(), clang::Sema::RegisterLocallyScopedExternCDecl(), clang::DeclContext::removeDecl(), clang::Sema::SetDeclDefaulted(), setLexicalDeclContext(), clang::Sema::shouldLinkDependentDeclWithPrevious(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), substituteParameterMappings(), clang::JSONNodeDumper::Visit(), clang::TextNodeDumper::Visit(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTemplateTypeParmDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTDeclWriter::VisitUsingShadowDecl(), clang::ASTDeclWriter::VisitVarDecl(), clang::ASTDeclReader::VisitVarDeclImpl(), and clang::Sema::warnOnCTypeHiddenInCPlusPlus().
|
inline |
Definition at line 923 of file DeclBase.h.
References Decl(), DeclContext, and getLexicalDeclContext().
|
inline |
Get the local owning module, if known.
Returns nullptr if owner is not yet known or declaration is not from a module.
Definition at line 821 of file DeclBase.h.
References hasLocalOwningModuleStorage(), hasOwningModule(), and isFromASTFile().
Referenced by getOwningModule().
|
inline |
Definition at line 439 of file DeclBase.h.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::SemaObjC::ActOnAtEnd(), clang::Sema::ActOnClassTemplateSpecialization(), clang::SemaObjC::ActOnCompatibilityAlias(), clang::Sema::ActOnCompoundStmt(), clang::Sema::ActOnConversionDeclarator(), clang::Sema::ActOnCXXConditionDeclaration(), clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnCXXForRangeDecl(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnEndOfTranslationUnit(), clang::Sema::ActOnEnumBody(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFields(), clang::SemaHLSL::ActOnFinishBuffer(), clang::SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnForStmt(), clang::SemaObjC::ActOnForwardClassDeclaration(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnInitializerError(), clang::SemaOpenACC::ActOnIntExpr(), clang::SemaObjC::ActOnIvar(), clang::Sema::ActOnLabelStmt(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), clang::SemaObjC::ActOnMethodDeclaration(), clang::SemaObjC::ActOnMethodParmDeclaration(), clang::Sema::ActOnMSAsmStmt(), clang::Sema::ActOnNamespaceAliasDef(), clang::SemaObjC::ActOnObjCForCollectionStmt(), clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPAlignedClause(), clang::SemaOpenMP::ActOnOpenMPAllocateDirective(), clang::SemaOpenMP::ActOnOpenMPCopyprivateClause(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerStart(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerStart(), clang::SemaOpenMP::ActOnOpenMPDeclareSimdDirective(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaOpenMP::ActOnOpenMPRegionEnd(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ActOnPopScope(), clang::Sema::ActOnPragmaRedefineExtname(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::ActOnPureSpecifier(), clang::SemaObjC::ActOnStartCategoryImplementation(), clang::SemaObjC::ActOnStartCategoryInterface(), clang::SemaObjC::ActOnStartClassImplementation(), clang::SemaObjC::ActOnStartClassInterface(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnStartOfFunctionDef(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), clang::SemaObjC::ActOnStartProtocolInterface(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), clang::Sema::ActOnTag(), clang::Sema::ActOnTagTemplateIdType(), clang::Sema::ActOnVariableDeclarator(), clang::SemaHLSL::ActOnVariableDeclarator(), clang::ASTUnit::addFileLevelDecl(), addFunctionPointerConversion(), clang::installapi::FrontendRecordsSlice::addGlobal(), clang::CodeGen::CodeGenModule::AddGlobalAnnotations(), clang::Sema::addInitCapture(), clang::Sema::AddInitializerToDecl(), clang::Sema::AddKnownFunctionAttributes(), clang::Sema::AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(), clang::installapi::FrontendRecordsSlice::addObjCCategory(), clang::installapi::FrontendRecordsSlice::addObjCInterface(), clang::installapi::FrontendRecordsSlice::addObjCIVar(), clang::Sema::AddTemplateParametersToLambdaCallOperator(), clang::Sema::ApplyAPINotesType(), clang::Sema::ApplyNullability(), clang::applyObjCTypeArgs(), clang::Sema::areMultiversionVariantFunctionsCompatible(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), clang::LifetimeExtendedTemporaryDecl::ASTDeclReader, clang::SemaObjC::AtomicPropertySetterGetterRules(), clang::Sema::AttachTypeConstraint(), clang::Sema::AttachTypeConstraint(), clang::Sema::BuildBlockForLambdaConversion(), clang::Sema::BuildBuiltinOffsetOf(), buildCoawaitCalls(), clang::Sema::BuildCXXForRangeStmt(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildCXXNew(), clang::Sema::BuildDeclarationNameExpr(), buildImplicitMapper(), clang::SemaObjC::BuildInstanceMessage(), clang::SemaObjC::BuildIvarRefExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildMicrosoftCAnonymousStruct(), BuildNonArrayForRange(), clang::Sema::BuildResolvedCallExpr(), clang::CodeGen::CGCXXABI::buildThisParam(), clang::Sema::BuildUsingDeclaration(), clang::Sema::BuildUsingEnumDeclaration(), clang::Sema::BuildUsingShadowDecl(), clang::Sema::BuildVariableInstantiation(), clang::Sema::BuiltinEnumUnderlyingType(), clang::ento::ObjCMethodCall::canBeOverridenInSubclass(), clang::canVarDeclThrow(), captureInBlock(), captureInLambda(), checkAddressOfFunctionIsAvailable(), clang::SemaCUDA::checkAllowedInitializer(), CheckAnonMemberRedeclaration(), clang::SemaObjC::CheckARCMethodDecl(), checkARCPropertyImpl(), checkAtomicPropertyMismatch(), clang::threadSafety::BeforeSet::checkBeforeAfter(), CheckBindingsCount(), clang::interp::CheckCallable(), clang::Sema::CheckCallReturnType(), clang::Sema::CheckClassTemplate(), clang::SemaHLSL::CheckCompatibleParameterABI(), clang::Sema::CheckCompletedCoroutineBody(), clang::Sema::CheckCompletedCXXClass(), clang::Sema::CheckCompleteDecompositionDeclaration(), clang::Sema::CheckConceptRedefinition(), clang::Sema::CheckConceptTemplateId(), clang::Sema::CheckConditionVariable(), clang::SemaObjC::CheckConflictingOverridingMethod(), CheckConstexprCtorInitializer(), CheckConstexprDestructorSubobjects(), CheckConstexprFunction(), CheckConstexprFunctionBody(), clang::Sema::CheckConstexprFunctionDefinition(), CheckConstexprMissingReturn(), CheckConstexprParameterTypes(), CheckConstexprReturnType(), CheckConstPureAttributesUsage(), clang::Sema::CheckCoroutineWrapper(), clang::Sema::CheckCountedByAttrOnField(), checkCUDADeviceBuiltinSurfaceClassTemplate(), checkCUDADeviceBuiltinTextureClassTemplate(), clang::interp::CheckDecl(), CheckDeclarationCausesMultiVersioning(), checkDeclInTargetContext(), clang::SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(), CheckDeductionConsistency(), clang::Sema::CheckDeductionGuideTemplate(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), clang::Sema::CheckDestructor(), checkDLLAttributeRedeclaration(), clang::SemaHLSL::CheckEntryPoint(), clang::Sema::CheckEnumRedeclaration(), clang::Sema::CheckEquivalentExceptionSpec(), checkEscapingByref(), CheckEvaluationResult(), CheckExplicitInstantiationScope(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), clang::Sema::CheckExplicitObjectMemberFunction(), clang::Sema::CheckExplicitObjectOverride(), clang::sema::checkExprLifetimeImpl(), clang::Sema::CheckFieldDecl(), CheckFieldPadding(), clang::Sema::CheckForFunctionRedefinition(), checkForMultipleExportedDefaultConstructors(), CheckForReference(), clang::Sema::CheckFriendAccess(), clang::Sema::CheckFunctionConstraints(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::interp::CheckGlobalLoad(), checkGlobalOrExternCConflict(), clang::Sema::CheckIfOverriddenFunctionIsMarkedFinal(), clang::Sema::CheckImmediateEscalatingFunctionDefinition(), clang::SemaObjC::CheckImplementationIvars(), clang::Sema::checkIncorrectVTablePointerAuthenticationAttribute(), checkInheritableAttr(), clang::SemaObjC::checkInitMethod(), checkIsValidOpenCLKernelParameter(), clang::Sema::CheckLiteralOperatorDeclaration(), checkLiteralOperatorTemplateParameterList(), clang::interp::CheckLocalLoad(), CheckLocalVariableDeclaration(), clang::Sema::CheckMain(), checkMemberDecomposition(), clang::Sema::CheckMemberSpecialization(), checkMethodFamilyMismatch(), CheckMethodOverrideParam(), CheckMethodOverrideReturn(), clang::Sema::checkMSInheritanceAttrOnDefinition(), clang::Sema::CheckMSVCRTEntryPoint(), clang::ASTDeclReader::checkMultipleDefinitionInNamedModules(), CheckMultiVersionAdditionalDecl(), CheckMultiVersionAdditionalRules(), CheckMultiVersionFunction(), CheckMultiVersionValue(), checkNewAttributesAfterDef(), checkNonMultiVersionCompatAttributes(), clang::Sema::CheckNontrivialField(), clang::SemaObjC::CheckObjCCircularContainer(), clang::SemaObjC::CheckObjCDeclScope(), clang::SemaObjC::CheckObjCMethodDirectOverrides(), clang::SemaObjC::CheckObjCMethodOverride(), checkObjCUnusedIvar(), clang::SemaOpenMP::CheckOMPThreadPrivateDecl(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), clang::SemaOpenMP::CheckOpenMPLinearDecl(), CheckOperatorDeleteDeclaration(), CheckOperatorNewDeleteDeclarationScope(), CheckOperatorNewDeleteTypes(), clang::Sema::CheckOverloadedOperatorDeclaration(), clang::Sema::CheckOverrideControl(), clang::Sema::CheckOverridingFunctionAttributes(), clang::Sema::CheckOverridingFunctionExceptionSpec(), clang::Sema::CheckOverridingFunctionReturnType(), clang::Sema::CheckPlaceholderExpr(), CheckPoppedLabel(), checkPropertyDeclWithOwnership(), clang::Sema::CheckRedeclarationExported(), clang::Sema::CheckRedeclarationModuleOwnership(), clang::SemaObjC::checkRetainCycles(), clang::Sema::CheckShadow(), clang::Sema::CheckShadow(), clang::Sema::CheckShadowingDeclModification(), CheckSimplerImplicitMovesMSVCWorkaround(), clang::SemaARM::CheckSMEFunctionDefAttributes(), clang::Sema::CheckSpecializationInstantiationRedecl(), clang::Sema::CheckSwitchCondition(), clang::SemaSYCL::CheckSYCLEntryPointFunctionDecl(), clang::SemaCUDA::checkTargetOverload(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentPointerToMember(), clang::Sema::CheckTemplateParameterList(), CheckTemplateSpecializationScope(), clang::Sema::CheckThreadLocalForLargeAlignment(), CheckTrivialDefaultConstructor(), checkTrivialSubobjectCall(), checkTupleLikeDecomposition(), clang::Sema::checkTypeDeclType(), clang::Sema::CheckTypedefForVariablyModifiedType(), clang::Sema::CheckTypenameType(), checkTypeParamListConsistency(), checkUndefinedButUsed(), clang::Sema::CheckUsingDeclRedeclaration(), clang::Sema::CheckUsingShadowDecl(), checkUsingShadowRedecl(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::CheckVirtualDtorCall(), CollectFieldInitializer(), compare(), ComputeDefaultedComparisonExceptionSpec(), ComputeDefaultedSpecialMemberExceptionSpec(), clang::Sema::ConvertArgumentsForCall(), ConvertDeducedTemplateArguments(), clang::CodeGen::CodeGenFunction::createAtExitStub(), clang::Sema::CreateOverloadedBinOp(), clang::SemaOpenACC::CreatePrivateInitRecipe(), clang::SemaObjC::CreatePropertyDecl(), clang::CodeGen::CodeGenFunction::createTLSAtExitStub(), clang::Sema::DeclareImplicitCopyAssignment(), clang::Sema::DeclareImplicitCopyConstructor(), clang::Sema::DeclareImplicitDefaultConstructor(), clang::Sema::DeclareImplicitDestructor(), clang::Sema::DeclareImplicitMoveAssignment(), clang::Sema::DeclareImplicitMoveConstructor(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), clang::Sema::DeduceReturnType(), clang::Sema::deduceVarTypeFromInitializer(), clang::SemaObjC::DefaultSynthesizeProperties(), clang::Sema::DefineDefaultedComparison(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitLambdaToBlockPointerConversion(), clang::Sema::DefineImplicitLambdaToFunctionPointerConversion(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DefineInheritingConstructor(), clang::InitializationSequence::Diagnose(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), clang::Sema::DiagnoseAmbiguousLookup(), clang::Sema::DiagnoseAssignmentResult(), clang::Sema::DiagnoseAutoDeductionFailure(), DiagnoseBadDeduction(), diagnoseBadDirectAccess(), DiagnoseCalleeStaticArrayParam(), DiagnoseCategoryDirectMembersProtocolConformance(), clang::SemaObjC::DiagnoseClassExtensionDupMethods(), DiagnoseConstAssignment(), clang::SemaObjC::DiagnoseCStringFormatDirectiveInCFAPI(), diagnoseDeprecatedCopyOperation(), DiagnoseDirectIsaAccess(), clang::SemaObjC::DiagnoseDuplicateIvars(), clang::Sema::diagnoseEquivalentInternalLinkageDeclarations(), DiagnoseForRangeConstVariableCopies(), DiagnoseForRangeReferenceVariableCopies(), clang::Sema::DiagnoseHiddenVirtualMethods(), clang::Sema::DiagnoseImmediateEscalatingReason(), clang::Sema::DiagnoseInvalidExplicitObjectParameterInLambda(), DiagnoseInvalidRedeclaration(), DiagnoseIsFinalReason(), DiagnoseLocalRegisterBinding(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::ODRDiagsEmitter::diagnoseMismatch(), diagnoseMissingConstinit(), clang::SemaObjC::DiagnoseMissingDesignatedInitOverrides(), clang::Sema::diagnoseMissingImport(), diagnoseMissingInitializer(), DiagnoseNamespaceInlineMismatch(), diagnoseNoescape(), diagnoseNoescape(), DiagnoseNonAggregateReason(), DiagnoseNonAssignableReason(), DiagnoseNonConstructibleReason(), diagnoseNonConstVariable(), DiagnoseNonReplaceableReason(), DiagnoseNonStandardLayoutReason(), DiagnoseNonStandardLayoutReason(), clang::Sema::DiagnoseNontrivial(), DiagnoseNonTriviallyCopyableReason(), DiagnoseNonTriviallyRelocatableReason(), DiagnoseObjCImplementedDeprecations(), diagnoseOpenCLTypes(), clang::SemaObjC::DiagnoseOwningPropertyGetterSynthesis(), clang::SemaObjC::DiagnosePropertyAccessorMismatch(), clang::SemaObjC::DiagnosePropertyMismatch(), clang::Sema::DiagnoseSentinelCalls(), clang::Sema::DiagnoseShadowingLambdaDecls(), clang::Sema::DiagnoseSizeOfParametersAndReturnValue(), DiagnoseTypeAwareAllocators(), DiagnoseUnimplementedAccessor(), clang::interp::DiagnoseUninitializedSubobject(), DiagnoseUninitializedUse(), clang::Sema::DiagnoseUninstantiableTemplate(), clang::Sema::DiagnoseUniqueObjectDuplication(), diagnoseUnknownDecl(), clang::SemaObjC::DiagnoseUnusedBackingIvarInAccessor(), clang::Sema::DiagnoseUnusedButSetDecl(), clang::Sema::DiagnoseUnusedDecl(), clang::Sema::DiagnoseUseOfDecl(), diagnoseUseOfInternalDeclInInlineFunction(), DiagnoseVariableSizedIvars(), clang::Sema::DiagPlaceholderFieldDeclDefinitions(), clang::Sema::DiagRedefinedPlaceholderFieldDecl(), diagReturnOnAllocFailure(), DiagUninitUse(), DoEmitAvailabilityWarning(), clang::CIRGen::CIRGenFunction::emitAddrOfFieldStorage(), clang::CodeGen::CodeGenFunction::EmitAndRegisterVariableArrayDimensions(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), EmitDiagForCXXThrowInNonThrowingFunc(), clang::CodeGen::CodeGenModule::EmitExternalDeclaration(), clang::CodeGen::CGDebugInfo::EmitExternalVariable(), clang::CodeGen::CodeGenFunction::EmitFieldAnnotations(), clang::CodeGen::CGDebugInfo::EmitFuncDeclForCallSite(), clang::CodeGen::CGDebugInfo::EmitGlobalAlias(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), emitInitWithReductionInitializer(), clang::CodeGen::CGDebugInfo::EmitLabel(), clang::CodeGen::CodeGenFunction::EmitLabel(), clang::CIRGen::CIRGenFunction::emitLValueForBitField(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), emitMappingInformation(), clang::CodeGen::CGDebugInfo::EmitNamespaceAlias(), emitOutlinedFunctionPrologue(), emitPreserveStructAccess(), emitReadOnlyPlacementAttrWarning(), clang::SemaObjC::EmitRelatedResultTypeNoteForReturn(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), clang::CodeGen::CGDebugInfo::EmitUsingDirective(), clang::CodeGen::CGDebugInfo::EmitUsingShadowDecl(), clang::CodeGen::CodeGenFunction::EmitVarAnnotations(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::CodeGen::CGCXXABI::ErrorUnsupportedABI(), clang::Expr::EvaluateAsInitializer(), clang::VarDecl::evaluateDestruction(), clang::Sema::FinalizeDeclaration(), clang::Sema::FinalizeDeclaratorGroup(), clang::Sema::FinalizeVarWithDestructor(), FindBaseInitializer(), findCompleteObject(), clang::Sema::findInheritingConstructor(), clang::Sema::FindInstantiatedDecl(), clang::SemaObjC::FindProtocolDeclaration(), findSubobject(), FinishTemplateArgumentDeduction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::AccessSpecDecl::getAccessSpecifierLoc(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CIRGen::CIRGenFunction::getAddrOfBitFieldStorage(), clang::NamespaceAliasDecl::getAliasLoc(), clang::FileScopeAsmDecl::getAsmLoc(), clang::ASTContext::getASTRecordLayout(), clang::ObjCMethodDecl::getBeginLoc(), clang::BlockDecl::getCaretLocation(), getDeclLocsForCommentSearch(), GetDeclSpecTypeForDeclarator(), clang::Sema::getDestructorName(), GetEndLoc(), clang::ExportDecl::getEndLoc(), clang::LinkageSpecDecl::getEndLoc(), clang::ObjCInterfaceDecl::getEndOfDefinitionLoc(), clang::ExportDecl::getExportLoc(), GetFullTypeForDeclarator(), clang::UsingDirectiveDecl::getIdentLocation(), getInitializationLoc(), NonTypeOrVarTemplateParmDecl::getLocation(), GetLocationForCandidate(), GetLocationForCandidate(), clang::FunctionDecl::getNameInfo(), clang::UnresolvedUsingTypenameDecl::getNameInfo(), clang::UnresolvedUsingValueDecl::getNameInfo(), clang::UsingDecl::getNameInfo(), clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal(), clang::CIRGen::CIRGenModule::getOrCreateStaticVarDecl(), getPointee2TypeText(), clang::getPointeeTypeText(), getPosAsWritten(), getQualifiedNameStart(), clang::CXXCtorInitializer::getSourceLocation(), clang::ASTReader::getSourceLocationForDeclID(), clang::BlockDecl::getSourceRange(), getSourceRange(), clang::DeclaratorDecl::getSourceRange(), clang::EnumConstantDecl::getSourceRange(), clang::ExportDecl::getSourceRange(), clang::FriendDecl::getSourceRange(), clang::ImportDecl::getSourceRange(), clang::LabelDecl::getSourceRange(), clang::ObjCInterfaceDecl::getSourceRange(), clang::ObjCMethodDecl::getSourceRange(), clang::ObjCPropertyDecl::getSourceRange(), clang::ObjCPropertyImplDecl::getSourceRange(), clang::ObjCProtocolDecl::getSourceRange(), clang::ObjCTypeParamDecl::getSourceRange(), clang::OpenACCConstructDecl::getSourceRange(), clang::ParmVarDecl::getSourceRange(), clang::StaticAssertDecl::getSourceRange(), clang::TagDecl::getSourceRange(), clang::TemplateTemplateParmDecl::getSourceRange(), clang::TopLevelStmtDecl::getSourceRange(), clang::TypeDecl::getSourceRange(), clang::TypedefDecl::getSourceRange(), clang::UsingDirectiveDecl::getSourceRange(), clang::VarDecl::getSourceRange(), clang::Sema::getTopMostPointOfInstantiation(), getTupleLikeElementType(), clang::Sema::getTypeName(), clang::getVarDeclIdentifierLoc(), clang::ento::MemRegionManager::getVarRegion(), clang::Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(), clang::SemaSwift::handleAsyncAttr(), handleCleanupAttr(), handleConstructorAttr(), clang::index::IndexingContext::handleDecl(), clang::SemaObjC::handleDesignatedInitializer(), handleDestroyAttr(), handleDestructorAttr(), clang::SemaObjC::HandleExprPropertyRefExpr(), handleFormatAttr(), HandleImmediateInvocations(), clang::SemaObjC::handleIndependentClass(), clang::SemaHLSL::handleInitialization(), clang::SemaARM::handleInterruptAttr(), clang::SemaAVR::handleInterruptAttr(), clang::SemaMIPS::handleInterruptAttr(), clang::SemaMSP430::handleInterruptAttr(), clang::SemaRISCV::handleInterruptAttr(), clang::SemaARM::handleInterruptSaveFPAttr(), clang::SemaSYCL::handleKernelAttr(), handleNoBuiltinAttr(), handleNoSanitizeAttr(), handleNoSanitizeSpecificAttr(), clang::SemaObjC::handleNSObject(), clang::SemaObjC::HandlePropertyInClassExtension(), clang::SemaAVR::handleSignalAttr(), handleTargetClonesAttr(), handleTransparentUnionAttr(), clang::SemaWasm::handleWebAssemblyExportNameAttr(), HelperToDiagnoseMismatchedMethodsInGlobalPool(), clang::Sema::ImplicitlyDefineFunction(), clang::ASTNodeImporter::ImportDeclParts(), clang::ASTNodeImporter::ImportDeclParts(), clang::ASTNodeImporter::ImportDefinition(), clang::index::IndexingContext::importedModule(), clang::index::IndexingContext::indexTopLevelDecl(), clang::Sema::inferLifetimeBoundAttribute(), clang::inferNoReturnAttr(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), clang::InitializationSequence::InitializeFrom(), initVarDeclWithCtor(), InjectAnonymousStructOrUnionMembers(), clang::Sema::InstantiateClass(), clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::Sema::InstantiateFunctionDefinition(), clang::TemplateDeclInstantiator::InstantiateTypeAliasTemplateDecl(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::Sema::InstantiateVariableDefinition(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), clang::interp::EvalEmitter::interpretDecl(), clang::Sema::InvalidOperands(), clang::Sema::isAcceptableTagRedeclaration(), isForbiddenTypeAllowed(), isFromSystemHeader(), clang::LabelDecl::isGnuLocal(), clang::Sema::isIncompatibleTypedef(), clang::ento::CallEvent::isInSystemHeader(), clang::extractapi::impl::ExtractAPIVisitorBase< std::conditional_t< std::is_same_v< Derived, void >, ExtractAPIVisitor<>, Derived > >::isInSystemHeader(), clang::ObjCPropertyImplDecl::isIvarNameSpecified(), clang::Expr::isPotentialConstantExpr(), isStandardDelete(), isStandardNew(), IsStructurallyEquivalent(), IsStructurallyEquivalent(), IsStructurallyEquivalent(), IsStructurallyEquivalent(), IsStructurallyEquivalent(), IsStructurallyEquivalent(), IsStructurallyEquivalent(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), isVariableCapturable(), clang::CIRGen::CIRGenCXXABI::loadIncomingCXXThis(), lookupPromiseType(), clang::Sema::LookupSpecialMember(), LookupSpecialMemberFromXValue(), clang::Sema::LookupTemplateName(), MarkVarDeclODRUsed(), clang::Sema::MarkVirtualBaseDestructorsReferenced(), MatchTemplateParameterKind(), clang::Sema::maybeAddDeclWithEffects(), clang::SemaCUDA::maybeAddHostDeviceAttrs(), clang::RecordDecl::mayInsertExtraPadding(), clang::Sema::MergeCXXFunctionDecl(), clang::Sema::mergeDeclAttributes(), clang::Sema::MergeFunctionDecl(), mergeInterfaceMethodToImpl(), mergeParamDeclAttributes(), mergeParamDeclTypes(), clang::Sema::MergeTypedefNameDecl(), clang::Sema::MergeVarDecl(), clang::Sema::MergeVarDeclExceptionSpecs(), clang::Sema::NoteDeletedFunction(), clang::Sema::NoteDeletedInheritingConstructor(), clang::Sema::NoteHiddenVirtualMethods(), noteLocation(), NoteLValueLocation(), clang::Sema::notePreviousDefinition(), NoteSurrogateCandidate(), clang::Sema::NoteTemplateLocation(), clang::SemaObjC::ParseObjCProtocolExpression(), clang::SemaObjC::ParseObjCSelectorExpression(), clang::Sema::ParseTypedefDecl(), PerformConstructorInitialization(), clang::SemaOpenMP::PerformOpenMPImplicitIntegerConversion(), clang::CodeGen::CodeGenModule::printPostfixForExternalizedDecl(), clang::Sema::ProcessAPINotes(), ProcessAPINotes(), ProcessAPINotes(), ProcessDeclAttribute(), clang::Sema::ProcessDeclAttributeList(), clang::SemaObjC::ProcessPropertyDecl(), clang::Sema::propagateDLLAttrToBaseClassTemplate(), clang::TreeTransform< AdjustConstraintDepth >::RebuildDependentNameType(), clang::TreeTransform< AdjustConstraintDepth >::RebuildObjCExceptionDecl(), clang::Sema::RebuildTemplateParamsInCurrentInstantiation(), rejectConstNotMutableType(), clang::CodeGen::SanitizerMetadata::reportGlobal(), reportOriginalDsa(), ReportOverrides(), clang::Sema::RequireCompleteEnumDecl(), clang::Sema::RequireLiteralType(), resolveBuiltinNewDeleteOverload(), rewriteBuiltinFunctionDecl(), clang::consumed::ConsumedAnalyzer::run(), selectBestPath(), clang::CodeGen::CodeGenFunction::setBlockContextParameter(), clang::CodeGen::CodeGenModule::setGlobalVisibility(), clang::SemaObjC::SetIvarInitializers(), clang::Sema::SetMemberAccessSpecifier(), clang::Sema::setTagNameForLinkagePurposes(), clang::Sema::ShouldDeleteSpecialMember(), shouldIgnoreDueToReservedName(), clang::Sema::SpecialMemberIsTrivial(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), clang::CodeGen::CodeGenFunction::StartThunk(), clang::Sema::SubstDecl(), clang::TemplateDeclInstantiator::SubstDefaultedFunction(), clang::TemplateDeclInstantiator::SubstFunctionType(), clang::Sema::SubstParmVarDecl(), SuggestInitializationFixit(), clang::TreeTransform< Derived >::TransformCondition(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), clang::TreeTransform< Derived >::TransformOverloadExprDecls(), clang::CodeGen::CGOpenMPRuntimeGPU::translateParameter(), clang::Sema::tryCaptureVariable(), TryDiagnoseProtectedAccess(), TryOrBuildParenListInitialization(), clang::Sema::UnifySection(), UnwindTagContext(), validateDeclsInsideHLSLBuffer(), ValidateMultipleRegisterAnnotations(), ValidateObjCLiteralInterfaceDecl(), validatePackoffset(), clang::Sema::VerifyIntegerConstantExpression(), clang::JSONNodeDumper::Visit(), clang::TextNodeDumper::Visit(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitClassTemplatePartialSpecializationDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitClassTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitConceptDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitConceptDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXConstructorDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXConversionDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXDestructorDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXMethodDecl(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXRecordDecl(), clang::ASTNodeImporter::VisitDecl(), clang::ASTNodeImporter::VisitEmptyDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitEnumDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitFieldDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTDeclReader::VisitFunctionDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitFunctionDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitFunctionTemplateDecl(), clang::ASTNodeImporter::VisitImplicitConceptSpecializationDecl(), clang::ASTNodeImporter::VisitImplicitParamDecl(), clang::ASTNodeImporter::VisitImportDecl(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), clang::tooling::RecursiveSymbolVisitor< T >::VisitNamedDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitNonTypeTemplateParmDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitObjCCategoryDecl(), clang::ASTNodeImporter::VisitObjCCategoryImplDecl(), clang::ASTNodeImporter::VisitObjCImplementationDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitObjCInterfaceDecl(), clang::ASTDeclReader::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitObjCProtocolDecl(), clang::ASTNodeImporter::VisitObjCTypeParamDecl(), clang::ASTNodeImporter::VisitParmVarDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitRecordDecl(), clang::ASTNodeImporter::VisitRequiresExprBodyDecl(), clang::ASTNodeImporter::VisitStaticAssertDecl(), clang::ASTNodeImporter::VisitTemplateTemplateParmDecl(), clang::ASTNodeImporter::VisitTemplateTypeParmDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitUsingEnumDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarTemplateDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarTemplatePartialSpecializationDecl(), clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarTemplateSpecializationDecl(), clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl(), clang::SemaObjC::WarnConflictingTypedMethods(), clang::SemaObjC::WarnExactTypedMethods(), clang::Sema::warnOnCTypeHiddenInCPlusPlus(), clang::Sema::WarnOnPendingNoDerefs(), and clang::Sema::warnOnReservedIdentifier().
unsigned Decl::getMaxAlignment | ( | ) | const |
getMaxAlignment - return the maximum alignment specified by attributes on this decl, 0 if there are none.
Definition at line 538 of file DeclBase.cpp.
References getASTContext(), getAttrs(), hasAttrs(), and V.
Referenced by clang::ASTContext::getDeclAlign(), getDeclAlignIfRequired(), isLayoutCompatible(), and clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition().
|
inline |
Get the kind of module ownership for this declaration.
Definition at line 876 of file DeclBase.h.
References NextInContextAndBits.
Referenced by hasOwningModule(), isExportedFromModuleInterfaceUnit(), isInvisibleOutsideTheOwningModule(), isModuleLocal(), isModulePrivate(), isReachable(), isUnconditionallyVisible(), clang::StoredDeclsList::replaceExternalDecls(), setLexicalDeclContext(), setModuleOwnershipKind(), setModulePrivate(), and clang::ASTDeclWriter::VisitDecl().
|
inline |
Retrieve the most recent declaration that declares the same entity as this declaration (which may be this declaration).
Definition at line 1076 of file DeclBase.h.
References Decl(), and getMostRecentDeclImpl().
Referenced by clang::ASTDeclWriter::CollectFirstDeclFromEachModule(), forAllLaterRedecls(), isUsed(), isWeakImported(), clang::Sema::mergeDeclAttributes(), and clang::ASTDeclWriter::VisitRedeclarable().
|
inline |
Retrieve the most recent declaration that declares the same entity as this declaration (which may be this declaration).
Definition at line 1080 of file DeclBase.h.
References Decl(), and getMostRecentDeclImpl().
|
inlineprotectedvirtual |
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chain.
Reimplemented in clang::FunctionDecl, clang::TagDecl, clang::TypedefNameDecl, and clang::VarDecl.
Definition at line 999 of file DeclBase.h.
References Decl().
Referenced by getMostRecentDecl(), and getMostRecentDecl().
|
inline |
Definition at line 445 of file DeclBase.h.
References Decl(), and NextInContextAndBits.
Referenced by clang::DeclContext::addHiddenDecl(), and clang::DeclContext::decl_iterator::operator++().
|
inline |
Definition at line 446 of file DeclBase.h.
References Decl(), and NextInContextAndBits.
|
inlineprotectedvirtual |
Returns the next redeclaration or itself if this is the only decl.
Decl subclasses that can be redeclared should override this method so that Decl::redecl_iterator can iterate over them.
Reimplemented in clang::FunctionDecl, clang::TagDecl, clang::TypedefNameDecl, and clang::VarDecl.
Definition at line 991 of file DeclBase.h.
References Decl().
Decl * Decl::getNonClosureContext | ( | ) |
Find the innermost non-closure ancestor of this declaration, walking up through blocks, lambdas, etc.
If that ancestor is not a code context (!isFunctionOrMethod()), returns null.
A declaration may be its own non-closure context.
Definition at line 1267 of file DeclBase.cpp.
References Decl().
Referenced by getNonClosureContext(), clang::CIRGen::CIRGenModule::getOrCreateStaticVarDecl(), clang::CodeGen::CodeGenModule::getOrCreateStaticVarDecl(), clang::CodeGen::CodeGenFunction::StartFunction(), and clang::CIRGen::CIRGenFunction::startFunction().
|
inline |
Definition at line 471 of file DeclBase.h.
References Decl(), and getNonClosureContext().
DeclContext * Decl::getNonTransparentDeclContext | ( | ) |
Return the non transparent context.
See the comment of DeclContext::isTransparentContext() for the definition of transparent context.
Definition at line 1239 of file DeclBase.cpp.
References DeclContext, getDeclContext(), and clang::DeclContext::getNonTransparentContext().
Referenced by clang::Sema::FindInstantiatedDecl(), getNonTransparentDeclContext(), and isStdClassTemplate().
|
inline |
Definition at line 461 of file DeclBase.h.
References Decl(), DeclContext, and getNonTransparentDeclContext().
|
inline |
Get the module that owns this declaration (for visibility purposes).
Definition at line 842 of file DeclBase.h.
References getImportedOwningModule(), getLocalOwningModule(), and isFromASTFile().
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnTag(), clang::Sema::ArgumentDependentLookup(), clang::ASTDeclReader::checkMultipleDefinitionInNamedModules(), clang::Sema::CheckRedeclarationModuleOwnership(), clang::Sema::CheckTemplateParameterList(), CollectEnclosingNamespace(), clang::Sema::getCurrentMangleNumberContext(), clang::ASTWriter::GetDeclRef(), getLambdaCallOperatorHelper(), clang::Sema::getOwningModule(), getOwningModuleForLinkage(), getTopLevelOwningNamedModule(), isFromExplicitGlobalModule(), isFromGlobalModule(), isFromHeaderUnit(), isInAnotherModuleUnit(), isInCurrentModuleUnit(), isInNamedModule(), isModuleLocal(), clang::Sema::IsRedefinitionInModule(), clang::ASTContext::isSameEntity(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), clang::Sema::notePreviousDefinition(), setLexicalDeclContext(), shouldFunctionGenerateHereOnly(), shouldVarGenerateHereOnly(), CallableVisitor::TraverseDecl(), clang::TextNodeDumper::Visit(), clang::ASTDeclWriter::VisitDecl(), and clang::ASTWriter::wasDeclEmitted().
Module * Decl::getOwningModuleForLinkage | ( | ) | const |
Get the module that owns this declaration for linkage purposes.
There only ever is such a standard C++ module.
Definition at line 1636 of file Decl.cpp.
References clang::Module::ExplicitGlobalModuleFragment, getOwningModule(), clang::Module::ImplicitGlobalModuleFragment, clang::isa(), clang::Module::Kind, clang::Module::ModuleHeaderUnit, clang::Module::ModuleImplementationUnit, clang::Module::ModuleInterfaceUnit, clang::Module::ModuleMapModule, clang::Module::ModulePartitionImplementation, clang::Module::ModulePartitionInterface, clang::Module::Parent, and clang::Module::PrivateModuleFragment.
Referenced by clang::Sema::CheckRedeclarationModuleOwnership(), clang::NamedDecl::isExternallyDeclarable(), and clang::MangleContext::shouldMangleDeclName().
unsigned Decl::getOwningModuleID | ( | ) | const |
Retrieve the global ID of the module that owns this particular declaration.
Definition at line 115 of file DeclBase.cpp.
References isFromASTFile().
|
inline |
Definition at line 971 of file DeclBase.h.
References Decl(), and DeclContext.
const DeclContext * Decl::getParentFunctionOrMethod | ( | bool | LexicalParent = false | ) | const |
If this decl is defined inside a function/method/block it returns the corresponding DeclContext, otherwise it returns null.
Definition at line 319 of file DeclBase.cpp.
References DeclContext, getDeclContext(), getLexicalDeclContext(), and clang::DeclContext::isFileContext().
Referenced by basicGVALinkageForVariable(), clang::Sema::CheckStaticLocalForDllExport(), clang::CodeGen::CodeGenModule::createUnnamedGlobalFrom(), clang::Sema::FinalizeDeclaration(), isDefinedOutsideFunctionOrMethod(), and clang::index::isFunctionLocalSymbol().
|
inline |
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
Definition at line 1061 of file DeclBase.h.
References Decl(), and getPreviousDeclImpl().
Referenced by clang::Sema::ArgumentDependentLookup(), clang::Sema::checkClassLevelDLLAttribute(), clang::Sema::CheckSpecializationInstantiationRedecl(), clang::ASTDeclWriter::CollectFirstDeclFromEachModule(), diagnoseBadDirectAccess(), DoEmitAvailabilityWarning(), clang::ASTDumper::dumpLookups(), forAllLaterRedecls(), clang::VarDecl::getActingDefinition(), getDeclForLocalLookup(), clang::ASTWriter::getFirstLocalDecl(), clang::interp::Program::getGlobal(), clang::LocalInstantiationScope::getInstantiationOfIfExists(), clang::Sema::GetTemplateParameterList(), clang::Sema::InstantiateFunctionDefinition(), isFirstDecl(), isPreferredLookupResult(), clang::Sema::MergeVarDecl(), PreviousDeclsHaveMultiVersionAttribute(), setLocalExternDecl(), setObjectOfFriendDecl(), clang::ASTDeclWriter::VisitRedeclarable(), and clang::Sema::warnOnReservedIdentifier().
|
inline |
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
Definition at line 1065 of file DeclBase.h.
References Decl(), and getPreviousDeclImpl().
|
inlineprotectedvirtual |
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
Reimplemented in clang::FunctionDecl, clang::TagDecl, clang::TypedefNameDecl, and clang::VarDecl.
Definition at line 995 of file DeclBase.h.
References Decl().
Referenced by getPreviousDecl(), and getPreviousDecl().
|
inlinevirtual |
Source range that this declaration covers.
Reimplemented in clang::AccessSpecDecl, clang::BlockDecl, clang::BuiltinTemplateDecl, clang::ClassTemplatePartialSpecializationDecl, clang::ClassTemplateSpecializationDecl, clang::ConceptDecl, clang::DeclaratorDecl, clang::EnumConstantDecl, clang::EnumDecl, clang::ExportDecl, clang::FieldDecl, clang::FileScopeAsmDecl, clang::FriendDecl, clang::FunctionDecl, clang::HLSLBufferDecl, clang::ImportDecl, clang::LabelDecl, clang::LinkageSpecDecl, clang::NamespaceAliasDecl, clang::NamespaceDecl, clang::NonTypeTemplateParmDecl, clang::ObjCContainerDecl, clang::ObjCInterfaceDecl, clang::ObjCMethodDecl, clang::ObjCPropertyDecl, clang::ObjCPropertyImplDecl, clang::ObjCProtocolDecl, clang::ObjCTypeParamDecl, clang::OMPCapturedExprDecl, clang::OpenACCConstructDecl, clang::ParmVarDecl, clang::StaticAssertDecl, clang::TagDecl, clang::TemplateDecl, clang::TemplateTemplateParmDecl, clang::TemplateTypeParmDecl, clang::TopLevelStmtDecl, clang::TypeAliasDecl, clang::TypeDecl, clang::TypedefDecl, clang::UnresolvedUsingValueDecl, clang::UsingDecl, clang::UsingDirectiveDecl, clang::UsingEnumDecl, clang::UsingPackDecl, clang::VarDecl, clang::VarTemplatePartialSpecializationDecl, clang::VarTemplateSpecializationDecl, and FieldDecl.
Definition at line 427 of file DeclBase.h.
References getLocation().
Referenced by clang::Sema::AddAlignValueAttr(), clang::SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(), clang::Sema::CheckTemplateDeclScope(), clang::Sema::DiagnoseMisalignedMembers(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::ODRDiagsEmitter::diagnoseMismatch(), diagnoseMissingInitializer(), DiagnoseNonDefaultMovable(), DiagnoseNonReplaceableReason(), diagnoseUnknownDecl(), clang::CIRGen::CIRGenModule::emitAliasForGlobal(), clang::CIRGen::CIRGenFunction::emitCXXDestructorCall(), clang::CIRGen::CIRGenFunction::emitDecl(), clang::CIRGen::CIRGenFunction::emitExprAsInit(), clang::SemaOpenMP::EndOpenMPDSABlock(), clang::tooling::getAssociatedRange(), getBeginLoc(), getEndLoc(), getMangledNameImpl(), clang::CIRGen::CIRGenModule::getOrCreateCIRFunction(), clang::SemaOpenCL::handleAccessAttr(), handleConstructorAttr(), handleDestructorAttr(), clang::JSONNodeDumper::Visit(), clang::TextNodeDumper::Visit(), and warnAboutAmbiguousFunction().
unsigned Decl::getTemplateDepth | ( | ) | const |
Determine the number of levels of template parameter surrounding this declaration.
Definition at line 298 of file DeclBase.cpp.
References clang::cast(), Decl(), DeclContext, getDeclContext(), getDescribedTemplateParams(), getFriendObjectKind(), and getLexicalDeclContext().
Referenced by clang::TemplateDeclInstantiator::InstantiateTypeAliasTemplateDecl(), and clang::Sema::SubstSpaceshipAsEqualEqual().
Module * Decl::getTopLevelOwningNamedModule | ( | ) | const |
Get the top level owning named module that owns this declaration if any.
Definition at line 130 of file DeclBase.cpp.
References getOwningModule(), and clang::Module::getTopLevelModule().
TranslationUnitDecl * Decl::getTranslationUnitDecl | ( | ) |
Definition at line 509 of file DeclBase.cpp.
References clang::cast(), DeclContext, getDeclContext(), clang::DeclContext::getParent(), and clang::DeclContext::isTranslationUnit().
Referenced by clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), getASTContext(), clang::ASTImporter::GetFromTU(), getTranslationUnitDecl(), clang::ASTNodeImporter::hasSameVisibilityContextAndLinkage(), isAncestorDeclContextOf(), clang::ento::BugSuppression::isSuppressed(), LookupObjCInterfaceDeclForLiteral(), clang::ASTNodeImporter::VisitNonTypeTemplateParmDecl(), clang::ASTNodeImporter::VisitTemplateTemplateParmDecl(), clang::ASTNodeImporter::VisitTemplateTypeParmDecl(), and clang::ASTNodeImporter::VisitTranslationUnitDecl().
|
inline |
Definition at line 476 of file DeclBase.h.
References Decl(), and getTranslationUnitDecl().
VersionTuple Decl::getVersionIntroduced | ( | ) | const |
Retrieve the version of the target platform in which this declaration was introduced.
Definition at line 805 of file DeclBase.cpp.
References attrs(), getASTContext(), and getRealizedPlatform().
Referenced by DoEmitAvailabilityWarning().
Definition at line 577 of file DeclBase.h.
References getAttrs(), hasAttrs(), and clang::hasSpecificAttr().
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFields(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFinishNamespaceDef(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnLambdaExpr(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPAllocateDirective(), clang::SemaOpenMP::ActOnOpenMPCall(), clang::SemaOpenMP::ActOnOpenMPDeclareTargetName(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::Sema::ActOnPragmaWeakAlias(), clang::SemaObjC::ActOnStartCategoryImplementation(), clang::SemaObjC::ActOnStartClassImplementation(), clang::Sema::ActOnStartOfFunctionDef(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), clang::Sema::ActOnUninitializedDecl(), clang::Sema::ActOnVariableDeclarator(), clang::SemaHLSL::ActOnVariableDeclarator(), clang::SemaObjC::AddCFAuditedAttribute(), clang::CodeGen::CodeGenModule::AddGlobalAnnotations(), clang::Sema::AddInitializerToDecl(), clang::Sema::AddKnownFunctionAttributes(), clang::Sema::AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(), clang::Sema::AddOptnoneAttributeIfNoConflicts(), clang::Sema::AddSectionMSAllocText(), addX86InterruptAttrs(), adjustGVALinkageForAttributes(), AllowOverloadingOfFunction(), clang::CodeGen::CodeGenModule::AlwaysHasLTOVisibilityPublic(), annotateConsumedSummaryMismatch(), clang::Sema::applyFunctionAttributesBeforeParsingBody(), applyOMPAllocateAttribute(), clang::SemaObjC::AreMultipleMethodsInGlobalPool(), clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature(), assignInheritanceModel(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), basicGVALinkageForFunction(), clang::SemaObjC::BuildInstanceMessage(), clang::Sema::BuildResolvedCallExpr(), clang::Sema::BuildReturnStmt(), clang::Sema::canCalleeThrow(), canRedefineFunction(), captureInBlock(), clang::CFGCleanupFunction::CFGCleanupFunction(), clang::SemaCUDA::checkAllowedInitializer(), clang::SemaObjC::CheckARCMethodDecl(), clang::Sema::CheckAssignmentOperands(), clang::Sema::checkCall(), clang::Sema::CheckCompletedCoroutineBody(), CheckConstPureAttributesUsage(), clang::Sema::CheckCoroutineWrapper(), clang::Sema::CheckCXX2CRelocatableAndReplaceable(), clang::SemaHLSL::CheckEntryPoint(), checkForIBOutlets(), clang::Sema::CheckFunctionDeclaration(), clang::SemaCUDA::CheckLambdaCapture(), clang::Sema::CheckMain(), clang::SemaObjC::CheckMessageArgumentTypes(), CheckMoveOnConstruction(), CheckMultiVersionAdditionalDecl(), CheckNonNullArguments(), clang::Sema::CheckNontrivialField(), clang::SemaObjC::CheckObjCMethodOverride(), clang::SemaObjC::CheckObjCPropertyAttributes(), clang::SemaOpenMP::CheckOMPThreadPrivateDecl(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), clang::Sema::CheckOverrideControl(), checkPreviousOMPAllocateAttribute(), CheckProtocolMethodDefs(), checkRecordDeclForAttr(), clang::SemaARM::CheckSMEFunctionDefAttributes(), clang::Sema::CheckStaticLocalForDllExport(), CheckStringInit(), clang::CodeGen::CodeGenFunction::checkTargetFeatures(), clang::Sema::CheckTCBEnforcement(), clang::Sema::CheckTransparentUnionArgumentConstraints(), checkTypedefTypeForCapability(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::CheckVirtualDtorCall(), classifyCapability(), clang::interp::collectNonNullArgs(), compareEnableIfAttrs(), clang::interp::ByteCodeEmitter::compileFunc(), computeKeyFunction(), clang::LinkageComputer::computeLVForDecl(), clang::CIRGen::CIRGenTypes::computeRecordLayout(), configureBlocksRuntimeObject(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), clang::CIRGen::CIRGenModule::constructAttributeList(), clang::SemaObjC::CreatePropertyDecl(), CXXRecordNonInlineHasAttr(), clang::Sema::DeclareImplicitCopyConstructor(), clang::Sema::DeclareImplicitDestructor(), clang::Sema::DeclareImplicitMoveConstructor(), GlobalDeclRefChecker::declareTargetInitializer(), clang::DeclAttrsMatchCUDAMode(), clang::ASTContext::DeclMustBeEmitted(), clang::SemaHLSL::deduceAddressSpace(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), clang::Sema::DefaultVariadicArgumentPromotion(), clang::CodeGen::CGObjCRuntime::destroyCalleeDestroyedArguments(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), DiagnoseLocalRegisterBinding(), diagnoseNoescape(), DiagnoseNonReplaceableReason(), DiagnoseNonTriviallyRelocatableReason(), clang::SemaObjC::DiagnoseOwningPropertyGetterSynthesis(), DiagnoseUninitializedUse(), clang::Sema::DiagnoseUnusedButSetDecl(), DiagnoseUnusedOfDecl(), clang::Sema::DiagnoseUseOfDecl(), diagnoseUseOfInternalDeclInInlineFunction(), clang::FunctionDecl::doesDeclarationForceExternallyVisibleDefinition(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CIRGen::CIRGenFunction::emitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CIRGen::CIRGenFunction::emitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), emitCheckHandlerCall(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::CodeGen::CodeGenFunction::EmitDelegateCallArg(), EmitDirectCallee(), clang::CodeGen::CGDebugInfo::EmitExternalVariable(), clang::CodeGen::CodeGenFunction::EmitFieldAnnotations(), clang::CodeGen::CGDebugInfo::EmitFuncDeclForCallSite(), clang::CodeGen::CGDebugInfo::emitFunctionStart(), clang::CodeGen::CodeGenModule::EmitGlobal(), clang::CodeGen::CGDebugInfo::EmitGlobalAlias(), EmitGlobalVarDeclLValue(), clang::CIRGen::CIRGenModule::emitGlobalVarDefinition(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), clang::CodeGen::CGDebugInfo::EmitLabel(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CIRGen::CIRGenFunction::emitLValueForField(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), clang::CodeGen::CodeGenFunction::EmitOMPFirstprivateClause(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::CodeGen::CodeGenFunction::EmitVarAnnotations(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), EvaluateUnaryTypeTrait(), clang::Sema::FinalizeDeclaration(), clang::Sema::FinalizeVarWithDestructor(), findProtocolsWithExplicitImpls(), clang::Sema::GatherArgumentsForCall(), GeneralizeTransparentUnion(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::getArmStreamingFnType(), clang::ASTContext::getBlockVarCopyInit(), clang::FunctionDecl::getBuiltinID(), clang::CodeGen::CodeGenModule::getBuiltinLibFunction(), getCallingConventionForDecl(), clang::CIRGen::CIRGenModule::getCIRLinkageForDeclarator(), getDeclAlignIfRequired(), clang::GlobalDecl::getDefaultKernelReference(), clang::CXXMethodDecl::getDevirtualizedMethod(), clang::getDLLAttr(), clang::Sema::getEmissionStatus(), clang::ento::retaincountchecker::RefLeakReportVisitor::getEndPath(), clang::CodeGen::CodeGenModule::GetGlobalVarAddressSpace(), clang::Sema::getImplicitCodeSegOrSectionAttrForFunction(), clang::CodeGen::CodeGenModule::getLLVMLinkageForDeclarator(), clang::LinkageComputer::getLVForDecl(), clang::FunctionDecl::getMultiVersionKind(), clang::Sema::getNamedReturnInfo(), clang::CIRGen::CIRGenModule::getOrCreateCIRFunction(), clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal(), clang::CIRGen::CIRGenModule::getOrCreateStaticVarDecl(), clang::CodeGen::CodeGenModule::getOrCreateStaticVarDecl(), clang::CIRGen::CIRGenFunction::getOverlapForFieldInit(), clang::CodeGen::CodeGenFunction::getOverlapForFieldInit(), clang::CodeGen::CodeGenModule::getRawFunctionPointer(), clang::ObjCMethodDecl::getSelfType(), clang::index::getSymbolInfo(), clang::VarDecl::getTLSKind(), getTypeAlignIfRequired(), getTypeInfoLinkage(), clang::Sema::getUndefinedButUsed(), clang::CIRGen::CIRGenModule::getVTableLinkage(), clang::CodeGen::CodeGenModule::getVTableLinkage(), clang::Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(), clang::SemaOpenCL::handleAccessAttr(), handleCallbackAttr(), handleCallConvAttr(), clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation(), clang::CIRGen::CIRGenModule::handleCXXStaticMemberVarInstantiation(), handleDelayedForbiddenType(), clang::SemaARM::handleInterruptAttr(), clang::SemaARM::handleInterruptSaveFPAttr(), handleLifetimeCaptureByAttr(), handleManagedAttr(), handleNoBuiltinAttr(), handleNoRandomizeLayoutAttr(), handlePassObjectSizeAttr(), handleRandomizeLayoutAttr(), handleReentrantCapabilityAttr(), clang::CodeGen::CGOpenMPRuntime::hasAllocateAttributeForGlobalVar(), clang::CodeGen::CGOpenMPRuntimeGPU::hasAllocateAttributeForGlobalVar(), clang::hasArmZAState(), clang::hasArmZT0State(), hasBPFPreserveStaticOffset(), hasDefiningAttr(), hasDirectVisibilityAttribute(), clang::interp::Function::hasNonNullAttr(), clang::installapi::hasObjCExceptionAttribute(), hasObjCExceptionAttribute(), hasSameCudaAttrs(), clang::Expr::HasSideEffects(), clang::SemaCUDA::IdentifyTarget(), clang::SemaCUDA::IdentifyTarget(), clang::Sema::inferLifetimeBoundAttribute(), clang::inferNoReturnAttr(), clang::Sema::inferNullableClassAttribute(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), clang::InitializedEntity::InitializeParameter(), clang::Sema::InstantiateClassMembers(), clang::Sema::InstantiateVariableInitializer(), isAllocatableDecl(), isAllocatableDecl(), clang::FunctionDecl::isAnalyzerNoReturn(), clang::IsArmStreamingFunction(), clang::sema::isAssignmentOperatorLifetimeBound(), isBetterMultiversionCandidate(), clang::RecordDecl::isCapturedRecord(), isClassOrMethodDLLImport(), clang::EnumDecl::isClosedFlag(), clang::EnumDecl::isClosedNonFlag(), clang::FunctionDecl::isCPUDispatchMultiVersion(), clang::FunctionDecl::isCPUSpecificMultiVersion(), IsDefaultBufferConstantDecl(), clang::ObjCMethodDecl::isDirectMethod(), clang::CodeGen::CGCXXABI::isEmittedWithConstantInitializer(), clang::CodeGen::isEmptyField(), clang::VarDecl::isEscapingByref(), isFunctionDefinitionDiscarded(), clang::Type::isIncompleteType(), clang::installapi::isInlined(), clang::FunctionDecl::isInlineDefinitionExternallyVisible(), isInMIGCall(), isKernelDecl(), clang::VarDecl::isKnownToBeDefined(), isLayoutCompatible(), clang::FunctionDecl::isMSExternInline(), clang::RecordDecl::isMsStruct(), clang::VarDecl::isNoDestroy(), isNoexcept(), clang::VarDecl::isNonEscapingByref(), clang::ObjCProtocolDecl::isNonRuntimeProtocol(), clang::FunctionDecl::isNoReturn(), clang::SemaOpenMP::isOpenMPCapturedByRef(), clang::FieldDecl::isPotentiallyOverlapping(), clang::FunctionDecl::isReferenceableKernel(), clang::installapi::isRTTIWeakDef(), clang::FunctionDecl::isTargetClonesMultiVersion(), clang::FunctionDecl::isTargetMultiVersion(), clang::FunctionDecl::isTargetMultiVersionDefault(), clang::FunctionDecl::isTargetVersionMultiVersion(), isTestingFunction(), clang::ObjCMethodDecl::isThisDeclarationADesignatedInitializer(), IsTransparentUnionStandardConversion(), IsUnusedPrivateField(), clang::Expr::isUnusedResultAWarning(), isUsed(), clang::Sema::isValidPointerAttrType(), isVarDeclStrongDefinition(), isVarDeclStrongDefinition(), isVariableCapturable(), clang::FieldDecl::isZeroSize(), clang::Sema::makeUnavailableInSystemHeader(), markEscapingByrefs(), MarkVarDeclODRUsed(), clang::SemaObjC::MatchTwoMethodDeclarations(), clang::SemaCUDA::MaybeAddConstantAttr(), clang::SemaCUDA::maybeAddHostDeviceAttrs(), maybeAttachUnversionedSwiftName(), clang::Sema::MaybeBindToTemporary(), clang::ASTContext::mayExternalize(), clang::Sema::mergeAlwaysInlineAttr(), clang::Sema::mergeDeclAttributes(), clang::Sema::mergeDLLExportAttr(), clang::Sema::mergeDLLImportAttr(), clang::Sema::MergeFunctionDecl(), mergeInterfaceMethodToImpl(), clang::Sema::mergeMinSizeAttr(), mergeObjCDirectMembers(), clang::Sema::mergeOptimizeNoneAttr(), mergeParamDeclAttributes(), clang::ASTContext::mergeTransparentUnionType(), clang::Sema::MergeVarDecl(), noteOverloads(), clang::ASTContext::ObjCMethodsAreEqual(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), clang::Sema::ProcessDeclAttributeDelayed(), clang::Sema::ProcessDeclAttributeList(), clang::SemaObjC::ProcessPropertyDecl(), pushTemporaryCleanup(), recordUsesEBO(), clang::Sema::RefersToMemberWithReducedAlignment(), clang::CodeGen::SanitizerMetadata::reportGlobal(), requiresAMDGPUProtectedVisibility(), rewriteBuiltinFunctionDecl(), clang::Sema::SelectBestMethod(), clang::ASTContext::setBlockVarCopyInit(), clang::CodeGen::CodeGenModule::SetCommonAttributes(), setCUDAKernelCallingConvention(), clang::CodeGen::CodeGenModule::setDLLImportDLLExport(), clang::CodeGen::CodeGenModule::setGlobalVisibility(), setLinkageForGV(), setLinkageForGV(), clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition(), setVTableSelectiveDLLImportExport(), setWindowsItaniumDLLImport(), clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed(), shouldBeInCOMDAT(), shouldBeInCOMDAT(), shouldConsiderTemplateVisibility(), ShouldDiagnoseSwitchCaseNotInEnum(), ShouldDiagnoseUnusedDecl(), shouldEscapeRegion(), shouldExtendLifetime(), clang::ASTContext::shouldExternalize(), shouldFunctionGenerateHereOnly(), clang::MangleContext::shouldMangleDeclName(), clang::CXXNewExpr::shouldNullCheckAllocation(), shouldOmitDefinition(), ShouldUseExternalRTTIDescriptor(), shouldVarGenerateHereOnly(), ShouldWarnAboutMissingPrototype(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), SuggestInitializationFixit(), clang::CodeGen::CodeGenModule::TryEmitBaseDestructorAsAlias(), TryOrBuildParenListInitialization(), clang::Sema::updateAttrsForLateParsedTemplate(), clang::CodeGen::useFirstFieldIfTransparentUnion(), useInlineVisibilityHidden(), clang::interp::Compiler< Emitter >::visitCallArgs(), clang::sema::visitFunctionCallArguments(), clang::ASTDeclReader::VisitFunctionDecl(), clang::installapi::InstallAPIVisitor::VisitFunctionDecl(), clang::ento::SValExplainer::VisitNonParamVarRegion(), clang::RetainTypeChecker::visitTypedef(), clang::ASTDeclWriter::VisitVarDecl(), clang::installapi::InstallAPIVisitor::VisitVarDecl(), clang::ASTDeclReader::VisitVarDeclImpl(), and clang::SemaObjC::WarnExactTypedMethods().
|
inline |
Definition at line 518 of file DeclBase.h.
Referenced by actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPCopyinClause(), clang::SemaOpenMP::ActOnOpenMPCopyprivateClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaOpenMP::ActOnOpenMPUseDevicePtrClause(), addAttr(), attr_begin(), attr_end(), clang::Sema::BuildReturnStmt(), clang::Sema::CheckAlignasUnderalignment(), clang::Sema::CheckFieldDecl(), CheckStructurallyEquivalentAttributes(), clang::Sema::CheckVariableDeclarationType(), createPrivatesRecordDecl(), clang::CIRGen::CIRGenFunction::emitStaticVarDecl(), clang::SemaOpenMP::EndOpenMPDSABlock(), fillPackoffsetLayout(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), getAttr(), getMaxAlignment(), hasAttr(), hasAttr(), clang::ASTImporter::Import(), clang::Sema::mergeAvailabilityAttr(), clang::Sema::mergeDeclAttributes(), propagateAttributes(), RedeclarePropertyAccessor(), clang::MangleContext::shouldMangleDeclName(), clang::ASTDeclReader::UpdateDecl(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitFieldDecl(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitLabelStmt(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTemplateTypeParmDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), clang::ASTDeclWriter::VisitUsingShadowDecl(), and clang::ASTDeclWriter::VisitVarDecl().
|
inlinevirtual |
Returns true if this Decl
represents a declaration for a body of code, such as a function or method definition.
Note that hasBody
can also return true if any redeclaration of this Decl
represents a declaration for a body of code.
Reimplemented in clang::FunctionDecl, and clang::ObjCMethodDecl.
Definition at line 1093 of file DeclBase.h.
References getBody().
Referenced by clang::CloneDetector::analyzeCodeBody(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), emitDiagnostics(), emitOutlinedFunctionPrologue(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), hasImplicitBody(), clang::CallGraph::includeInGraph(), clang::Sema::maybeAddDeclWithEffects(), potentiallyWritesIntoIvar(), and clang::ento::CheckerManager::runCheckersOnASTBody().
|
inlineprotected |
Definition at line 421 of file DeclBase.h.
References CacheValidAndLinkage.
Referenced by clang::LinkageComputer::getLVForDecl(), clang::NamedDecl::hasLinkageBeenComputed(), and clang::NamedDecl::isLinkageValid().
bool Decl::hasDefiningAttr | ( | ) | const |
Return true if this declaration has an attribute which acts as definition of the entity, such as 'alias' or 'ifunc'.
Definition at line 611 of file DeclBase.cpp.
References hasAttr().
Referenced by clang::FunctionDecl::isThisDeclarationADefinition(), and clang::VarDecl::isThisDeclarationADefinition().
|
protected |
Definition at line 143 of file DeclBase.cpp.
References getASTContext(), clang::ASTContext::getLangOpts(), and clang::LangOptions::trackLocalOwningModule().
Referenced by getLocalOwningModule(), setLocalOwningModule(), and setModuleOwnershipKind().
|
inline |
Is this declaration owned by some module?
Definition at line 837 of file DeclBase.h.
References getModuleOwnershipKind(), and Unowned.
Referenced by getImportedOwningModule(), getLocalOwningModule(), setLexicalDeclContext(), and setLocalOwningModule().
|
inline |
Definition at line 899 of file DeclBase.h.
References getIdentifierNamespace(), and isTagIdentifierNamespace().
|
inline |
When doing manipulations which might change the computed linkage, such as changing the DeclContext after the declaration has already been used, invalidating the cache will make sure its linkage will be recomputed.
Definition at line 629 of file DeclBase.h.
References clang::Invalid, and setCachedLinkage().
|
inline |
Whether this particular Decl is a canonical one.
Definition at line 984 of file DeclBase.h.
References getCanonicalDecl().
Referenced by clang::index::FileIndexRecord::addDeclOccurence(), clang::ASTContext::addOverriddenMethod(), clang::CXXMethodDecl::addOverriddenMethod(), clang::ClassTemplateDecl::AddPartialSpecialization(), clang::VarTemplateDecl::AddPartialSpecialization(), clang::RedeclarableTemplateDecl::addSpecializationImpl(), clang::NamedDecl::declarationReplaces(), clang::ASTDumper::dumpTemplateDecl(), clang::CodeGen::CGOpenMPRuntimeGPU::emitFunctionProlog(), getCanonicalDecl(), clang::ASTReader::getLoadedSpecializationsLookupTables(), clang::ASTContext::getSubstTemplateTypeParmPackType(), clang::ASTReader::haveUnloadedSpecializations(), clang::ASTDeclWriter::VisitClassTemplateSpecializationDecl(), clang::ASTDeclReader::VisitClassTemplateSpecializationDeclImpl(), clang::ASTDeclReader::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclReader::VisitFunctionDecl(), clang::ASTDeclWriter::VisitFunctionDecl(), clang::ASTDeclWriter::VisitVarTemplateSpecializationDecl(), and clang::ASTDeclReader::VisitVarTemplateSpecializationDeclImpl().
|
inline |
isDefinedOutsideFunctionOrMethod - This predicate returns true if this scoped decl is defined outside the current function or method.
This is roughly global variables and functions, but also handles enums (which could be defined inside or outside a function etc).
Definition at line 949 of file DeclBase.h.
References getParentFunctionOrMethod().
Referenced by clang::Sema::InstantiateClass(), clang::SemaObjC::LookupIvarInObjCMethod(), LookupPotentialTypoResult(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitTypedefNameDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitVarDecl(), and clang::installapi::InstallAPIVisitor::VisitVarDecl().
Determine whether this declaration is marked 'deprecated'.
Message | If non-NULL and the declaration is deprecated, this will be set to the message describing why the declaration was deprecated (which may be empty). |
Definition at line 762 of file DeclBase.h.
References clang::AR_Deprecated, and getAvailability().
Referenced by clang::TypoCorrectionConsumer::addCorrection(), and clang::SemaObjC::addMethodToGlobalList().
bool Decl::isFileContextDecl | ( | ) | const |
Definition at line 432 of file DeclBase.cpp.
Referenced by clang::Sema::getTemplateInstantiationArgs().
|
inline |
True if this is the first declaration in its redeclaration chain.
Definition at line 1070 of file DeclBase.h.
References getPreviousDecl().
|
static |
Whether it resembles a flexible array member.
This is a static member because we want to be able to call it with a nullptr. That allows us to perform non-Decl specific checks based on the object's type and strict flex array level.
Definition at line 437 of file DeclBase.cpp.
References Decl(), clang::TypeLoc::getAs(), clang::TypeLoc::getAsAdjusted(), clang::ASTContext::getAsConstantArrayType(), clang::ASTContext::getAsIncompleteArrayType(), clang::Expr::getExprLoc(), clang::TypeSourceInfo::getTypeLoc(), and clang::SourceLocation::isMacroID().
Referenced by clang::Sema::CheckCountedByAttrOnField(), FindFlexibleArrayMemberField(), getConstField(), and clang::Expr::isFlexibleArrayMemberLike().
|
inline |
Determine whether this declaration came from an AST file (such as a precompiled header or module) rather than having been parsed.
Definition at line 793 of file DeclBase.h.
References FromASTFile.
Referenced by clang::ASTUnit::addFileLevelDecl(), clang::DeclContext::addHiddenDecl(), compareDeclarations(), clang::NamedDecl::declarationReplaces(), clang::ASTReader::forEachImportedKeyDecl(), getDeclForLocalLookup(), clang::ASTWriter::getDeclID(), clang::ASTWriter::GetDeclRef(), getGlobalID(), getImportedOwningModule(), clang::ASTReader::getKeyDeclaration(), getLocalOwningModule(), getOwningModule(), clang::ASTReader::getOwningModuleFile(), getOwningModuleID(), clang::Sema::InstantiateFunctionDefinition(), isDefinedInClangModule(), isImportedDeclContext(), clang::ASTWriter::IsLocalDecl(), clang::StoredDeclsList::removeExternalDecls(), clang::StoredDeclsList::replaceExternalDecls(), setLexicalDeclContext(), setLocalOwningModule(), setModuleOwnershipKind(), setOwningModuleID(), clang::TextNodeDumper::Visit(), clang::ASTDeclWriter::VisitNamespaceDecl(), and clang::ASTWriter::wasDeclEmitted().
bool Decl::isFromExplicitGlobalModule | ( | ) | const |
Whether this declaration comes from explicit global module.
Definition at line 1176 of file DeclBase.cpp.
References getOwningModule(), and clang::Module::isExplicitGlobalModule().
bool Decl::isFromGlobalModule | ( | ) | const |
Whether this declaration comes from global module.
Definition at line 1180 of file DeclBase.cpp.
References getOwningModule(), and clang::Module::isGlobalModule().
Referenced by clang::Sema::ActOnFunctionDeclarator(), and clang::shouldSkipCheckingODR().
bool Decl::isFromHeaderUnit | ( | ) | const |
Whether this declaration comes from a header unit.
Definition at line 1188 of file DeclBase.cpp.
References getOwningModule(), and clang::Module::isHeaderUnit().
Referenced by clang::shouldSkipCheckingODR().
|
inline |
Whether this declaration is a function or function template.
Definition at line 1119 of file DeclBase.h.
References clang::FunctionTemplate.
Referenced by SubstituteConstraintExpressionWithoutSatisfaction().
bool Decl::isFunctionPointerType | ( | ) | const |
Definition at line 1227 of file DeclBase.cpp.
References clang::QualType::getCanonicalType(), and clang::Type::isFunctionPointerType().
|
inline |
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
If false, this declaration was written explicitly in the source code.
Definition at line 593 of file DeclBase.h.
Referenced by clang::Sema::ActOnFinishFunctionBody(), clang::CXXRecordDecl::addedEligibleSpecialMemberFunction(), clang::Sema::AddOverloadCandidate(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER(), clang::Sema::buildOverloadedCallSet(), clang::Sema::BuildResolvedCallExpr(), checkDLLAttributeRedeclaration(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::sema::checkExprLifetimeImpl(), clang::SemaObjC::CheckObjCMethodOverrides(), CheckStructurallyEquivalentAttributes(), createOverloadsForFixedParams(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), DiagnoseBadTarget(), diagnoseDeprecatedCopyOperation(), clang::CodeGen::CodeGenFunction::EmitDestructorBody(), clang::CIRGen::CIRGenFunction::emitDestructorBody(), clang::CodeGen::CGDebugInfo::EmitFunctionDecl(), clang::CodeGen::CGDebugInfo::emitFunctionStart(), FindFlexibleArrayMemberField(), clang::CXXRecordDecl::finishedDefaultedOrDeletedMember(), clang::BodyFarm::getBody(), getDeclLocsForCommentSearch(), GetFieldOffset(), clang::CXXRecordDecl::getLambdaExplicitTemplateParameters(), getNonCLikeKindForAnonymousStruct(), clang::ObjCMethodDecl::getNumSelectorLocs(), clang::ObjCMethodDecl::getSelectorStartLoc(), clang::SemaObjC::HandleExprPropertyRefExpr(), hasImplicitAttr(), hasImplicitAttr(), hasImplicitBody(), clang::SemaCUDA::IdentifyTarget(), clang::Sema::ImplicitlyDefineFunction(), clang::index::IndexingContext::importedModule(), clang::index::IndexingContext::indexDecl(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), clang::FunctionTemplateDecl::isAbbreviated(), clang::FieldDecl::isAnonymousStructOrUnion(), IsArtificial(), clang::ObjCInterfaceDecl::isImplicitInterfaceDecl(), clang::CXXRecordDecl::isInjectedClassName(), clang::CXXConversionDecl::isLambdaToBlockPointerConversion(), clang::diff::isSpecializedNodeExcluded(), clang::ODRHash::isSubDeclToBeProcessed(), isTrackedVar(), IsUnusedPrivateField(), LeastDerivedClassWithSameLayout(), clang::ObjCInterfaceDecl::lookupMethod(), mergeDeclAttribute(), clang::Sema::MergeFunctionDecl(), clang::Sema::MergeTypedefNameDecl(), clang::Sema::NoteDeletedFunction(), RedeclarePropertyAccessor(), RedeclForcesDefC99(), clang::ObjCMethodDecl::setMethodParams(), clang::Sema::ShouldDeleteSpecialMember(), shouldExtendLifetime(), clang::RecursiveASTVisitor< Derived >::TraverseDecl(), TryConstructorInitialization(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit(), clang::JSONNodeDumper::Visit(), clang::TextNodeDumper::Visit(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXConstructorDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXConversionDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXDestructorDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXMethodDecl(), clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitCXXRecordDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTemplateTypeParmDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), and clang::Sema::warnOnReservedIdentifier().
bool Decl::isInAnonymousNamespace | ( | ) | const |
Definition at line 417 of file DeclBase.cpp.
References DeclContext, getDeclContext(), and clang::DeclContext::getParent().
Referenced by clang::ASTNodeImporter::hasSameVisibilityContextAndLinkage().
bool Decl::isInAnotherModuleUnit | ( | ) | const |
Whether this declaration comes from another module unit.
Definition at line 1138 of file DeclBase.cpp.
References getASTContext(), clang::ASTContext::getCurrentNamedModule(), and getOwningModule().
Referenced by clang::Sema::ArgumentDependentLookup(), clang::Sema::isRedefinitionAllowedFor(), clang::Sema::MergeFunctionDecl(), and clang::Sema::MergeVarDecl().
bool Decl::isInCurrentModuleUnit | ( | ) | const |
Whether this declaration comes from the same module unit being compiled.
Definition at line 1159 of file DeclBase.cpp.
References getASTContext(), clang::ASTContext::getCurrentNamedModule(), and getOwningModule().
bool Decl::isInExportDeclContext | ( | ) | const |
Whether this declaration was exported in a lexical context.
e.g.:
export namespace A { void f1(); // isInExportDeclContext() == true } void A::f1(); // isInExportDeclContext() == false
namespace B { void f2(); // isInExportDeclContext() == false } export void B::f2(); // isInExportDeclContext() == true
Definition at line 1121 of file DeclBase.cpp.
References DeclContext, getLexicalDeclContext(), clang::DeclContext::getLexicalParent(), and clang::isa().
Referenced by clang::Sema::ArgumentDependentLookup(), clang::Sema::CheckRedeclarationExported(), and clang::CodeGen::CodeGenModule::setGlobalVisibility().
Definition at line 893 of file DeclBase.h.
References getIdentifierNamespace().
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::DiagnoseAmbiguousLookup(), clang::LookupResult::getAcceptableDecl(), isOrdinaryMember(), clang::Sema::LookupQualifiedName(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
bool Decl::isInLocalScopeForInstantiation | ( | ) | const |
Determine whether a substitution into this declaration would occur as part of a substitution into a dependent local scope.
Such a substitution transitively substitutes into all constructs nested within this declaration.
This recognizes non-defining declarations as well as members of local classes and lambdas:
Definition at line 400 of file DeclBase.cpp.
References DeclContext, getLexicalDeclContext(), clang::DeclContext::getLexicalParent(), clang::isa(), clang::DeclContext::isDependentContext(), and clang::DeclContext::isFunctionOrMethod().
Referenced by clang::TemplateDeclInstantiator::InitFunctionInstantiation(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
bool Decl::isInNamedModule | ( | ) | const |
Whether this declaration comes from a named module.
Definition at line 1184 of file DeclBase.cpp.
References getOwningModule(), and clang::Module::isNamedModule().
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::ASTRecordWriter::AddCXXDefinitionData(), clang::Sema::CheckMain(), clang::Sema::CheckRedeclarationExported(), CollectEnclosingNamespace(), clang::NamedDecl::getFormalLinkage(), clang::CodeGen::CodeGenModule::getVTableLinkage(), clang::ASTWriter::handleVTable(), isExportedFromModuleInterfaceUnit(), clang::CodeGen::CodeGenVTables::isVTableExternal(), and clang::ASTDeclWriter::VisitCXXRecordDecl().
bool Decl::isInStdNamespace | ( | ) | const |
Definition at line 427 of file DeclBase.cpp.
References DeclContext, getDeclContext(), clang::DeclContext::getNonTransparentContext(), and clang::DeclContext::isStdNamespace().
Referenced by clang::Sema::ActOnFunctionDeclarator(), BuiltinInvoke(), ExtractTypeTraitFromExpression(), getInnerPointerType(), clang::FunctionDecl::getMemoryFunctionKind(), clang::Sema::inferNullableClassAttribute(), IsDeclSourceLocationCurrent(), isDestroyingDeleteT(), isFromStdNamespace(), clang::Type::isNothrowT(), libc_func_matchers::isNullTermPointer(), isStdClassTemplate(), IsStdFunction(), IsStdString(), clang::ento::tagged_union_modeling::isStdType(), and clang::sema::shouldTrackFirstArgument().
|
inline |
Definition at line 588 of file DeclBase.h.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnCXXEnterDeclInitializer(), clang::Sema::ActOnCXXForRangeStmt(), clang::Sema::ActOnCXXTryBlock(), clang::Sema::ActOnEndOfTranslationUnit(), clang::Sema::ActOnFields(), clang::SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(), clang::Sema::ActOnFinishExportDecl(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnInitializerError(), clang::SemaObjC::ActOnIvar(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), clang::SemaObjC::ActOnObjCAtCatchStmt(), clang::SemaObjC::ActOnObjCForCollectionStmt(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::Sema::ActOnStartOfFunctionDef(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), clang::Sema::ActOnTypedefNameDecl(), clang::Sema::ActOnVariableDeclarator(), clang::SemaOpenACC::ActOnVariableDeclarator(), clang::Sema::AddInitializerToDecl(), clang::Sema::AddKnownFunctionAttributes(), clang::Sema::AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(), adjustDeclContextForDeclaratorDecl(), AdoptTemplateParameterList(), allLookupResultsAreTheSame(), AnalyzeBitFieldAssignment(), clang::Sema::applyFunctionAttributesBeforeParsingBody(), clang::Sema::BuildCaptureField(), clang::Sema::BuildCXXForRangeStmt(), clang::Sema::BuildDeclaratorGroup(), buildDeclareReductionRef(), clang::SemaObjC::BuildIvarRefExpr(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildReturnStmt(), clang::SemaSYCL::BuildSYCLKernelCallStmt(), buildUserDefinedMapperRef(), clang::Sema::BuildUsingShadowDecl(), clang::Sema::BuildVariableInstantiation(), clang::Sema::BuildVarTemplateInstantiation(), canPassInRegisters(), CastToDerivedClass(), clang::SemaCUDA::checkAllowedInitializer(), checkARCPropertyImpl(), CheckC23ConstexprVarType(), clang::interp::CheckCallable(), clang::Sema::CheckCompletedCoroutineBody(), clang::Sema::CheckCompletedCXXClass(), clang::Sema::CheckConceptTemplateId(), clang::Sema::CheckConditionVariable(), clang::Sema::CheckCXX2CRelocatableAndReplaceable(), CheckDeclInExpr(), clang::SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(), clang::SemaOpenACC::CheckDeclReference(), checkDLLAttributeRedeclaration(), clang::Sema::CheckFieldDecl(), clang::Sema::CheckIfFunctionSpecializationIsImmediate(), clang::SemaObjC::checkInitMethod(), clang::Sema::CheckMain(), clang::SemaObjC::CheckMessageArgumentTypes(), checkMethodFamilyMismatch(), clang::Sema::CheckMSVCRTEntryPoint(), CheckMultiVersionAdditionalDecl(), clang::Sema::CheckNontrivialField(), clang::SemaObjC::CheckObjCPropertyAttributes(), clang::Sema::CheckOverrideControl(), checkPropertyDeclWithOwnership(), clang::SemaSYCL::CheckSYCLEntryPointFunctionDecl(), clang::SemaSYCL::CheckSYCLExternalFunctionDecl(), clang::Sema::CheckTemplateIdType(), clang::Sema::CheckVariableDeclaration(), clang::Sema::CheckVariableDeclarationType(), chooseRecoveryType(), clang::RecordDecl::completeDefinition(), ComputeDefaultedComparisonExceptionSpec(), ComputeDefaultedSpecialMemberExceptionSpec(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), clang::Sema::DeduceReturnType(), clang::Sema::DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::DeduceTemplateArgumentsFromType(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), clang::Sema::DeduceVariableDeclarationType(), clang::SemaObjC::DefaultSynthesizeProperties(), clang::Sema::DefineDefaultedComparison(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitDefaultConstructor(), clang::Sema::DefineImplicitLambdaToFunctionPointerConversion(), clang::Sema::DefineImplicitMoveAssignment(), DelegatingCycleHelper(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), clang::Sema::DiagnoseHiddenVirtualMethods(), DiagnoseIsFinalReason(), DiagnoseNonAggregateReason(), DiagnoseNonAssignableReason(), DiagnoseNonConstructibleReason(), DiagnoseNonReplaceableReason(), DiagnoseNonStandardLayoutReason(), DiagnoseNonTriviallyCopyableReason(), DiagnoseNonTriviallyRelocatableReason(), diagnoseOpenCLTypes(), DiagnoseReinterpretUpDownCast(), clang::SemaObjC::DiagnoseUnimplementedProperties(), clang::Sema::DiagnoseUninstantiableTemplate(), DoMarkBindingDeclReferenced(), DoMarkVarDeclReferenced(), clang::SemaOpenMP::EndOpenMPDSABlock(), EvaluateAndDiagnoseImmediateInvocation(), EvaluateVarDecl(), clang::Sema::FinalizeVarWithDestructor(), findCompleteObject(), clang::Sema::findInheritingConstructor(), clang::Sema::FindInstantiatedDecl(), clang::ASTContext::getASTRecordLayout(), clang::ASTContext::getCommentForDecl(), clang::Sema::getConstructorName(), getContainedDynamicClass(), clang::ASTContext::getDeclAlign(), clang::LinkageComputer::getLVForDecl(), getNonCLikeKindForAnonymousStruct(), clang::ASTContext::getPreferredTypeAlign(), clang::ASTContext::getTypeInfoDataSizeInChars(), clang::Sema::getUndefinedButUsed(), clang::SemaOpenCL::handleAccessAttr(), HandleClassZeroInitialization(), HandleConstructorCall(), clang::SemaSwift::handleError(), clang::Sema::HandleField(), handleGridConstantAttr(), HandleLValueBase(), HandleLValueDirectBase(), HandleLValueMember(), clang::Sema::HandleMSProperty(), handleNoEscapeAttr(), hasMultipleDataBaseClassesWithFields(), hasSuitableConstructorForRelocation(), hasSuitableMoveAssignmentOperatorForRelocation(), hasUserDefinedMapper(), clang::index::IndexingContext::importedModule(), clang::Sema::InheritedConstructorInfo::InheritedConstructorInfo(), clang::Sema::InstantiateClass(), clang::Sema::InstantiateClassTemplateSpecialization(), clang::Sema::InstantiateEnum(), clang::Sema::InstantiateMemInitializers(), clang::Sema::InstantiateVariableDefinition(), isBetterMultiversionCandidate(), clang::Sema::IsDerivedFrom(), isDesignatorAtObjectEnd(), clang::FunctionDecl::isImplicitlyInstantiable(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), clang::FieldDecl::isZeroSize(), clang::Sema::LookupLiteralOperator(), LookupMemberExpr(), MatchesFriend(), clang::CXXRecordDecl::mayBeAbstract(), clang::Sema::MaybeBindToTemporary(), clang::Sema::MergeFunctionDecl(), clang::Sema::MergeTypedefNameDecl(), clang::Sema::MergeVarDeclTypes(), clang::Sema::ParsedFreeStandingDeclSpec(), clang::Sema::PerformPendingInstantiations(), clang::SemaObjC::ProcessPropertyDecl(), clang::TreeTransform< Derived >::RebuildUnresolvedUsingType(), clang::Sema::RefersToMemberWithReducedAlignment(), clang::ASTContext::registerSYCLEntryPointFunction(), clang::LookupResult::resolveKind(), clang::Sema::SetDeclDefaulted(), clang::Sema::setTagNameForLinkagePurposes(), shouldBeHidden(), clang::Sema::ShouldDeleteSpecialMember(), ShouldDiagnoseUnusedDecl(), ShouldWarnAboutMissingPrototype(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), clang::TreeTransform< Derived >::SkipLambdaBody(), clang::Sema::SubstDecl(), clang::TemplateDeclInstantiator::SubstTemplateParams(), TryOrBuildParenListInitialization(), clang::JSONNodeDumper::Visit(), clang::TextNodeDumper::Visit(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitFieldDecl(), clang::interp::Compiler< Emitter >::VisitImplicitValueInitExpr(), clang::ASTDeclReader::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTemplateTypeParmDecl(), and clang::ASTDeclWriter::VisitTypedefDecl().
|
inline |
Definition at line 670 of file DeclBase.h.
References getModuleOwnershipKind(), and VisibleWhenImported.
|
inline |
Determine whether this is a block-scope declaration with linkage.
This will either be a local variable declaration declared 'extern', or a local function declaration.
Definition at line 1169 of file DeclBase.h.
References IDNS_LocalExtern.
Referenced by clang::Sema::BuildVariableInstantiation(), clang::Sema::canFullyTypeCheckRedeclaration(), checkDLLAttributeRedeclaration(), clang::Sema::FilterUsingLookup(), clang::Sema::HandleDelayedAccessCheck(), isInitializationOfVar(), isTemplated(), clang::Sema::MergeCXXFunctionDecl(), shouldBeHidden(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
bool Decl::isModuleLocal | ( | ) | const |
Whether this declaration was a local declaration to a C++20 named module.
Definition at line 1130 of file DeclBase.cpp.
References getModuleOwnershipKind(), getOwningModule(), clang::isa(), and ReachableWhenImported.
Referenced by clang::ASTContext::isSameEntity().
|
inline |
Whether this declaration was marked as being private to the module in which it was defined.
Definition at line 648 of file DeclBase.h.
References getModuleOwnershipKind(), and ModulePrivate.
|
virtual |
Determine whether this declaration is declared out of line (outside its semantic context).
Reimplemented in clang::FunctionDecl, and clang::VarDecl.
Definition at line 99 of file Decl.cpp.
References clang::DeclContext::Equals(), getDeclContext(), and getLexicalDeclContext().
Referenced by clang::Sema::ActOnCXXEnterDeclInitializer(), clang::Sema::ActOnCXXExitDeclInitializer(), diagnoseBadDirectAccess(), clang::FunctionDecl::isOutOfLine(), clang::VarDecl::isOutOfLine(), clang::Sema::PushOnScopeChains(), and clang::ASTDeclWriter::VisitDecl().
bool Decl::isParameterPack | ( | ) | const |
Whether this declaration is a parameter pack.
Definition at line 244 of file DeclBase.cpp.
References isTemplateParameterPack().
Referenced by clang::Sema::ActOnSizeofParameterPackExpr(), clang::computeDependence(), isSameAsPrimaryTemplate(), MatchTemplateParameterKind(), and UnresolvedLookupExprIsVariableOrConceptParameterPack().
|
inline |
Definition at line 863 of file DeclBase.h.
References getModuleOwnershipKind(), int, and ReachableWhenImported.
bool Decl::isReferenced | ( | ) | const |
Whether any declaration of this entity was referenced.
Definition at line 578 of file DeclBase.cpp.
References redecls().
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), clang::SemaOpenMP::ActOnOpenMPDeclareTargetName(), clang::Sema::BuildVariableInstantiation(), clang::SemaObjC::DiagnoseUnusedBackingIvarInAccessor(), clang::Sema::DiagnoseUnusedButSetDecl(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), ShouldDiagnoseUnusedDecl(), clang::ASTDeclWriter::VisitFieldDecl(), and clang::ASTDeclWriter::VisitObjCIvarDecl().
Definition at line 903 of file DeclBase.h.
References IDNS_Tag, IDNS_TagFriend, and IDNS_Type.
Referenced by hasTagIdentifierNamespace().
bool Decl::isTemplated | ( | ) | const |
Determine whether this declaration is a templated entity (whether it is.
Definition at line 286 of file DeclBase.cpp.
References getDeclContext(), getDescribedTemplateParams(), getFriendObjectKind(), getLexicalDeclContext(), isLocalExternDecl(), and isTemplateDecl().
Referenced by clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnStartOfFunctionDef(), clang::Sema::AddInitializerToDecl(), clang::dataflow::AdornedCFG::build(), clang::SemaSYCL::BuildSYCLKernelCallStmt(), clang::SemaSYCL::CheckSYCLEntryPointFunctionDecl(), clang::SemaSYCL::CheckSYCLExternalFunctionDecl(), clang::Sema::DiagnoseUniqueObjectDuplication(), clang::CodeGen::CodeGenModule::EmitTopLevelDecl(), clang::ASTContext::registerSYCLEntryPointFunction(), and clang::JSONNodeDumper::VisitNamedDecl().
bool Decl::isTemplateDecl | ( | ) | const |
returns true if this declaration is a template
Definition at line 259 of file DeclBase.cpp.
References clang::isa().
Referenced by isTemplated().
|
inline |
isTemplateParameter - Determines whether this declaration is a template parameter.
Definition at line 2793 of file DeclBase.h.
References getKind().
Referenced by clang::Sema::ActOnEnumConstant(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnParamDeclarator(), clang::Sema::CheckClassTemplate(), clang::Sema::DiagnoseTemplateParameterShadow(), clang::Sema::HandleDeclarator(), clang::Sema::HandleField(), clang::Sema::HandleMSProperty(), clang::NamedDecl::isReserved(), maybeDiagnoseTemplateParameterShadow(), shouldBeHidden(), and clang::ASTDeclReader::VisitDecl().
bool Decl::isTemplateParameterPack | ( | ) | const |
isTemplateParameter - Determines whether this declaration is a template parameter pack.
Definition at line 234 of file DeclBase.cpp.
Referenced by checkLiteralOperatorTemplateParameterList(), isParameterPack(), isStdClassTemplate(), clang::Sema::LookupLiteralOperator(), MatchTemplateParameterKind(), and clang::ASTDeclReader::VisitDecl().
|
inline |
Whether this declaration was referenced.
This should not be relied upon for anything other than debugging.
Definition at line 621 of file DeclBase.h.
Referenced by clang::JSONNodeDumper::Visit(), clang::TextNodeDumper::Visit(), and clang::ASTDeclWriter::VisitDecl().
|
inline |
Whether this declaration is a top-level declaration (function, global variable, etc.) that is lexically inside an objc container definition.
Definition at line 634 of file DeclBase.h.
Referenced by clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitFieldDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTemplateTypeParmDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), and clang::ASTDeclWriter::VisitVarDecl().
Determine whether this declaration is marked 'unavailable'.
Message | If non-NULL and the declaration is unavailable, this will be set to the message describing why the declaration was made unavailable (which may be empty). |
Definition at line 771 of file DeclBase.h.
References clang::AR_Unavailable, and getAvailability().
Referenced by clang::Sema::ActOnFinishFunctionBody(), and clang::SemaObjC::DefaultSynthesizeProperties().
|
inline |
Determine whether this declaration is definitely visible to name lookup, independent of whether the owning module is visible.
Note: The declaration may be visible even if this returns false
if the owning module is visible within the query context. This is a low-level helper function; most code should be calling Sema::isVisible() instead.
Definition at line 859 of file DeclBase.h.
References getModuleOwnershipKind(), int, and Visible.
Referenced by clang::LookupResult::isReachable(), clang::Sema::isReachable(), clang::LookupResult::isVisible(), clang::Sema::isVisible(), clang::ObjCProtocolDecl::lookupMethod(), clang::ASTReader::makeNamesVisible(), clang::SemaObjC::MatchTwoMethodDeclarations(), clang::ASTContext::mergeDefinitionIntoModule(), clang::ASTReader::mergeDefinitionVisibility(), NestedProtocolHasNoDefinition(), and setVisibleDespiteOwningModule().
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
CheckUsedAttr | When true, also consider the "used" attribute (in addition to the "used" bit set by setUsed() ) when determining whether the function is used. |
Definition at line 553 of file DeclBase.cpp.
References Decl(), getCanonicalDecl(), getMostRecentDecl(), and hasAttr().
Referenced by clang::SemaOpenMP::ActOnOpenMPDeclareTargetName(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::Sema::ActOnPragmaUnused(), clang::Sema::BuildVariableInstantiation(), checkDLLAttributeRedeclaration(), CheckMultiVersionAdditionalRules(), CheckMultiVersionFunction(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::CodeGen::CodeGenModule::EmitOMPDeclareMapper(), clang::CodeGen::CodeGenModule::EmitOMPDeclareReduction(), MarkBaseDestructorsReferenced(), markUsed(), clang::Sema::MergeCompatibleFunctionDecls(), clang::Sema::mergeDeclAttributes(), clang::Sema::MergeFunctionDecl(), clang::Sema::MergeVarDecl(), clang::CodeGen::CodeGenFunction::PushDestructorCleanup(), ShouldDiagnoseUnusedDecl(), ShouldRemoveFromUnused(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), clang::updateFlags(), clang::JSONNodeDumper::Visit(), clang::TextNodeDumper::Visit(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitFieldDecl(), and clang::ASTDeclWriter::VisitObjCIvarDecl().
bool Decl::isWeakImported | ( | ) | const |
Determine whether this is a weak-imported symbol.
Weak-imported symbols are typically marked with the 'weak_import' attribute, but may also be marked with an 'availability' attribute where we're targing a platform prior to the introduction of this feature.
Definition at line 848 of file DeclBase.cpp.
References clang::AR_NotYetIntroduced, attrs(), canBeWeakImported(), CheckAvailability(), getASTContext(), getMostRecentDecl(), and clang::isa().
Referenced by clang::ValueDecl::isWeak(), setLinkageForGV(), and setLinkageForGV().
void Decl::markUsed | ( | ASTContext & | C | ) |
Mark the declaration used, in the sense of odr-use.
This notifies any mutation listeners in addition to setting a bit indicating the declaration is used.
Definition at line 568 of file DeclBase.cpp.
References clang::C, isUsed(), and setIsUsed().
Referenced by clang::Sema::ActOnAddrLabel(), clang::Sema::ActOnGotoStmt(), clang::Sema::BuildBlockForLambdaConversion(), clang::Sema::BuildCXXForRangeStmt(), buildDeclRefExpr(), clang::SemaOpenMP::CheckOMPThreadPrivateDecl(), clang::Sema::createLambdaInitCaptureVarDecl(), clang::Sema::DefineDefaultedComparison(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitLambdaToBlockPointerConversion(), clang::Sema::DefineImplicitLambdaToFunctionPointerConversion(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::GetOrCreateMSAsmLabel(), and clang::ASTDeclReader::UpdateDecl().
|
protected |
Allocate memory for a non-deserialized declaration.
Definition at line 86 of file DeclBase.cpp.
References clang::cast(), Decl(), DeclContext, and clang::Extra.
|
protected |
Allocate memory for a deserialized declaration.
This routine must be used to allocate memory for any declaration that is deserialized from a module file.
Size | The size of the allocated object. |
Ctx | The context in which we will allocate memory. |
ID | The global ID of the deserialized declaration. |
Extra | The amount of extra space to allocate after the object. |
Definition at line 67 of file DeclBase.cpp.
References Decl(), clang::Extra, and clang::Result.
void Decl::print | ( | raw_ostream & | Out, |
const PrintingPolicy & | Policy, | ||
unsigned | Indentation = 0, | ||
bool | PrintInstantiation = false ) const |
Definition at line 139 of file DeclPrinter.cpp.
References Decl(), and getASTContext().
void Decl::print | ( | raw_ostream & | Out, |
unsigned | Indentation = 0, | ||
bool | PrintInstantiation = false ) const |
Definition at line 134 of file DeclPrinter.cpp.
References getASTContext(), and print().
Referenced by FunctionToString(), noteLocation(), and print().
|
static |
Definition at line 196 of file DeclPrinter.cpp.
References Decl(), clang::isa(), and clang::PrintingPolicy::SuppressSpecifiers.
|
static |
Definition at line 202 of file DeclBase.cpp.
Referenced by clang::ParseAST().
|
inline |
Returns an iterator range for all the redeclarations of the same decl.
It will iterate at least once (when this decl is the only one).
Definition at line 1049 of file DeclBase.h.
References redecls_begin(), and redecls_end().
Referenced by clang::interp::Program::createGlobal(), clang::NamedDecl::declarationReplaces(), clang::SemaObjC::DiagnoseOwningPropertyGetterSynthesis(), findAcceptableDecl(), findAcceptableDecl(), findDefiningRedecl(), getLambdaCallOperatorHelper(), clang::ASTContext::getRawCommentForAnyRedecl(), handleLifetimeCategoryAttr(), hasAcceptableDeclarationImpl(), and isReferenced().
|
inline |
|
inline |
Definition at line 1057 of file DeclBase.h.
Referenced by redecls().
|
inline |
Definition at line 502 of file DeclBase.h.
References Access, and setAccess().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFriendTypeDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaOpenMP::ActOnOpenMPAllocateDirective(), clang::Sema::ActOnStartCXXMemberDeclarations(), addBlockPointerConversion(), addFunctionPointerConversion(), clang::Sema::AddTemplateParametersToLambdaCallOperator(), clang::Sema::BuildAnonymousStructOrUnion(), clang::Sema::BuildUsingDeclaration(), clang::Sema::BuildUsingEnumDeclaration(), clang::Sema::BuildUsingShadowDecl(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckFieldDecl(), clang::Sema::CheckFunctionDeclaration(), clang::SemaOpenMP::CheckOMPThreadPrivateDecl(), clang::Sema::DeclareImplicitDefaultConstructor(), clang::Sema::findInheritingConstructor(), clang::Sema::HandleMSProperty(), InjectAnonymousStructOrUnionMembers(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::TemplateDeclInstantiator::InstantiateTypeAliasTemplateDecl(), clang::Sema::MergeVarDecl(), setAccess(), clang::UnresolvedSetImpl::setAccess(), setInvalidDecl(), clang::Sema::SetMemberAccessSpecifier(), clang::Sema::SubstSpaceshipAsEqualEqual(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTDeclReader::VisitDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitTypeAliasTemplateDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitUnresolvedUsingTypenameDecl(), clang::ASTNodeImporter::VisitUnresolvedUsingValueDecl(), clang::ASTNodeImporter::VisitUsingShadowDecl(), clang::ASTNodeImporter::VisitVarDecl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
|
inline |
Definition at line 520 of file DeclBase.h.
References getASTContext().
Referenced by addAttr(), propagateAttributes(), and RedeclarePropertyAccessor().
|
inlineprotected |
Definition at line 417 of file DeclBase.h.
References CacheValidAndLinkage.
Referenced by clang::LinkageComputer::getLVForDecl(), invalidateCachedLinkage(), clang::ASTDeclReader::VisitFunctionDecl(), and clang::ASTDeclReader::VisitVarDeclImpl().
void Decl::setDeclContext | ( | DeclContext * | DC | ) |
setDeclContext - Set both the semantic and lexical DeclContext to DC.
Definition at line 360 of file DeclBase.cpp.
References DeclContext.
Referenced by clang::SemaObjC::ActOnMethodDeclaration(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirective(), adjustDeclContextForDeclaratorDecl(), AdoptTemplateParameterList(), buildImplicitMapper(), CreateAAPCSABIBuiltinVaListDecl(), CreateAArch64ABIBuiltinVaListDecl(), clang::Sema::DeclApplyPragmaWeak(), clang::ParmVarDecl::setOwningFunction(), clang::Sema::SubstParmVarDecl(), clang::ASTDeclReader::VisitDecl(), and clang::ASTNodeImporter::VisitTypedefNameDecl().
|
inline |
Set the FromASTFile flag.
This indicates that this declaration was deserialized and not parsed from source code and enables features such as module ownership information.
Definition at line 718 of file DeclBase.h.
References FromASTFile.
Definition at line 594 of file DeclBase.h.
Referenced by clang::SemaOpenMP::ActOnOMPIteratorExpr(), clang::SemaObjC::ActOnStartCategoryImplementation(), clang::Sema::ActOnStartCXXMemberDeclarations(), clang::Sema::ActOnStartNamespaceDef(), clang::SemaOpenMP::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(), addBlockPointerConversion(), addFunctionPointerConversion(), clang::Sema::BuildAnonymousStructOrUnion(), clang::ASTContext::buildImplicitRecord(), clang::ASTContext::buildImplicitTypedef(), clang::Sema::BuildMicrosoftCAnonymousStruct(), buildVarDecl(), buildVarDecl(), CreateAAPCSABIBuiltinVaListDecl(), clang::Sema::CreateBuiltin(), clang::Sema::CreateCapturedStmtRecordDecl(), createHostLayoutStruct(), createHostLayoutStructForBuffer(), clang::Sema::DeclareGlobalNewDelete(), clang::Sema::findInheritingConstructor(), clang::Sema::ImplicitlyDefineFunction(), clang::ImplicitParamDecl::ImplicitParamDecl(), clang::ImplicitParamDecl::ImplicitParamDecl(), InjectAnonymousStructOrUnionMembers(), InsertOCLBuiltinDeclarationsFromTable(), InventTemplateParameter(), clang::Sema::MergeFunctionDecl(), clang::UsingShadowDecl::UsingShadowDecl(), clang::ASTDeclReader::VisitDecl(), and clang::ASTNodeImporter::VisitFieldDecl().
setInvalidDecl - Indicates the Decl had a semantic error.
This allows for graceful error recovery.
Definition at line 156 of file DeclBase.cpp.
References clang::AS_public, clang::cast(), clang::Invalid, clang::isa(), and setAccess().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnBlockArguments(), clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnCXXForRangeDecl(), clang::Sema::ActOnEndOfTranslationUnit(), clang::Sema::ActOnExceptionDeclarator(), clang::Sema::ActOnFields(), clang::Sema::ActOnFinishCXXInClassMemberInitializer(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFriendTypeDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnInitializerError(), clang::SemaObjC::ActOnIvar(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), clang::SemaObjC::ActOnMethodDeclaration(), clang::SemaObjC::ActOnObjCForCollectionStmt(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::SemaObjC::ActOnStartCategoryImplementation(), clang::SemaObjC::ActOnStartCategoryInterface(), clang::SemaObjC::ActOnStartClassImplementation(), clang::SemaObjC::ActOnStartClassInterface(), clang::Sema::ActOnStartConceptDefinition(), clang::Sema::ActOnStartExportDecl(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnStartOfFunctionDef(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), clang::SemaHLSL::ActOnTopLevelFunction(), clang::Sema::ActOnVariableDeclarator(), clang::SemaHLSL::ActOnVariableDeclarator(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildAnonymousStructOrUnion(), clang::Sema::BuildCaptureField(), clang::Sema::BuildDeclaratorGroup(), clang::Sema::BuildExceptionDeclaration(), clang::Sema::BuildMicrosoftCAnonymousStruct(), clang::Sema::BuildReturnStmt(), clang::Sema::BuildUsingDeclaration(), clang::Sema::BuildUsingEnumDeclaration(), clang::Sema::BuildUsingShadowDecl(), clang::SemaCUDA::checkAllowedInitializer(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckCompletedCoroutineBody(), clang::Sema::CheckCompleteDecompositionDeclaration(), clang::Sema::CheckCXXThisCapture(), CheckDeclarationCausesMultiVersioning(), checkDLLAttributeRedeclaration(), clang::SemaHLSL::CheckEntryPoint(), clang::Sema::CheckExplicitlyDefaultedFunction(), checkExportedDecl(), clang::Sema::CheckFieldDecl(), clang::Sema::CheckForFunctionRedefinition(), clang::Sema::CheckFunctionDeclaration(), checkInheritableAttr(), clang::Sema::CheckInheritingConstructorUsingDecl(), clang::SemaObjC::checkInitMethod(), clang::Sema::CheckMain(), clang::Sema::CheckMSVCRTEntryPoint(), CheckMultiVersionAdditionalDecl(), CheckMultiVersionFirstFunction(), CheckMultiVersionFunction(), checkNewAttributesAfterDef(), clang::SemaObjC::CheckObjCDeclScope(), clang::SemaObjC::CheckObjCPropertyAttributes(), clang::Sema::CheckOverrideControl(), clang::SemaCUDA::checkTargetOverload(), clang::Sema::CheckTypedefForVariablyModifiedType(), clang::Sema::CheckUsingShadowDecl(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::CheckVarTemplateId(), CreateNewFunctionDecl(), clang::SemaObjC::CreatePropertyDecl(), clang::Sema::DeduceVariableDeclarationType(), clang::Sema::DefineDefaultedComparison(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitLambdaToBlockPointerConversion(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseInvalidRedeclaration(), diagnoseOpenCLTypes(), clang::Sema::DiagnoseUninstantiableTemplate(), clang::Sema::FinalizeDeclaration(), clang::Sema::findInheritingConstructor(), FinishForRangeVarDecl(), clang::SemaOpenCL::handleAccessAttr(), clang::SemaHLSL::handleInitialization(), InjectAnonymousStructOrUnionMembers(), clang::Sema::InstantiateClass(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::Sema::InstantiateInClassInitializer(), clang::Sema::InstantiateVariableInitializer(), clang::Sema::ParseTypedefDecl(), clang::Sema::ProcessDeclAttributeList(), clang::Sema::SetDeclDefaulted(), clang::Sema::SubstBaseSpecifiers(), and clang::Sema::SubstDefaultArgument().
|
inline |
Set whether the declaration is used, in the sense of odr-use.
This should only be used immediately after creating a declaration. It intentionally doesn't notify any listeners.
Definition at line 608 of file DeclBase.h.
References getCanonicalDecl().
Referenced by clang::Sema::BuildVariableInstantiation(), markUsed(), and clang::updateFlags().
void Decl::setLexicalDeclContext | ( | DeclContext * | DC | ) |
Definition at line 364 of file DeclBase.cpp.
References clang::cast(), DeclContext, getASTContext(), getDeclContext(), getLexicalDeclContext(), getModuleOwnershipKind(), getOwningModule(), hasOwningModule(), isFromASTFile(), setLocalOwningModule(), setModuleOwnershipKind(), and VisibleWhenImported.
Referenced by clang::Sema::ActOnFields(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirective(), clang::SemaObjC::ActOnProperty(), clang::Sema::ActOnVariableDeclarator(), clang::ObjCImplDecl::addClassMethod(), clang::ObjCImplDecl::addInstanceMethod(), clang::ObjCImplDecl::addPropertyImplementation(), adjustDeclContextForDeclaratorDecl(), buildImplicitMapper(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckClassTemplate(), clang::SemaObjC::CheckImplementationIvars(), clang::Sema::CheckTemplateIdType(), clang::Sema::CompleteLambdaCallOperator(), clang::SemaObjC::CreatePropertyDecl(), clang::Sema::DeclApplyPragmaWeak(), RedeclarePropertyAccessor(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitConceptDecl(), clang::ASTNodeImporter::VisitEmptyDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitImplicitConceptSpecializationDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTNodeImporter::VisitLabelDecl(), clang::ASTNodeImporter::VisitLifetimeExtendedTemporaryDecl(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), clang::ASTNodeImporter::VisitNamespaceAliasDecl(), clang::ASTNodeImporter::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), clang::ASTNodeImporter::VisitObjCCategoryImplDecl(), clang::ASTNodeImporter::VisitObjCInterfaceDecl(), clang::ASTNodeImporter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::ASTNodeImporter::VisitObjCProtocolDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitRequiresExprBodyDecl(), clang::ASTNodeImporter::VisitStaticAssertDecl(), clang::ASTNodeImporter::VisitTypeAliasTemplateDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitUnresolvedUsingTypenameDecl(), clang::ASTNodeImporter::VisitUnresolvedUsingValueDecl(), clang::ASTNodeImporter::VisitUsingDecl(), clang::ASTNodeImporter::VisitUsingDirectiveDecl(), clang::ASTNodeImporter::VisitUsingEnumDecl(), clang::ASTNodeImporter::VisitUsingShadowDecl(), clang::ASTNodeImporter::VisitVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
|
inline |
Changes the namespace of this declaration to reflect that it's a function-local extern declaration.
These declarations appear in the lexical context of the extern declaration, but in the semantic context of the enclosing namespace scope.
Definition at line 1151 of file DeclBase.h.
References Decl(), getIdentifierNamespace(), getPreviousDecl(), IDNS_LocalExtern, IDNS_Ordinary, IDNS_OrdinaryFriend, and IDNS_Tag.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::BuildVariableInstantiation(), and clang::ASTDeclReader::VisitVarDeclImpl().
|
inline |
Definition at line 829 of file DeclBase.h.
References hasLocalOwningModuleStorage(), hasOwningModule(), and isFromASTFile().
Referenced by clang::Sema::ActOnStartLinkageSpecification(), clang::Sema::DeclareGlobalNewDelete(), and setLexicalDeclContext().
|
inline |
Definition at line 440 of file DeclBase.h.
Referenced by clang::Sema::ActOnLabelStmt(), clang::Sema::GetOrCreateMSAsmLabel(), clang::Sema::InstantiateClass(), clang::AccessSpecDecl::setAccessSpecifierLoc(), clang::TopLevelStmtDecl::setStmt(), clang::ASTDeclReader::UpdateDecl(), clang::ASTDeclReader::VisitDecl(), clang::ASTDeclReader::VisitOMPDeclareReductionDecl(), clang::ASTDeclReader::VisitPragmaCommentDecl(), and clang::ASTDeclReader::VisitPragmaDetectMismatchDecl().
|
inline |
Set whether this declaration is hidden from name lookup.
Definition at line 881 of file DeclBase.h.
References getModuleOwnershipKind(), hasLocalOwningModuleStorage(), isFromASTFile(), NextInContextAndBits, and Unowned.
Referenced by clang::Sema::ActOnFinishNamespaceDef(), clang::Sema::ActOnStartExportDecl(), clang::Sema::DeclareGlobalNewDelete(), setLexicalDeclContext(), setModulePrivate(), setVisibleDespiteOwningModule(), and clang::ASTDeclReader::VisitDecl().
|
inlineprotected |
Specify that this declaration was marked as being private to the module in which it was defined.
Definition at line 706 of file DeclBase.h.
References getModuleOwnershipKind(), ModulePrivate, setModuleOwnershipKind(), and Unowned.
|
inline |
Specifies that this declaration is a C++ overloaded non-member.
Definition at line 1235 of file DeclBase.h.
References clang::Function, clang::FunctionTemplate, getKind(), IDNS_NonMemberOperator, and IDNS_Ordinary.
Referenced by clang::Sema::ActOnFunctionDeclarator(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
Changes the namespace of this declaration to reflect that it's the object of a friend declaration.
These declarations appear in the lexical context of the friending class, but in the semantic context of the actual entity. This property applies only to a specific decl object; other redeclarations of the same entity may not (and probably don't) share this property.
Definition at line 1180 of file DeclBase.h.
References Decl(), getIdentifierNamespace(), getPreviousDecl(), IDNS_LocalExtern, IDNS_NonMemberOperator, IDNS_Ordinary, IDNS_OrdinaryFriend, IDNS_Tag, IDNS_TagFriend, and IDNS_Type.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::CheckClassTemplate(), and clang::ASTNodeImporter::VisitFriendDecl().
void Decl::setOwningModuleID | ( | unsigned | ID | ) |
Set the owning module ID.
This may only be called for deserialized Decls.
Definition at line 123 of file DeclBase.cpp.
References isFromASTFile().
Referenced by clang::ASTDeclReader::VisitDecl().
Definition at line 623 of file DeclBase.h.
Referenced by clang::Sema::BuildBlockForLambdaConversion(), buildDeclRefExpr(), clang::Sema::BuildVariableInstantiation(), clang::SemaOpenMP::CheckOMPThreadPrivateDecl(), clang::Sema::createLambdaInitCaptureVarDecl(), clang::Sema::DefineImplicitLambdaToFunctionPointerConversion(), DoMarkBindingDeclReferenced(), DoMarkVarDeclReferenced(), clang::Sema::MarkAnyDeclReferenced(), TryRefInitWithConversionFunction(), TryUserDefinedConversion(), and clang::ASTDeclReader::VisitDecl().
Definition at line 638 of file DeclBase.h.
References V.
Referenced by clang::Sema::ActOnDeclarator(), clang::SemaObjC::ActOnFinishObjCImplementation(), clang::Sema::ActOnFunctionDeclarator(), and clang::ASTDeclReader::VisitDecl().
|
inline |
Set that this declaration is globally visible, even if it came from a module that is not visible.
Definition at line 870 of file DeclBase.h.
References isUnconditionallyVisible(), setModuleOwnershipKind(), and Visible.
Referenced by clang::Sema::hasAcceptableDefinition(), clang::Sema::InstantiateClass(), clang::Sema::InstantiateEnum(), clang::Sema::InstantiateVariableDefinition(), clang::Sema::makeMergedDefinitionVisible(), clang::ASTReader::makeNamesVisible(), clang::ASTReader::mergeDefinitionVisibility(), and clang::ASTDeclReader::VisitDecl().
bool Decl::shouldEmitInExternalSource | ( | ) | const |
Whether the definition of the declaration should be emitted in external sources.
Definition at line 1168 of file DeclBase.cpp.
References clang::ExternalASTSource::EK_Always, getASTContext(), clang::ASTContext::getExternalSource(), and clang::ExternalASTSource::hasExternalDefinitions().
Referenced by clang::CodeGen::CodeGenModule::getVTableLinkage(), and clang::CodeGen::CodeGenVTables::isVTableExternal().
|
inline |
Definition at line 564 of file DeclBase.h.
References attr_begin().
Referenced by IsOverloadOrOverrideImpl(), and specific_attrs().
|
inline |
Definition at line 569 of file DeclBase.h.
References attr_end().
Referenced by IsOverloadOrOverrideImpl(), and specific_attrs().
|
inline |
Definition at line 559 of file DeclBase.h.
References specific_attr_begin(), and specific_attr_end().
Referenced by clang::SemaOpenMP::ActOnOpenMPCall(), clang::CodeGen::CodeGenModule::AddGlobalAnnotations(), AttrFilter(), clang::Sema::CheckAlignasUnderalignment(), clang::Sema::checkCall(), CheckNonNullArguments(), clang::SemaSYCL::CheckSYCLEntryPointFunctionDecl(), clang::Sema::CheckTCBEnforcement(), clang::interp::collectNonNullArgs(), compareEnableIfAttrs(), compareOverloads(), clang::computeDependence(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), clang::Sema::DiagnoseAlwaysNonNullPointer(), clang::SemaObjC::DiagnoseCStringFormatDirectiveInCFAPI(), diagnoseDiagnoseIfAttrsWith(), clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction(), clang::CodeGen::CodeGenFunction::EmitFieldAnnotations(), clang::CodeGen::CodeGenFunction::EmitVarAnnotations(), clang::Sema::FinalizeDeclaration(), findEnforceTCBAttrByName(), getNonNullAttr(), getPrintfFormatArgumentNum(), handleOwnershipAttr(), hasBTFDeclTagAttr(), clang::VarDecl::hasDependentAlignment(), hasRCAnnotation(), hasSameOverloadableAttrs(), isFunctionAlwaysEnabled(), isRelevantAttr(), mergeAlignedAttrs(), clang::Sema::mergeDeclAttributes(), clang::Sema::mergeFormatAttr(), clang::Sema::mergeFormatMatchesAttr(), printOwnershipTakesList(), propagateAttribute(), clang::CodeGen::SanitizerMetadata::reportGlobal(), and clang::CodeGen::CodeGenFunction::StartFunction().
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 326 of file DeclBase.h.
References ASTNodeImporter.
Referenced by ASTNodeImporter.
|
friend |
|
friend |
Definition at line 328 of file DeclBase.h.
References CXXClassMemberWrapper.
Referenced by CXXClassMemberWrapper.
|
friend |
Definition at line 252 of file DeclBase.h.
References DeclContext.
Referenced by clang::ExportDecl::ASTDeclReader, clang::FriendTemplateDecl::ASTDeclReader, clang::ObjCPropertyImplDecl::ASTDeclReader, clang::StaticAssertDecl::ASTDeclReader, clang::RequiresExprBodyDecl::ASTDeclWriter, clang::TopLevelStmtDecl::ASTDeclWriter, clang::ImportDecl::ASTReader, clang::BlockDecl::BlockDecl(), clang::BlockDecl::castFromDeclContext(), clang::CapturedDecl::castFromDeclContext(), castFromDeclContext(), clang::ExportDecl::castFromDeclContext(), clang::ExternCContextDecl::castFromDeclContext(), clang::LinkageSpecDecl::castFromDeclContext(), clang::OutlinedFunctionDecl::castFromDeclContext(), clang::RequiresExprBodyDecl::castFromDeclContext(), clang::TopLevelStmtDecl::castFromDeclContext(), clang::TranslationUnitDecl::castFromDeclContext(), clang::BlockDecl::castToDeclContext(), clang::CapturedDecl::castToDeclContext(), castToDeclContext(), clang::ExportDecl::castToDeclContext(), clang::ExternCContextDecl::castToDeclContext(), clang::LinkageSpecDecl::castToDeclContext(), clang::OutlinedFunctionDecl::castToDeclContext(), clang::RequiresExprBodyDecl::castToDeclContext(), clang::TopLevelStmtDecl::castToDeclContext(), clang::TranslationUnitDecl::castToDeclContext(), clang::AccessSpecDecl::Create(), clang::BlockDecl::Create(), clang::CapturedDecl::Create(), clang::EmptyDecl::Create(), clang::ExportDecl::Create(), clang::FileScopeAsmDecl::Create(), clang::FriendDecl::Create(), clang::FriendTemplateDecl::Create(), clang::ImplicitConceptSpecializationDecl::Create(), clang::ImportDecl::Create(), clang::LinkageSpecDecl::Create(), clang::ObjCPropertyImplDecl::Create(), clang::OutlinedFunctionDecl::Create(), clang::RequiresExprBodyDecl::Create(), clang::StaticAssertDecl::Create(), clang::TopLevelStmtDecl::Create(), clang::TranslationUnitDecl::Create(), clang::ImportDecl::CreateImplicit(), clang::FriendDecl::CXXRecordDecl::friend_iterator, Decl(), DeclContext, getDeclContext(), getDeclContext(), getLexicalDeclContext(), getLexicalDeclContext(), getNonTransparentDeclContext(), getNonTransparentDeclContext(), getParentFunctionOrMethod(), getParentFunctionOrMethod(), getTemplateDepth(), getTranslationUnitDecl(), clang::NamedDecl::isCXXClassMember(), isInAnonymousNamespace(), isInExportDeclContext(), isInLocalScopeForInstantiation(), isInStdNamespace(), clang::NamedDecl::isReserved(), clang::NamedDecl::NamedDecl(), clang::OpenACCConstructDecl::OpenACCConstructDecl(), operator new(), clang::NamedDecl::printNestedNameSpecifier(), setDeclContext(), and setLexicalDeclContext().
|
friend |
Definition at line 329 of file DeclBase.h.
References LinkageComputer.
Referenced by clang::NamedDecl::getLinkageAndVisibility(), clang::NamedDecl::getLinkageInternal(), clang::NamedDecl::isLinkageValid(), and LinkageComputer.
|
friend |
Definition at line 330 of file DeclBase.h.
References RecordDecl.
Referenced by clang::RecordDecl::Create(), clang::RecordDecl::CreateDeserialized(), and RecordDecl.
|
friend |
|
protected |
Access - Used by C++ decls for the access specifier.
Definition at line 336 of file DeclBase.h.
Referenced by CollectVisibleConversions(), Decl(), Decl(), getAccess(), getAccessUnsafe(), and setAccess().
|
mutableprotected |
If 0, we have not computed the linkage of this declaration.
Definition at line 348 of file DeclBase.h.
Referenced by Decl(), Decl(), getCachedLinkage(), hasCachedLinkage(), and setCachedLinkage().
|
protected |
Whether this declaration was loaded from an AST file.
Definition at line 340 of file DeclBase.h.
Referenced by Decl(), Decl(), isFromASTFile(), setFromASTFile(), and clang::ASTDeclReader::VisitDecl().
|
protected |
IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
Definition at line 344 of file DeclBase.h.
|
protected |
The next declaration within the same lexical DeclContext.
These pointers form the linked list that is traversed via DeclContext's decls_begin()/decls_end().
The extra three bits are used for the ModuleOwnershipKind.
Definition at line 249 of file DeclBase.h.
Referenced by clang::DeclContext::BuildDeclChain(), clang::DeclContext::containsDecl(), Decl(), getModuleOwnershipKind(), getNextDeclInContext(), getNextDeclInContext(), clang::DeclContext::isDeclInLexicalTraversal(), clang::DeclContext::removeDecl(), and setModuleOwnershipKind().