clang
7.0.0
|
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 } |
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 | ModuleOwnershipKind : unsigned { ModuleOwnershipKind::Unowned, ModuleOwnershipKind::Visible, ModuleOwnershipKind::VisibleWhenImported, ModuleOwnershipKind::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 | |
virtual SourceRange | getSourceRange () const LLVM_READONLY |
Source range that this declaration covers. More... | |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getBeginLoc () const LLVM_READONLY |
SourceLocation | getLocEnd () 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 |
Decl * | getNonClosureContext () |
Find the innermost non-closure ancestor of this declaration, walking up through blocks, lambdas, etc. More... | |
const Decl * | getNonClosureContext () const |
TranslationUnitDecl * | getTranslationUnitDecl () |
const TranslationUnitDecl * | getTranslationUnitDecl () const |
bool | isInAnonymousNamespace () const |
bool | isInStdNamespace () const |
ASTContext & | getASTContext () const LLVM_READONLY |
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. More... | |
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 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. More... | |
void | setInvalidDecl (bool Invalid=true) |
setInvalidDecl - Indicates the Decl had a semantic error. More... | |
bool | isInvalidDecl () const |
bool | isImplicit () const |
isImplicit - Indicates whether the declaration was implicitly generated by the implementation. More... | |
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. More... | |
void | setIsUsed () |
Set whether the declaration is used, in the sense of odr-use. More... | |
void | markUsed (ASTContext &C) |
Mark the declaration used, in the sense of odr-use. More... | |
bool | isReferenced () const |
Whether any declaration of this entity was referenced. More... | |
bool | isThisDeclarationReferenced () const |
Whether this declaration was referenced. More... | |
void | setReferenced (bool R=true) |
bool | isTopLevelDeclInObjCContainer () const |
Whether this declaration is a top-level declaration (function, global variable, etc.) that is lexically inside an objc container definition. More... | |
void | setTopLevelDeclInObjCContainer (bool V=true) |
ExternalSourceSymbolAttr * | getExternalSourceSymbolAttr () const |
Looks on this and related declarations for an applicable external source symbol attribute. More... | |
bool | isModulePrivate () const |
Whether this declaration was marked as being private to the module in which it was defined. More... | |
bool | isExported () const |
Whether this declaration is exported (by virtue of being lexically within an ExportDecl or by being a NamespaceDecl). More... | |
bool | hasDefiningAttr () const |
Return true if this declaration has an attribute which acts as definition of the entity, such as 'alias' or 'ifunc'. More... | |
const Attr * | getDefiningAttr () const |
Return this declaration's defining attribute if it has one. More... | |
AvailabilityResult | getAvailability (std::string *Message=nullptr, VersionTuple EnclosingVersion=VersionTuple(), StringRef *RealizedPlatform=nullptr) const |
Determine the availability of the given declaration. More... | |
VersionTuple | getVersionIntroduced () const |
Retrieve the version of the target platform in which this declaration was introduced. More... | |
bool | isDeprecated (std::string *Message=nullptr) const |
Determine whether this declaration is marked 'deprecated'. More... | |
bool | isUnavailable (std::string *Message=nullptr) const |
Determine whether this declaration is marked 'unavailable'. More... | |
bool | isWeakImported () const |
Determine whether this is a weak-imported symbol. More... | |
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. More... | |
bool | isFromASTFile () const |
Determine whether this declaration came from an AST file (such as a precompiled header or module) rather than having been parsed. More... | |
unsigned | getGlobalID () const |
Retrieve the global declaration ID associated with this declaration, which specifies where this Decl was loaded from. More... | |
unsigned | getOwningModuleID () const |
Retrieve the global ID of the module that owns this particular declaration. More... | |
Module * | getImportedOwningModule () const |
Get the imported owning module, if this decl is from an imported (non-local) module. More... | |
Module * | getLocalOwningModule () const |
Get the local owning module, if known. More... | |
void | setLocalOwningModule (Module *M) |
bool | hasOwningModule () const |
Is this declaration owned by some module? More... | |
Module * | getOwningModule () const |
Get the module that owns this declaration (for visibility purposes). More... | |
Module * | getOwningModuleForLinkage (bool IgnoreLinkage=false) const |
Get the module that owns this declaration for linkage purposes. More... | |
bool | isHidden () const |
Determine whether this declaration might be hidden from name lookup. More... | |
void | setVisibleDespiteOwningModule () |
Set that this declaration is globally visible, even if it came from a module that is not visible. More... | |
ModuleOwnershipKind | getModuleOwnershipKind () const |
Get the kind of module ownership for this declaration. More... | |
void | setModuleOwnershipKind (ModuleOwnershipKind MOK) |
Set whether this declaration is hidden from name lookup. More... | |
unsigned | getIdentifierNamespace () const |
bool | isInIdentifierNamespace (unsigned NS) const |
bool | hasTagIdentifierNamespace () const |
DeclContext * | getLexicalDeclContext () |
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC). More... | |
const DeclContext * | getLexicalDeclContext () const |
virtual bool | isOutOfLine () const |
Determine whether this declaration is declared out of line (outside its semantic context). More... | |
void | setDeclContext (DeclContext *DC) |
setDeclContext - Set both the semantic and lexical DeclContext to DC. More... | |
void | setLexicalDeclContext (DeclContext *DC) |
bool | isTemplated () const |
Determine whether this declaration is a templated entity (whether it is. More... | |
bool | isDefinedOutsideFunctionOrMethod () const |
isDefinedOutsideFunctionOrMethod - This predicate returns true if this scoped decl is defined outside the current function or method. More... | |
bool | isLexicallyWithinFunctionOrMethod () const |
Returns true if this declaration lexically is inside a function. More... | |
const DeclContext * | getParentFunctionOrMethod () const |
If this decl is defined inside a function/method/block it returns the corresponding DeclContext, otherwise it returns null. More... | |
DeclContext * | getParentFunctionOrMethod () |
virtual Decl * | getCanonicalDecl () |
Retrieves the "canonical" declaration of the given declaration. More... | |
const Decl * | getCanonicalDecl () const |
bool | isCanonicalDecl () const |
Whether this particular Decl is a canonical one. More... | |
redecl_range | redecls () const |
Returns an iterator range for all the redeclarations of the same decl. More... | |
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. More... | |
const Decl * | getPreviousDecl () const |
Retrieve the most recent declaration that declares the same entity as this declaration, or NULL if there is no previous declaration. More... | |
bool | isFirstDecl () const |
True if this is the first declaration in its redeclaration chain. More... | |
Decl * | getMostRecentDecl () |
Retrieve the most recent declaration that declares the same entity as this declaration (which may be this declaration). More... | |
const Decl * | getMostRecentDecl () const |
Retrieve the most recent declaration that declares the same entity as this declaration (which may be this declaration). More... | |
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. More... | |
virtual bool | hasBody () const |
Returns true if this Decl represents a declaration for a body of code, such as a function or method definition. More... | |
SourceLocation | getBodyRBrace () const |
getBodyRBrace - Gets the right brace of the body, if a body exists. More... | |
bool | isTemplateParameter () const |
isTemplateParameter - Determines whether this declaration is a template parameter. More... | |
bool | isTemplateParameterPack () const |
isTemplateParameter - Determines whether this declaration is a template parameter pack. More... | |
bool | isParameterPack () const |
Whether this declaration is a parameter pack. More... | |
bool | isTemplateDecl () const |
returns true if this declaration is a template More... | |
bool | isFunctionOrFunctionTemplate () const |
Whether this declaration is a function or function template. More... | |
TemplateDecl * | getDescribedTemplate () const |
If this is a declaration that describes some template, this method returns that template declaration. More... | |
FunctionDecl * | getAsFunction () LLVM_READONLY |
Returns the function itself, or the templated function if this is a function template. More... | |
const FunctionDecl * | getAsFunction () const |
void | setLocalExternDecl () |
Changes the namespace of this declaration to reflect that it's a function-local extern declaration. More... | |
bool | isLocalExternDecl () |
Determine whether this is a block-scope declaration with linkage. More... | |
void | setObjectOfFriendDecl (bool PerformFriendInjection=false) |
Changes the namespace of this declaration to reflect that it's the object of a friend declaration. More... | |
FriendObjectKind | getFriendObjectKind () const |
Determines whether this declaration is the object of a friend declaration and, if so, what kind. More... | |
void | setNonMemberOperator () |
Specifies that this declaration is a C++ overloaded non-member. More... | |
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) const |
const FunctionType * | getFunctionType (bool BlocksToo=true) const |
Looks through the Decl's underlying type to extract a FunctionType when possible. More... | |
Static Public Member Functions | |
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, unsigned ID, std::size_t Extra=0) |
Allocate memory for a deserialized declaration. More... | |
void * | operator new (std::size_t Size, const ASTContext &Ctx, DeclContext *Parent, std::size_t Extra=0) |
Allocate memory for a non-deserialized declaration. More... | |
Decl (Kind DK, DeclContext *DC, SourceLocation L) | |
Decl (Kind DK, EmptyShell Empty) | |
virtual | ~Decl () |
void | updateOutOfDate (IdentifierInfo &II) const |
Update a potentially out-of-date declaration. More... | |
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. More... | |
void | setOwningModuleID (unsigned ID) |
Set the owning module ID. More... | |
bool | hasLocalOwningModuleStorage () const |
virtual Decl * | getNextRedeclarationImpl () |
Returns the next redeclaration or itself if this is the only decl. More... | |
virtual Decl * | getPreviousDeclImpl () |
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain. More... | |
virtual Decl * | getMostRecentDeclImpl () |
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chain. More... | |
ASTMutationListener * | getASTMutationListener () const |
Protected Attributes | |
llvm::PointerIntPair< Decl *, 2, ModuleOwnershipKind > | NextInContextAndBits |
The next declaration within the same lexical DeclContext. More... | |
unsigned | Access: 2 |
Access - Used by C++ decls for the access specifier. More... | |
unsigned | FromASTFile: 1 |
Whether this declaration was loaded from an AST file. More... | |
unsigned | IdentifierNamespace: 13 |
IdentifierNamespace - This specifies what IDNS_* namespace this lives in. More... | |
unsigned | CacheValidAndLinkage: 3 |
If 0, we have not computed the linkage of this declaration. More... | |
Friends | |
class | DeclContext |
class | ASTDeclReader |
class | ASTDeclWriter |
class | ASTNodeImporter |
class | ASTReader |
class | CXXClassMemberWrapper |
class | LinkageComputer |
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 494 of file DeclBase.h.
using clang::Decl::attr_range = llvm::iterator_range<attr_iterator> |
Definition at line 495 of file DeclBase.h.
using clang::Decl::redecl_range = llvm::iterator_range<redecl_iterator> |
Definition at line 944 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 1100 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.
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.
Definition at line 213 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 195 of file DeclBase.h.
|
inlineprotected |
Definition at line 367 of file DeclBase.h.
References add().
Referenced by clang::BlockDecl::CreateDeserialized(), and getNumModuleIdentifiers().
|
inlineprotected |
Definition at line 377 of file DeclBase.h.
References add(), updateOutOfDate(), and ~Decl().
|
protectedvirtualdefault |
Referenced by Decl(), and clang::PrettyStackTraceDecl::print().
|
static |
Definition at line 193 of file DeclBase.cpp.
Referenced by Decl(), hasBody(), and writeShouldKill().
|
inline |
Definition at line 487 of file DeclBase.h.
References getAttrs(), hasAttrs(), and setAttrs().
Referenced by clang::Sema::AddAlignmentAttributesForRecord(), clang::Sema::AddCFAuditedAttribute(), clang::Sema::AddMsStructLayoutForRecord(), clang::Sema::AddNSConsumedAttr(), clang::Sema::AddOptnoneAttributeIfNoConflicts(), clang::Sema::AddParameterABIAttr(), assignInheritanceModel(), buildCaptureDecl(), clang::Sema::CheckARCMethodDecl(), checkDeclInTargetContext(), clang::Sema::checkInitMethod(), copyAttrIfPresent(), clang::Sema::CUDASetLambdaAttrs(), clang::Sema::FinalizeDeclaration(), clang::CodeGen::getTgtOffloadEntryQTy(), clang::Sema::inferCUDATargetForImplicitSpecialMember(), clang::Sema::makeUnavailableInSystemHeader(), clang::Sema::maybeAddCUDAHostDeviceAttrs(), clang::Sema::ProcessPropertyDecl(), clang::Sema::propagateDLLAttrToBaseClassTemplate(), clang::RecordDecl::setCapturedRecord(), and clang::ASTDeclReader::UpdateDecl().
|
inline |
Definition at line 501 of file DeclBase.h.
References getAttrs(), and hasAttrs().
Referenced by attrs(), and specific_attr_begin().
|
inline |
Definition at line 504 of file DeclBase.h.
References getAttrs(), and hasAttrs().
Referenced by attrs(), and specific_attr_end().
|
inline |
Definition at line 497 of file DeclBase.h.
References attr_begin(), and attr_end().
Referenced by DeclHasAttr(), getAvailability(), getIdentifierNamespaceForKind(), hasAttribute(), clang::threadSafety::BeforeSet::insertAttrExprs(), clang::Sema::InstantiateAttrs(), clang::Sema::InstantiateAttrsForDecl(), and isWeakImported().
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 655 of file DeclBase.cpp.
References getASTContext(), clang::ASTContext::getLangOpts(), clang::ObjCRuntime::hasWeakClassImport(), and clang::LangOptions::ObjCRuntime.
Referenced by isUnavailable(), and isWeakImported().
|
static |
Definition at line 844 of file DeclBase.cpp.
References clang::DeclContext::getDeclKind().
Referenced by classofKind(), and clang::cast_convert_decl_context< ToTy, IsKnownSubtype >::doit().
|
static |
Definition at line 863 of file DeclBase.cpp.
References getKind().
Referenced by classofKind(), and clang::BackendConsumer::StackSizeDiagHandler().
Definition at line 1126 of file DeclBase.h.
References Begin, castFromDeclContext(), castToDeclContext(), dump(), dumpColor(), getASTMutationListener(), getFunctionType(), print(), and printGroup().
|
inline |
Definition at line 509 of file DeclBase.h.
References getAttrs().
Referenced by clang::Sema::ActOnStartOfFunctionDef(), clang::Sema::checkIllFormedTrivialABIStruct(), clang::Sema::CheckOverrideControl(), clang::Sema::mergeDLLExportAttr(), clang::Sema::mergeMSInheritanceAttr(), clang::Sema::mergeOptimizeNoneAttr(), clang::Sema::mergeUuidAttr(), clang::Sema::MergeVarDecl(), and StripImplicitInstantiation().
void Decl::dropAttrs | ( | ) |
Definition at line 832 of file DeclBase.cpp.
References clang::ASTContext::eraseDeclAttrs(), and getASTContext().
Referenced by getAttrs().
LLVM_DUMP_METHOD void Decl::dump | ( | ) | const |
Definition at line 2738 of file ASTDumper.cpp.
References dump().
Referenced by classofKind(), clang::LookupResult::dump(), and clang::arcmt::trans::MigrationContext::dumpGCAttrs().
Definition at line 2740 of file ASTDumper.cpp.
References clang::ASTContext::getCommentCommandTraits(), clang::SourceManager::getDiagnostics(), clang::ASTContext::getPrintingPolicy(), clang::DiagnosticsEngine::getShowColors(), clang::ASTContext::getSourceManager(), P, and SM.
LLVM_DUMP_METHOD void Decl::dumpColor | ( | ) | const |
Definition at line 2749 of file ASTDumper.cpp.
References clang::ASTContext::getCommentCommandTraits(), clang::ASTContext::getPrintingPolicy(), clang::ASTContext::getSourceManager(), and P.
Referenced by classofKind().
|
static |
Definition at line 165 of file DeclBase.cpp.
Referenced by hasBody().
|
inline |
Definition at line 463 of file DeclBase.h.
References Access.
Referenced by clang::LookupResult::addDecl(), clang::Sema::BuildAnonymousStructUnionMemberReference(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckDestructorAccess(), clang::Sema::CheckFriendAccess(), clang::MemberExpr::Create(), EvaluateUnaryTypeTrait(), clang::CXXRecordDecl::finishedDefaultedOrDeletedMember(), clang::getConstructorInfo(), clang::TemplateDeclInstantiator::InitMethodInstantiation(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), isFunctionLocalClass(), clang::Sema::IsSimplyAccessible(), mangleThunkThisAdjustment(), clang::Sema::MergeVarDecl(), clang::Sema::SetMemberAccessSpecifier(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitVarDecl(), clang::TemplateDeclInstantiator::VisitVarDecl(), 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 470 of file DeclBase.h.
References Access.
FunctionDecl * Decl::getAsFunction | ( | ) |
Returns the function itself, or the templated function if this is a function template.
Definition at line 218 of file DeclBase.cpp.
Referenced by clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnSkippedFunctionBody(), clang::Sema::canSkipFunctionBody(), clang::Sema::checkCUDATargetOverload(), CheckFallThroughForBody(), clang::Sema::CheckFriendAccess(), clang::Sema::DiagnoseUnguardedAvailabilityViolations(), clang::ASTContext::forEachMultiversionedFunctionVersion(), getAsFunction(), clang::getDeclUsageType(), getExternalLinkageFor(), hasOnlyNonStaticMemberFunctions(), clang::ADLResult::insert(), clang::NamedDecl::isCXXInstanceMember(), isFunctionOrFunctionTemplate(), MarkKnownEmitted(), clang::Sema::maybeAddCUDAHostDeviceAttrs(), and clang::Parser::ParseTopLevelDecl().
|
inline |
Definition at line 1032 of file DeclBase.h.
References getAsFunction().
ASTContext & Decl::getASTContext | ( | ) | const |
Definition at line 376 of file DeclBase.cpp.
References clang::TranslationUnitDecl::getASTContext(), and getTranslationUnitDecl().
Referenced by clang::DeclContext::addHiddenDecl(), clang::CXXMethodDecl::addOverriddenMethod(), clang::CXXMethodDecl::begin_overridden_methods(), buildFakeCtorCall(), canBeWeakImported(), clang::VarDecl::checkInitIsICE(), clang::ExternalASTMerger::CompleteType(), clang::LinkageComputer::computeLVForDecl(), clang::ObjCObjectType::computeSuperClassTypeSlow(), clang::DeclRefExpr::DeclRefExpr(), dropAttrs(), clang::CodeGen::CodeGenModule::EmitTopLevelDecl(), clang::CXXMethodDecl::end_overridden_methods(), clang::VarDecl::ensureEvaluatedStmt(), evaluateCDTSize(), clang::VarDecl::evaluateValue(), findDirectBaseWithType(), formatBlockPlaceholder(), FormatFunctionParameter(), clang::index::CodegenNameGenerator::Implementation::getAllManglings(), clang::TypedefNameDecl::getAnonDeclWithTypedefName(), clang::AnalysisDeclContext::getASTContext(), clang::StmtSequence::getASTContext(), getASTMutationListener(), getAttrs(), getAvailability(), clang::FunctionDecl::getBody(), clang::FunctionDecl::getClassScopeSpecializationPattern(), clang::VarDecl::getDescribedVarTemplate(), clang::NamedDecl::getExplicitVisibility(), getExternalLinkageFor(), clang::LinkageComputer::getLVForDecl(), getMaxAlignment(), clang::VarDecl::getMemberSpecializationInfo(), clang::FunctionDecl::getMinRequiredArguments(), clang::getParameterABISpelling(), clang::DeclContext::getParentASTContext(), clang::OMPDeclareReductionDecl::getPrevDeclInScope(), clang::getPrimaryMergedDecl(), clang::FunctionDecl::getReturnTypeSourceRange(), getSelfInitExpr(), clang::CastExpr::getTargetFieldForToUnionCast(), clang::VarDecl::getTLSKind(), getTranslationUnitDecl(), getTypeInfoVTable(), clang::CXXRecordDecl::getVisibleConversionFunctions(), hasLocalOwningModuleStorage(), clang::Sema::hasStructuralCompatLayout(), clang::cross_tu::CrossTranslationUnitContext::importDefinition(), isConsumerInterestedIn(), isImportedDeclContext(), clang::Type::isIncompleteType(), clang::VarDecl::isKnownToBeDefined(), clang::RecordDecl::isMsStruct(), clang::ParmVarDecl::isParameterPack(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), isSameEntity(), clang::ASTNodeImporter::IsStructuralMatch(), clang::CXXRecordDecl::isTriviallyCopyable(), isWeakImported(), isZeroSized(), clang::CXXMethodDecl::overridden_methods(), print_elem(), clang::FunctionTemplateSpecializationInfo::Profile(), clang::CXXRecordDecl::removeConversion(), setAttrs(), clang::CXXRecordDecl::setBases(), clang::RecordDecl::setCapturedRecord(), clang::VarDecl::setDescribedVarTemplate(), clang::MaterializeTemporaryExpr::setExtendingDecl(), clang::CXXRecordDecl::setInstantiationOfMemberClass(), clang::VarDecl::setInstantiationOfStaticDataMember(), setLexicalDeclContext(), SetNestedNameSpecifier(), clang::BlockDecl::setParams(), clang::TagDecl::setQualifierInfo(), clang::VarDecl::setTemplateSpecializationKind(), clang::FunctionDecl::setTemplateSpecializationKind(), shouldOmitDefinition(), shouldRunOnFunctionOrMethod(), clang::CXXMethodDecl::size_overridden_methods(), clang::TagDecl::startDefinition(), updateOutOfDate(), and useInlineVisibilityHidden().
|
protected |
Definition at line 380 of file DeclBase.cpp.
References getASTContext(), and clang::ASTContext::getASTMutationListener().
Referenced by clang::VarTemplateDecl::AddPartialSpecialization(), classofKind(), clang::TagDecl::completeDefinition(), clang::CXXRecordDecl::isTriviallyCopyable(), clang::VarDecl::setTemplateSpecializationKind(), and clang::FunctionDecl::setTemplateSpecializationKind().
|
inline |
Definition at line 534 of file DeclBase.h.
References getAttrs(), and hasAttrs().
Referenced by clang::Sema::ActOnStartOfFunctionDef(), clang::Sema::AddParameterABIAttr(), AddVariableConstraints(), clang::consumed::ConsumedStmtVisitor::checkCallability(), clang::Sema::CheckIfOverriddenFunctionIsMarkedFinal(), clang::Sema::checkIllFormedTrivialABIStruct(), clang::Sema::CheckOverrideControl(), classifyPointerDeclarator(), copyAttrIfPresent(), clang::CodeGen::CodeGenModule::CreateFunctionTypeMetadataForIcall(), clang::Sema::DiagnoseSentinelCalls(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), extractRegisterName(), getCallingConventionForDecl(), clang::getDLLAttr(), getExternalSourceSymbolAttr(), clang::CodeGen::CodeGenModule::getFunctionFeatureMap(), clang::CodeGen::CodeGenModule::getMangledName(), getNonNullAttr(), getOpenCLArgAccess(), clang::index::getSymbolInfo(), getVisibilityOf(), clang::CodeGen::CodeGenModule::GetWeakRefReference(), clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation(), hasIdenticalPassObjectSizeAttrs(), isBetterMultiversionCandidate(), isGeneratedDecl(), clang::CodeGen::CodeGenModule::isTypeConstant(), clang::MangleContext::mangleName(), mapConsumableAttrState(), MaybeAddSentinel(), clang::CodeGen::CodeGenModule::maybeSetTrivialComdat(), clang::Sema::mergeAlwaysInlineAttr(), clang::Sema::mergeDeclAttributes(), clang::Sema::mergeDLLExportAttr(), clang::Sema::mergeMinSizeAttr(), clang::Sema::mergeMSInheritanceAttr(), clang::Sema::mergeOptimizeNoneAttr(), clang::Sema::mergeUuidAttr(), clang::Sema::NoteOverloadCandidate(), clang::consumed::ConsumedStateMap::operator!=(), clang::Sema::ProcessPropertyDecl(), recordUsesEBO(), clang::CodeGen::CodeGenModule::SetCommonAttributes(), clang::CodeGen::CodeGenModule::setTLSMode(), clang::CodeGen::CodeGenFunction::StartFunction(), testsFor(), clang::CodeGen::CGOpenMPRuntimeNVPTX::translateParameter(), clang::Sema::UnifySection(), clang::consumed::ConsumedStmtVisitor::VisitCXXConstructExpr(), clang::consumed::ConsumedStmtVisitor::VisitParmVarDecl(), and clang::CodeGen::CodeGenFunction::InlinedInheritingConstructorScope::~InlinedInheritingConstructorScope().
|
inline |
Definition at line 480 of file DeclBase.h.
References dropAttrs().
Referenced by clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPUseDevicePtrClause(), addAttr(), attr_begin(), attr_end(), AttributesMatch(), dropAttr(), getAttr(), getMaxAlignment(), getOrderedEnableIfAttrs(), hasAttr(), hasAttr(), clang::Sema::mergeAvailabilityAttr(), and clang::ASTDeclWriter::VisitDecl().
const AttrVec & Decl::getAttrs | ( | ) | const |
Definition at line 839 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 589 of file DeclBase.cpp.
References clang::AR_Available, clang::AR_Deprecated, clang::AR_Unavailable, attrs(), CheckAvailability(), getASTContext(), and clang::Result.
Referenced by clang::Sema::CanUseDecl(), clang::Sema::DiagnoseAvailabilityOfDecl(), getDeclAvailability(), clang::Sema::getDeletedOrUnavailableSuffix(), isDeprecated(), isUnavailable(), setOwningModuleID(), and ShouldDiagnoseAvailabilityOfDecl().
|
inline |
Definition at line 410 of file DeclBase.h.
References clang::SourceRange::getBegin(), and getSourceRange().
Referenced by getLocStart().
|
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::CapturedDecl, clang::BlockDecl, clang::FunctionDecl, and clang::ObjCMethodDecl.
Definition at line 986 of file DeclBase.h.
Referenced by clang::CloneDetector::analyzeCodeBody(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), CheckStringRefAssignedTemporary(), clang::ento::PathDiagnosticLocation::createDeclBegin(), getBodyRBrace(), hasBody(), clang::if(), clang::CallGraph::includeInGraph(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), clang::Parser::ParseTopLevelDecl(), and seenBeforeRec().
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 882 of file DeclBase.cpp.
References Access, clang::AS_none, getBody(), getDeclContext(), clang::SourceRange::getEnd(), clang::FunctionDecl::getSourceRange(), and isInvalidDecl().
Referenced by clang::ento::PathDiagnosticLocation::createDeclEnd(), clang::CodeGen::CodeGenFunction::GenerateObjCMethod(), and hasBody().
|
inlineprotected |
Definition at line 391 of file DeclBase.h.
References CacheValidAndLinkage.
Referenced by clang::LinkageComputer::getLVForDecl().
|
inlinevirtual |
Retrieves the "canonical" declaration of the given declaration.
Reimplemented in clang::UnresolvedUsingTypenameDecl, clang::UnresolvedUsingValueDecl, clang::UsingPackDecl, clang::UsingDecl, clang::EnumDecl, clang::UsingShadowDecl, clang::TagDecl, clang::NamespaceAliasDecl, clang::TypedefNameDecl, clang::VarTemplateDecl, clang::IndirectFieldDecl, clang::CXXConversionDecl, clang::EnumConstantDecl, clang::CXXDestructorDecl, clang::FieldDecl, clang::CXXConstructorDecl, clang::TypeAliasTemplateDecl, clang::ObjCProtocolDecl, clang::FunctionDecl, clang::ClassTemplateDecl, clang::CXXMethodDecl, clang::ObjCInterfaceDecl, clang::VarDecl, clang::FunctionTemplateDecl, clang::RedeclarableTemplateDecl, clang::CXXRecordDecl, clang::NamespaceDecl, and clang::ObjCMethodDecl.
Definition at line 877 of file DeclBase.h.
Referenced by clang::Sema::ActOnOpenMPDeclareSimdDirective(), clang::Sema::ActOnOpenMPDeclareTargetName(), clang::ODRHash::AddDecl(), BuildAppleKextVirtualCall(), CheckIdentityFieldAssignment(), CheckTemplateArgumentPointerToMember(), compareDeclarations(), clang::Sema::CompleteMemberSpecialization(), clang::NamedDecl::declarationReplaces(), clang::declaresSameEntity(), DeduceNonTypeTemplateArgument(), DiagnoseSelfAssignment(), clang::Sema::DiagnoseSelfMove(), clang::Sema::DiagnoseUseOfDecl(), clang::ADLResult::erase(), clang::ASTReader::forEachImportedKeyDecl(), getCanonicalDecl(), getCanonicalDecl(), getCanonicalParmVarDecl(), clang::ASTContext::getCanonicalTemplateArgument(), clang::ASTContext::getCommentForDecl(), clang::DeclarationNameTable::getCXXDeductionGuideName(), getDeclForLocalLookup(), clang::ASTReader::GetExistingDecl(), getExternalLinkageFor(), clang::ASTWriter::getFirstLocalDecl(), clang::CXXInstanceCall::getInitialStackFrameContents(), clang::ASTReader::getKeyDeclaration(), clang::ASTDeclReader::getMostRecentDecl(), clang::CallGraph::getOrInsertNode(), clang::VTableContextBase::getThunkInfo(), hasRecursiveCallInPath(), HasSameBase(), clang::Sema::hasVisibleDeclarationSlow(), clang::ADLResult::insert(), isCanonicalDecl(), isConstructor(), clang::StructuralEquivalenceContext::IsEquivalent(), clang::Sema::CodeSynthesisContext::isInstantiationRecord(), clang::OverloadCandidateSet::isNewCandidate(), clang::Sema::isOpenMPCapturedByRef(), isSameDeclaration(), isSameTemplate(), isUsed(), clang::ASTDeclWriter::RegisterTemplateSpecialization(), setIsUsed(), clang::ASTDeclReader::UpdateDecl(), clang::ASTDeclReader::Visit(), and wasDifferentDeclUsedForInlining().
|
inline |
Definition at line 878 of file DeclBase.h.
References getCanonicalDecl().
|
inline |
Definition at line 428 of file DeclBase.h.
Referenced by clang::Sema::ActOnConversionDeclarator(), clang::Sema::ActOnCXXEnterDeclInitializer(), clang::Sema::ActOnFinishObjCImplementation(), clang::Sema::ActOnStartOfObjCMethodDef(), addAssociatedClassesAndNamespaces(), clang::Sema::AddMethodCandidate(), clang::CodeGen::CodeGenTypes::addRecordTypeName(), addRedeclaredMethods(), AddTopLevelDeclarationToHash(), adjustDeclContextForDeclaratorDecl(), adjustParent(), clang::Sema::BuildVariableInstantiation(), clang::Sema::BuildVarTemplateInstantiation(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckConstructor(), clang::Sema::CheckCXXDefaultArgExpr(), checkDeclInTargetContext(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), CheckExplicitInstantiationScope(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::Sema::checkInitMethod(), clang::Sema::CheckLiteralOperatorDeclaration(), clang::Sema::CheckObjCMethodOverride(), clang::Sema::CheckObjCMethodOverrides(), CheckOperatorNewDeleteDeclarationScope(), clang::Sema::CheckShadow(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplatePartialSpecializationArgs(), CheckTemplateSpecializationScope(), clang::Sema::CheckUsingShadowDecl(), clang::Sema::checkVarDeclRedefinition(), collectOverriddenMethodsSlow(), clang::ASTReader::CompleteRedeclChain(), computeCachedProperties(), computeDeclRefDependence(), clang::LinkageComputer::computeLVForDecl(), clang::CodeCompletionResult::CreateCodeCompletionString(), clang::TypeName::createNestedNameSpecifier(), clang::TypeName::createNestedNameSpecifierForScopeOf(), clang::TypeName::createOuterNNS(), clang::NamedDecl::declarationReplaces(), clang::Sema::DeclareImplicitDeductionGuides(), clang::ASTContext::DeclMustBeEmitted(), DiagnoseBaseOrMemInitializerOrder(), diagnoseInstanceReference(), clang::Sema::DiagnoseOwningPropertyGetterSynthesis(), clang::Sema::DiagnosePropertyMismatch(), clang::Sema::DiagnoseShadowingLambdaDecls(), clang::CodeGen::CodeGenFunction::EmitAndRegisterVariableArrayDimensions(), clang::CodeGen::CGDebugInfo::EmitImportDecl(), clang::CodeGen::CGDebugInfo::EmitNamespaceAlias(), emitPrivatesInit(), clang::CodeGen::CGDebugInfo::EmitUsingDirective(), evaluateVarDeclInit(), FilterMethodsByTypeBound(), FindDeclaringClass(), findDirectBaseWithType(), findExplicitInstancetypeDeclarer(), clang::ExternalASTMerger::FindExternalLexicalDecls(), clang::Sema::FindInstantiatedDecl(), clang::ASTContext::forEachMultiversionedFunctionVersion(), FormatFunctionParameter(), getAsDeclContextOrEnclosing(), getAssignmentAction(), getBodyRBrace(), getContextForScopeMatching(), getDeclAvailability(), getDeclContext(), getDeclContextForTemplateInstationPattern(), getDeclForLocalLookup(), clang::getDeclUsageType(), clang::NamedDecl::getExplicitVisibility(), getExternalLinkageFor(), getExternalSourceSymbolAttr(), getFieldIndex(), getFunctionSourceLocation(), clang::CodeGen::CGCXXABI::getMemberPointerPathAdjustment(), getMethodReceiverIfKnownImmutable(), clang::ASTContext::getObjContainingInterface(), getOutermostFuncOrBlockContext(), clang::ObjCMethodDecl::getOverriddenMethods(), clang::getParameterABISpelling(), clang::DeclContext::getParent(), getParentFunctionOrMethod(), clang::diff::SyntaxTree::Impl::getRelativeName(), getReturnTypeForMethod(), clang::Sema::getShadowedDeclaration(), clang::ParmVarDecl::getSourceRange(), getStackIndexOfNearestEnclosingCaptureReadyLambda(), getStaticDeclName(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::index::getSymbolInfo(), clang::Sema::getTemplateInstantiationArgs(), getTranslationUnitDecl(), clang::ento::MemRegionManager::getVarRegion(), clang::index::IndexingContext::handleDecl(), clang::Sema::HandleDelayedAccessCheck(), hasCopyOrMoveCtorParam(), clang::Sema::hasVisibleMemberSpecialization(), hasWrittenStorageAttribute(), clang::Sema::HideUsingShadowDecl(), InNamespace(), clang::Sema::InstantiateAttrs(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::Sema::InstantiateVariableInitializer(), isConsumerInterestedIn(), isDebuggingContext(), isDeclWithinFunction(), clang::TemplateArgument::isDependent(), IsDisallowedCopyOrAssign(), clang::Sema::isFunctionConsideredUnavailable(), isFunctionLocalClass(), clang::FunctionDecl::isGlobal(), isInAnonymousNamespace(), clang::LambdaExpr::isInitCapture(), clang::RecordDecl::isInjectedClassName(), clang::TemplateArgument::isInstantiationDependent(), clang::AnalysisDeclContext::isInStdNamespace(), isInStdNamespace(), clang::CXXRecordDecl::isInterfaceLike(), clang::FunctionDecl::isMain(), isMethodContextSameForKindofLookup(), isMethodDeclaredInRootProtocol(), clang::FunctionDecl::isMSVCRTEntryPoint(), clang::CodeGen::CodeGenFunction::isObjCMethodWithTypeParams(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), isSameEntity(), isSingleLineLanguageLinkage(), clang::Sema::isStdInitializerList(), IsTailPaddedMemberArray(), isTemplated(), clang::index::IndexingContext::isTemplateImplicitInstantiation(), isTrackedVar(), clang::ODRHash::isWhitelistedDecl(), LookupMemberExpr(), clang::DeclContext::makeDeclVisibleInContext(), clang::MangleContext::mangleObjCMethodNameWithoutSize(), clang::Sema::MarkFunctionReferenced(), clang::Sema::mergeObjCMethodDecls(), MightInstantiateTo(), clang::Sema::PrintInstantiationStack(), RecordModifiableNonNullParam(), clang::tooling::replaceNestedName(), setLexicalDeclContext(), clang::CodeGen::CGDebugInfo::setLocation(), clang::ObjCMethodDecl::setMethodParams(), clang::FunctionDecl::setPure(), shouldConsiderLinkage(), ShouldDiagnoseUnusedDecl(), shouldIgnoreDueToReservedName(), clang::Sema::shouldLinkDependentDeclWithPrevious(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), SubstDefaultTemplateArgument(), clang::Sema::SubstParmVarDecl(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), clang::CodeGen::CGOpenMPRuntimeNVPTX::translateParameter(), clang::Sema::tryCaptureVariable(), clang::Sema::updateOutOfDateSelector(), ValidDuplicateEnum(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTNodeImporter::VisitEmptyDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), clang::ASTNodeImporter::VisitObjCCategoryImplDecl(), clang::ASTNodeImporter::VisitObjCImplementationDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTNodeImporter::VisitStaticAssertDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), clang::ASTDeclWriter::VisitVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
|
inline |
Definition at line 433 of file DeclBase.h.
References getDeclContext(), and getNonClosureContext().
const char * Decl::getDeclKindName | ( | ) | const |
Definition at line 123 of file DeclBase.cpp.
Referenced by clang::ASTDeclWriter::Emit(), clang::DeclContext::getDeclKind(), getKind(), clang::ASTNodeImporter::VisitDecl(), and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
const Attr * Decl::getDefiningAttr | ( | ) | const |
Return this declaration's defining attribute if it has one.
Definition at line 475 of file DeclBase.cpp.
Referenced by isModulePrivate().
TemplateDecl * Decl::getDescribedTemplate | ( | ) | const |
If this is a declaration that describes some template, this method returns that template declaration.
Definition at line 230 of file DeclBase.cpp.
Referenced by getDescribedTemplate(), isFunctionOrFunctionTemplate(), and isTemplated().
|
inline |
Definition at line 415 of file DeclBase.h.
References clang::SourceRange::getEnd(), and getSourceRange().
Referenced by getLocEnd(), clang::UsingDecl::getSourceRange(), and clang::UnresolvedUsingValueDecl::getSourceRange().
ExternalSourceSymbolAttr * Decl::getExternalSourceSymbolAttr | ( | ) | const |
Looks on this and related declarations for an applicable external source symbol attribute.
Definition at line 450 of file DeclBase.cpp.
References getAttr(), and getDeclContext().
Referenced by GetExternalSourceContainer(), and setTopLevelDeclInObjCContainer().
|
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 1110 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::CheckRedeclarationModuleOwnership(), clang::TemplateName::getNameToSubstitute(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), isImportedDeclContext(), isTemplated(), clang::CXXRecordDecl::isTriviallyCopyable(), clang::serialization::needsAnonymousDeclarationNumber(), shouldIgnoreDueToReservedName(), clang::Sema::shouldLinkDependentDeclWithPrevious(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), 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.
Will return null if the type underlying the Decl does not have a FunctionType.
Definition at line 933 of file DeclBase.cpp.
References clang::Type::getAs(), clang::PointerType::getPointeeType(), clang::BlockPointerType::getPointeeType(), clang::Type::isBlockPointerType(), and clang::Type::isFunctionPointerType().
Referenced by classofKind(), getFunctionOrMethodNumParams(), getFunctionOrMethodParamType(), getFunctionOrMethodResultType(), hasFunctionProto(), isFunctionOrMethod(), and isFunctionOrMethodVariadic().
|
inline |
Retrieve the global declaration ID associated with this declaration, which specifies where this Decl was loaded from.
Definition at line 706 of file DeclBase.h.
References isFromASTFile().
Referenced by clang::ASTWriter::getDeclID(), and clang::ASTWriter::GetDeclRef().
|
inline |
Definition at line 799 of file DeclBase.h.
Referenced by clang::StoredDeclsList::AddSubsequentDecl(), hasTagIdentifierNamespace(), clang::VisibleDeclConsumer::includeHiddenDecls(), isConstructor(), isInIdentifierNamespace(), setLocalExternDecl(), setObjectOfFriendDecl(), clang::UsingShadowDecl::setTargetDecl(), shouldBeHidden(), clang::ASTDeclWriter::VisitFunctionDecl(), clang::ASTDeclWriter::VisitRedeclarableTemplateDecl(), clang::ASTDeclWriter::VisitTagDecl(), and clang::ASTDeclWriter::VisitUsingShadowDecl().
|
static |
Definition at line 704 of file DeclBase.cpp.
References attrs(), clang::ASTContext::getDeclAttrs(), IDNS_Label, IDNS_Member, IDNS_Namespace, IDNS_ObjCProtocol, IDNS_OMPReduction, IDNS_Ordinary, IDNS_Tag, IDNS_Type, IDNS_Using, and Label.
Referenced by isInIdentifierNamespace().
|
inline |
Get the imported owning module, if this decl is from an imported (non-local) module.
Definition at line 729 of file DeclBase.h.
References hasOwningModule(), and isFromASTFile().
Referenced by getOwningModule(), clang::ASTReader::getOwningModuleNameForDiagnostic(), isConsumerInterestedIn(), and clang::ASTReader::mergeDefinitionVisibility().
|
inline |
Definition at line 422 of file DeclBase.h.
References getDeclKindName().
Referenced by clang::ODRHash::AddDecl(), clang::CodeGen::CodeGenModule::AddDeferredUnusedCoverageMapping(), clang::ASTDeclReader::attachLatestDecl(), clang::ASTDeclReader::attachPreviousDecl(), clang::Sema::BuildDeclarationNameExpr(), castToDeclContext(), clang::comments::Sema::checkReturnsCommand(), clang::OMPThreadPrivateDecl::classof(), clang::TranslationUnitDecl::classof(), clang::PragmaCommentDecl::classof(), clang::OMPDeclareReductionDecl::classof(), clang::AccessSpecDecl::classof(), clang::FriendDecl::classof(), clang::PragmaDetectMismatchDecl::classof(), clang::ExternCContextDecl::classof(), clang::NamedDecl::classof(), clang::TemplateDecl::classof(), clang::LabelDecl::classof(), clang::ObjCMethodDecl::classof(), clang::NamespaceDecl::classof(), clang::ObjCTypeParamDecl::classof(), clang::ValueDecl::classof(), clang::DeclaratorDecl::classof(), clang::RedeclarableTemplateDecl::classof(), clang::ObjCPropertyDecl::classof(), clang::FunctionTemplateDecl::classof(), clang::ObjCContainerDecl::classof(), clang::TemplateTypeParmDecl::classof(), clang::NonTypeTemplateParmDecl::classof(), clang::VarDecl::classof(), clang::ImplicitParamDecl::classof(), clang::TemplateTemplateParmDecl::classof(), clang::BuiltinTemplateDecl::classof(), clang::ParmVarDecl::classof(), clang::ClassTemplateSpecializationDecl::classof(), clang::DeclContext::classof(), clang::ObjCInterfaceDecl::classof(), clang::CXXRecordDecl::classof(), clang::ObjCIvarDecl::classof(), clang::CXXDeductionGuideDecl::classof(), clang::ClassTemplatePartialSpecializationDecl::classof(), clang::ObjCAtDefsFieldDecl::classof(), clang::CXXMethodDecl::classof(), clang::ClassTemplateDecl::classof(), clang::ObjCProtocolDecl::classof(), clang::FriendTemplateDecl::classof(), clang::TypeAliasTemplateDecl::classof(), clang::ObjCCategoryDecl::classof(), clang::ClassScopeFunctionSpecializationDecl::classof(), clang::ObjCImplDecl::classof(), clang::FunctionDecl::classof(), clang::ObjCCategoryImplDecl::classof(), clang::CXXConstructorDecl::classof(), clang::VarTemplateSpecializationDecl::classof(), clang::FieldDecl::classof(), clang::ObjCImplementationDecl::classof(), clang::CXXDestructorDecl::classof(), clang::ObjCCompatibleAliasDecl::classof(), clang::EnumConstantDecl::classof(), clang::CXXConversionDecl::classof(), clang::IndirectFieldDecl::classof(), clang::VarTemplatePartialSpecializationDecl::classof(), clang::TypeDecl::classof(), clang::ObjCPropertyImplDecl::classof(), clang::LinkageSpecDecl::classof(), clang::TypedefNameDecl::classof(), clang::TypedefDecl::classof(), clang::VarTemplateDecl::classof(), clang::TypeAliasDecl::classof(), clang::UsingDirectiveDecl::classof(), clang::NamespaceAliasDecl::classof(), clang::UsingShadowDecl::classof(), clang::TagDecl::classof(), clang::ConstructorUsingShadowDecl::classof(), clang::UsingDecl::classof(), clang::EnumDecl::classof(), clang::UsingPackDecl::classof(), clang::UnresolvedUsingValueDecl::classof(), clang::UnresolvedUsingTypenameDecl::classof(), clang::StaticAssertDecl::classof(), clang::RecordDecl::classof(), clang::BindingDecl::classof(), clang::FileScopeAsmDecl::classof(), clang::DecompositionDecl::classof(), clang::MSPropertyDecl::classof(), clang::BlockDecl::classof(), clang::CapturedDecl::classof(), clang::ImportDecl::classof(), clang::ExportDecl::classof(), clang::EmptyDecl::classof(), compareDeclarations(), clang::LinkageComputer::computeLVForDecl(), clang::NamedDecl::declarationReplaces(), dumpPreviousDecl(), clang::CodeGen::CodeGenFunction::EmitDecl(), clang::CodeGen::CodeGenModule::EmitDeferredUnusedCoverageMappings(), clang::CodeGen::CodeGenModule::EmitTopLevelDecl(), getAsPointeeSymbol(), clang::getCursorKindForDecl(), clang::ast_type_traits::ASTNodeKind::getFromNode(), getKind(), clang::ASTDeclReader::getMostRecentDecl(), getNonClosureContext(), clang::index::getSymbolInfo(), isInstantiationOf(), clang::comments::Sema::isObjCPropertyDecl(), isSameEntity(), isSameTemplateParameter(), isTemplateParameter(), clang::ODRHash::isWhitelistedDecl(), clang::ASTDeclReader::markIncompleteDeclChainImpl(), MatchTemplateParameterKind(), clang::ento::CheckerManager::runCheckersOnASTDecl(), setNonMemberOperator(), clang::RecursiveASTVisitor< CallGraph >::TraverseDecl(), clang::declvisitor::Base< declvisitor::make_ptr, ASTNodeImporter, Decl * >::Visit(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclReader::VisitRedeclarableTemplateDecl(), and clang::ASTDeclWriter::VisitVarDecl().
|
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 828 of file DeclBase.h.
Referenced by clang::ASTUnit::addFileLevelDecl(), clang::DeclContext::addHiddenDecl(), adjustDeclContextForDeclaratorDecl(), clang::Sema::BuildVariableInstantiation(), clang::DeclContext::containsDecl(), DiagUninitUse(), clang::ASTWriter::getAnonymousDeclarationNumber(), getContextForScopeMatching(), clang::ASTWriter::getDeclID(), clang::getDeclUsageType(), getLexicalDeclContext(), clang::DeclContext::getLexicalParent(), clang::Sema::HandleDelayedAccessCheck(), clang::Sema::hasVisibleMemberSpecialization(), clang::index::IndexingContext::indexBody(), clang::index::IndexingContext::indexNestedNameSpecifierLoc(), clang::index::IndexingContext::indexTypeLoc(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), isExported(), clang::VarDecl::isInExternCContext(), clang::FunctionDecl::isInExternCContext(), clang::VarDecl::isInExternCXXContext(), clang::FunctionDecl::isInExternCXXContext(), isLexicallyWithinFunctionOrMethod(), isTemplated(), clang::DeclContext::makeDeclVisibleInContext(), clang::Sema::MergeVarDecl(), clang::serialization::needsAnonymousDeclarationNumber(), RedeclForcesDefC99(), clang::DeclContext::removeDecl(), setLexicalDeclContext(), clang::Sema::shouldLinkDependentDeclWithPrevious(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTNodeImporter::VisitEmptyDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), clang::ASTNodeImporter::VisitObjCCategoryImplDecl(), clang::ASTNodeImporter::VisitObjCImplementationDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), clang::ASTDeclWriter::VisitVarDecl(), clang::ASTDeclReader::VisitVarDeclImpl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
|
inline |
Definition at line 833 of file DeclBase.h.
References getLexicalDeclContext(), isOutOfLine(), isTemplated(), setDeclContext(), and setLexicalDeclContext().
|
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 738 of file DeclBase.h.
References hasLocalOwningModuleStorage(), hasOwningModule(), and isFromASTFile().
Referenced by getOwningModule().
|
inline |
Definition at line 419 of file DeclBase.h.
Referenced by clang::Sema::ActOnCapturedRegionError(), clang::Sema::ActOnCompatibilityAlias(), clang::Sema::ActOnCompoundStmt(), clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnCXXForRangeDecl(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnForEachDeclStmt(), clang::Sema::ActOnForwardClassDeclaration(), clang::Sema::ActOnInitializerError(), clang::Sema::ActOnLabelStmt(), clang::Sema::ActOnLambdaError(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnObjCForCollectionStmt(), clang::Sema::ActOnOpenMPDeclareReductionCombinerStart(), clang::Sema::ActOnOpenMPDeclareReductionInitializerStart(), clang::Sema::ActOnOpenMPDeclareSimdDirective(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnPureSpecifier(), clang::Sema::ActOnStartCategoryImplementation(), clang::Sema::ActOnStartCategoryInterface(), clang::Sema::ActOnStartClassImplementation(), clang::Sema::ActOnStartOfObjCMethodDef(), clang::Sema::ActOnStartProtocolInterface(), clang::ASTUnit::addFileLevelDecl(), clang::Sema::AddInitializerToDecl(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), AuditedType(), clang::Sema::BuildDeclarationNameExpr(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), BuildNonArrayForRange(), clang::CodeGen::CGCXXABI::buildThisParam(), clang::Sema::BuildUnaryTransformType(), clang::Sema::BuildVariableInstantiation(), clang::ObjCMethodCall::canBeOverridenInSubclass(), clang::Sema::checkAllowedCUDAInitializer(), clang::Sema::CheckARCMethodDecl(), clang::Sema::CheckBaseSpecifier(), clang::Sema::CheckCompletedCXXClass(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckConditionVariable(), clang::Sema::CheckConflictingOverridingMethod(), CheckConstexprCtorInitializer(), CheckConstexprFunction(), clang::Sema::CheckConstexprFunctionBody(), clang::Sema::CheckConstexprFunctionDecl(), CheckConstexprParameterTypes(), clang::Sema::CheckCUDACall(), clang::Sema::checkCUDATargetOverload(), CheckCXX98CompatAccessibleCopy(), clang::Sema::CheckCXXDefaultArguments(), checkDeclInTargetContext(), clang::Sema::checkDeclIsAllowedInOpenMPTarget(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), clang::Sema::CheckDestructor(), checkDirectCallValidity(), clang::Sema::CheckEnumRedeclaration(), clang::Sema::CheckEquivalentExceptionSpec(), CheckExplicitInstantiationScope(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), clang::Sema::CheckExtraCXXDefaultArguments(), checkForMultipleExportedDefaultConstructors(), CheckForReference(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::Sema::CheckIfOverriddenFunctionIsMarkedFinal(), clang::Sema::CheckImplementationIvars(), clang::Sema::checkInitMethod(), clang::Sema::CheckLiteralOperatorDeclaration(), checkLiteralOperatorTemplateParameterList(), clang::Sema::CheckMain(), checkMemberDecomposition(), clang::Sema::checkMSInheritanceAttrOnDefinition(), clang::Sema::CheckMSVCRTEntryPoint(), clang::Sema::CheckObjCDeclScope(), clang::Sema::CheckObjCMethodOverride(), CheckOperatorDeleteDeclaration(), CheckOperatorNewDeclaration(), CheckOperatorNewDeleteDeclarationScope(), CheckOperatorNewDeleteTypes(), clang::Sema::CheckOverloadedOperatorDeclaration(), clang::Sema::CheckOverrideControl(), clang::Sema::CheckOverridingFunctionExceptionSpec(), clang::Sema::CheckParmsForFunctionDef(), clang::Sema::checkPartialSpecializationVisibility(), clang::Sema::CheckPureMethod(), clang::Sema::CheckRedeclarationModuleOwnership(), clang::Sema::checkRetainCycles(), clang::Sema::CheckSpecializationInstantiationRedecl(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), CheckTemplateSpecializationScope(), CheckTrivialDefaultConstructor(), checkTrivialSubobjectCall(), checkTupleLikeDecomposition(), clang::Sema::CheckUsingShadowDecl(), clang::Sema::checkVarDeclRedefinition(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::CheckVirtualDtorCall(), compare(), clang::Sema::CompleteMemberSpecialization(), clang::CodeGen::CGDebugInfo::completeRequiredType(), clang::CodeGen::CGDebugInfo::completeUnusedClass(), ConvertDeducedTemplateArgument(), clang::CodeGen::CodeGenFunction::createAtExitStub(), clang::CreateModernObjCRewriter(), clang::CreateObjCRewriter(), DeduceNullPtrTemplateArgument(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitCopyConstructor(), clang::Sema::DefineImplicitDefaultConstructor(), clang::Sema::DefineImplicitDestructor(), clang::Sema::DefineImplicitLambdaToBlockPointerConversion(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DefineImplicitMoveConstructor(), clang::Sema::DefineInheritingConstructor(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), clang::Sema::DiagnoseAutoDeductionFailure(), clang::Sema::DiagnoseClassExtensionDupMethods(), clang::Sema::DiagnoseDuplicateIvars(), clang::Sema::diagnoseEquivalentInternalLinkageDeclarations(), DiagnoseForRangeConstVariableCopies(), clang::Sema::DiagnoseHiddenVirtualMethods(), diagnoseMissingArgument(), clang::Sema::diagnoseMissingImport(), clang::Sema::DiagnoseOwningPropertyGetterSynthesis(), clang::Sema::DiagnosePropertyAccessorMismatch(), clang::Sema::DiagnosePropertyMismatch(), clang::Sema::DiagnoseSentinelCalls(), clang::Sema::DiagnoseShadowingLambdaDecls(), clang::Sema::DiagnoseTemplateParameterShadow(), DiagnoseUninitializedUse(), clang::Sema::DiagnoseUseOfDecl(), DiagUninitUse(), clang::CodeGen::CodeGenFunction::EmitAndRegisterVariableArrayDimensions(), clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitCombinerOrInitializer(), emitCXXDestructor(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), EmitDiagForCXXThrowInNonThrowingFunc(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), clang::CodeGen::CGDebugInfo::EmitImportDecl(), clang::CodeGen::CGDebugInfo::EmitNamespaceAlias(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::CodeGen::CGDebugInfo::EmitUsingDirective(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::Expr::EvaluateAsInitializer(), evaluateVarDeclInit(), clang::Sema::FinalizeVarWithDestructor(), findCompleteObject(), clang::Sema::findInheritingConstructor(), clang::Sema::FindProtocolDeclaration(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::TypedefNameDecl::getAnonDeclWithTypedefName(), clang::ASTWriter::getDeclID(), GetDeclSpecTypeForDeclarator(), GetEndLoc(), getFunctionSourceLocation(), getInitializationLoc(), GetLocationForCandidate(), GetNSSetArgumentIndex(), getPaddingDiagFromTagKind(), clang::getParameterABISpelling(), getPreviousDeclForInstantiation(), clang::ASTContext::getRawCommentForDeclNoCache(), clang::CXXCtorInitializer::getSourceLocation(), clang::FriendDecl::getSourceRange(), getSourceRange(), clang::VarDecl::getSourceRange(), clang::ParmVarDecl::getSourceRange(), clang::EnumConstantDecl::getSourceRange(), clang::TypedefDecl::getSourceRange(), clang::BlockDecl::getSourceRange(), clang::ImportDecl::getSourceRange(), getTagForRecord(), clang::ento::MemRegionManager::getVarRegion(), clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation(), clang::index::IndexingContext::handleDecl(), hasDefaultSetterName(), clang::ASTNodeImporter::ImportDefinition(), clang::index::IndexingContext::importedModule(), clang::index::IndexingContext::indexTopLevelDecl(), clang::Sema::inferCUDATargetForImplicitSpecialMember(), clang::Sema::inferObjCARCLifetime(), clang::Sema::InheritedConstructorInfo::InheritedConstructorInfo(), clang::Sema::InstantiateClass(), clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::Sema::InstantiateFunctionDefinition(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), clang::TagTypeLoc::isDefinition(), isFunctionLocalClass(), clang::ento::CallEvent::isInSystemHeader(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), clang::CodeGen::CodeGenModule::isTypeConstant(), clang::Sema::lookupCoroutineTraits(), LookupMethodInReceiverType(), clang::Sema::LookupSpecialMember(), LookupStdInitializerList(), lookupStdTypeTraitMember(), MatchTemplateParameterKind(), clang::Sema::maybeAddCUDAHostDeviceAttrs(), clang::Sema::MergeVarDecl(), clang::Sema::NoteDeletedFunction(), clang::Sema::NoteDeletedInheritingConstructor(), clang::Sema::NoteHiddenVirtualMethods(), NoteLValueLocation(), clang::Sema::NoteOverloadCandidate(), clang::Sema::notePreviousDefinition(), clang::Sema::ParseObjCSelectorExpression(), clang::Sema::PerformOpenMPImplicitIntegerConversion(), clang::PrettyDeclStackTraceEntry::print(), clang::Sema::ProcessPropertyDecl(), clang::Sema::propagateDLLAttrToBaseClassTemplate(), clang::TreeTransform< Derived >::RebuildDependentNameType(), clang::TreeTransform< Derived >::RebuildObjCExceptionDecl(), ReferenceDllExportedMembers(), clang::CodeGen::SanitizerMetadata::reportGlobalToASan(), reportOriginalDsa(), resolveBuiltinNewDeleteOverload(), rewriteToObjCInterfaceDecl(), roundUpSizeToCharAlignment(), clang::consumed::ConsumedAnalyzer::run(), scanToNextArgument(), clang::Sema::SetDeclDeleted(), clang::Sema::SetIvarInitializers(), clang::Sema::SetMemberAccessSpecifier(), clang::Sema::SetParamDefaultArgument(), clang::Sema::ShouldDeleteSpecialMember(), shouldIgnoreDueToReservedName(), clang::Sema::SpecialMemberIsTrivial(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), clang::CodeGen::CodeGenFunction::StartThunk(), clang::Sema::SubstParmVarDecl(), SuggestInitializationFixit(), clang::TreeTransform< Derived >::TransformCondition(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), clang::threadSafety::SExprBuilder::translateAttrExpr(), clang::CodeGen::CGOpenMPRuntimeNVPTX::translateParameter(), clang::Sema::tryCaptureVariable(), clang::Sema::UnifySection(), UseNSOptionsMacro(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitDecl(), clang::ASTNodeImporter::VisitEmptyDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), clang::tooling::RecursiveSymbolVisitor< T >::VisitNamedDecl(), clang::ASTNodeImporter::VisitObjCCategoryImplDecl(), clang::ASTNodeImporter::VisitObjCImplementationDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::ASTNodeImporter::VisitStaticAssertDecl(), clang::ASTNodeImporter::VisitTemplateTypeParmDecl(), clang::TemplateDeclInstantiator::VisitVarDecl(), clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl(), clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl(), clang::Sema::WarnConflictingTypedMethods(), and clang::Sema::WarnExactTypedMethods().
|
inline |
Definition at line 414 of file DeclBase.h.
References getEndLoc().
Referenced by AuditedType(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitCopyConstructor(), clang::Sema::DefineImplicitDefaultConstructor(), clang::Sema::DefineImplicitDestructor(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DefineImplicitMoveConstructor(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), findEnclosingDeclToAnnotate(), GenerateFixForUnusedDecl(), clang::OMPCapturedExprDecl::getSourceRange(), HandleFunctionCall(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), maybeRecoverWithZeroInitialization(), mustSynthesizeSetterGetterMethod(), rewriteToNSEnumDecl(), rewriteToNSMacroDecl(), SuggestInitializationFixit(), clang::ASTDeclWriter::VisitFunctionDecl(), and clang::ASTDeclWriter::VisitImportDecl().
|
inline |
Definition at line 409 of file DeclBase.h.
References getBeginLoc().
Referenced by addContextSensitiveTypeNullability(), clang::CodeGen::CodeGenModule::AddDeferredUnusedCoverageMapping(), clang::Sema::AddNSConsumedAttr(), AuditedType(), CheckObjCBridgeCFCast(), CheckObjCBridgeNSCast(), clang::Sema::checkObjCBridgeRelatedComponents(), clang::Sema::CheckObjCBridgeRelatedConversions(), CheckUnreachable(), clang::ento::PathDiagnosticLocation::createBegin(), clang::Sema::diagnoseNullResettableSynthesizedSetters(), clang::LiveVariables::dumpBlockLiveness(), findEnclosingDeclToAnnotate(), GenerateFixForUnusedDecl(), getFunctionSourceLocation(), clang::ASTContext::getRawCommentForDeclNoCache(), clang::OMPCapturedExprDecl::getSourceRange(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), clang::Parser::ObjCTypeParamListScope::leave(), clang::InitializationSequence::Perform(), clang::Sema::PrintPragmaAttributeInstantiationPoint(), RewriteOneForwardClassDecl(), clang::ASTDeclWriter::VisitLabelDecl(), clang::ASTDeclWriter::VisitOMPDeclareReductionDecl(), clang::ASTDeclWriter::VisitPragmaCommentDecl(), and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
unsigned Decl::getMaxAlignment | ( | ) | const |
getMaxAlignment - return the maximum alignment specified by attributes on this decl, 0 if there are none.
Definition at line 384 of file DeclBase.cpp.
References getASTContext(), getAttrs(), and hasAttrs().
Referenced by clang::ASTContext::getDeclAlign(), getDeclAlignIfRequired(), hasAttr(), roundUpSizeToCharAlignment(), and clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition().
|
inline |
Get the kind of module ownership for this declaration.
Definition at line 786 of file DeclBase.h.
Referenced by clang::Sema::hasMergedDefinitionInCurrentModule(), hasOwningModule(), isExportedFromModuleIntefaceUnit(), isHidden(), isModulePrivate(), setLexicalDeclContext(), setModuleOwnershipKind(), and setModulePrivate().
|
inline |
Retrieve the most recent declaration that declares the same entity as this declaration (which may be this declaration).
Definition at line 975 of file DeclBase.h.
References getMostRecentDeclImpl().
Referenced by clang::ASTDeclWriter::AddFirstDeclFromEachModule(), isImportedDeclContext(), isUsed(), and clang::Sema::mergeDeclAttributes().
|
inline |
Retrieve the most recent declaration that declares the same entity as this declaration (which may be this declaration).
Definition at line 979 of file DeclBase.h.
References getMostRecentDeclImpl().
|
inlineprotectedvirtual |
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chain.
Reimplemented in clang::TagDecl, clang::TypedefNameDecl, clang::FunctionDecl, and clang::VarDecl.
Definition at line 898 of file DeclBase.h.
Referenced by getMostRecentDecl().
|
inline |
Definition at line 425 of file DeclBase.h.
Referenced by clang::DeclContext::addHiddenDecl(), IsTailPaddedMemberArray(), and clang::DeclContext::decl_iterator::operator++().
|
inline |
Definition at line 426 of file DeclBase.h.
|
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::TagDecl, clang::TypedefNameDecl, clang::FunctionDecl, and clang::VarDecl.
Definition at line 890 of file DeclBase.h.
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 971 of file DeclBase.cpp.
References getNonClosureContext().
Referenced by getDeclContext(), getNonClosureContext(), getNonClosureContext(), and clang::CodeGen::CodeGenFunction::StartFunction().
|
inline |
Definition at line 443 of file DeclBase.h.
References getNonClosureContext(), and getTranslationUnitDecl().
|
inline |
Get the module that owns this declaration (for visibility purposes).
Definition at line 759 of file DeclBase.h.
References getImportedOwningModule(), getLocalOwningModule(), getOwningModuleForLinkage(), and isFromASTFile().
Referenced by clang::Sema::CheckRedeclarationModuleOwnership(), clang::CodeGen::CGDebugInfo::completeUnusedClass(), getExternalLinkageFor(), getInternalLinkageFor(), clang::Sema::getOwningModule(), isExportedFromModuleIntefaceUnit(), clang::Sema::notePreviousDefinition(), setLexicalDeclContext(), and clang::ASTDeclWriter::VisitDecl().
Get the module that owns this declaration for linkage purposes.
There only ever is such a module under the C++ Modules TS.
IgnoreLinkage | Ignore the linkage of the entity; assume that all declarations in a global module fragment are unowned. |
Definition at line 1461 of file Decl.cpp.
References clang::Module::GlobalModuleFragment, clang::InternalLinkage, clang::Module::Kind, clang::Module::ModuleInterfaceUnit, clang::Module::ModuleMapModule, and clang::Module::Parent.
Referenced by clang::Sema::CheckRedeclarationModuleOwnership(), getOwningModule(), isTemplate(), and clang::MangleContext::shouldMangleDeclName().
|
inline |
Retrieve the global ID of the module that owns this particular declaration.
Definition at line 714 of file DeclBase.h.
References hasLocalOwningModuleStorage(), and isFromASTFile().
Referenced by clang::CodeGen::CGDebugInfo::completeUnusedClass(), and clang::ASTReader::mergeDefinitionVisibility().
const DeclContext * Decl::getParentFunctionOrMethod | ( | ) | const |
If this decl is defined inside a function/method/block it returns the corresponding DeclContext, otherwise it returns null.
Definition at line 254 of file DeclBase.cpp.
References getDeclContext(), and clang::DeclContext::isTranslationUnit().
Referenced by getParentFunctionOrMethod(), isDefinedOutsideFunctionOrMethod(), and clang::index::isFunctionLocalSymbol().
|
inline |
Definition at line 871 of file DeclBase.h.
References getParentFunctionOrMethod().
|
inline |
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
Definition at line 960 of file DeclBase.h.
References getPreviousDeclImpl().
Referenced by clang::ASTDeclWriter::AddFirstDeclFromEachModule(), clang::Sema::CheckSpecializationInstantiationRedecl(), DiagnoseNamespaceInlineMismatch(), getDeclForLocalLookup(), clang::ASTWriter::getFirstLocalDecl(), clang::TemplateName::getNameToSubstitute(), clang::Sema::InstantiateFunctionDefinition(), isFirstDecl(), isImportedDeclContext(), clang::CXXRecordDecl::isTriviallyCopyable(), setLocalExternDecl(), setObjectOfFriendDecl(), and clang::ASTNodeImporter::VisitUnresolvedUsingType().
|
inline |
Retrieve the most recent declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
Definition at line 964 of file DeclBase.h.
References getPreviousDeclImpl().
|
inlineprotectedvirtual |
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
Reimplemented in clang::TagDecl, clang::TypedefNameDecl, clang::FunctionDecl, and clang::VarDecl.
Definition at line 894 of file DeclBase.h.
Referenced by getPreviousDecl().
|
inlinevirtual |
Source range that this declaration covers.
Reimplemented in clang::ExportDecl, clang::ImportDecl, clang::BlockDecl, clang::FileScopeAsmDecl, clang::StaticAssertDecl, clang::UnresolvedUsingValueDecl, clang::UsingPackDecl, clang::UsingDecl, clang::TagDecl, clang::NamespaceAliasDecl, clang::UsingDirectiveDecl, clang::TypeAliasDecl, clang::TypedefDecl, clang::LinkageSpecDecl, clang::TypeDecl, clang::ObjCPropertyImplDecl, clang::EnumConstantDecl, clang::FieldDecl, clang::ObjCProtocolDecl, clang::FunctionDecl, clang::ClassTemplateSpecializationDecl, clang::BuiltinTemplateDecl, clang::TemplateTemplateParmDecl, clang::ParmVarDecl, clang::ObjCInterfaceDecl, clang::NonTypeTemplateParmDecl, clang::TemplateTypeParmDecl, clang::ObjCContainerDecl, clang::VarDecl, clang::ObjCPropertyDecl, clang::DeclaratorDecl, clang::ObjCTypeParamDecl, clang::NamespaceDecl, clang::LabelDecl, clang::TemplateDecl, clang::ObjCMethodDecl, clang::OMPCapturedExprDecl, clang::AccessSpecDecl, and clang::FriendDecl.
Definition at line 405 of file DeclBase.h.
References getLocation().
Referenced by clang::Sema::checkDeclIsAllowedInOpenMPTarget(), clang::Sema::checkOpenCLDisabledDecl(), ConvertDeducedTemplateArgument(), clang::Sema::DiagnoseMisalignedMembers(), getBeginLoc(), getEndLoc(), and clang::UsingPackDecl::getSourceRange().
TranslationUnitDecl * Decl::getTranslationUnitDecl | ( | ) |
Definition at line 361 of file DeclBase.cpp.
References getDeclContext(), clang::DeclContext::getParent(), and clang::DeclContext::isTranslationUnit().
Referenced by clang::Sema::BuildModuleInclude(), clang::Sema::createImplicitModuleImportForErrorRecovery(), getASTContext(), getNonClosureContext(), getTranslationUnitDecl(), clang::ASTNodeImporter::VisitTemplateTypeParmDecl(), and clang::ASTNodeImporter::VisitTranslationUnitDecl().
|
inline |
Definition at line 448 of file DeclBase.h.
References getASTContext(), getTranslationUnitDecl(), isInAnonymousNamespace(), and isInStdNamespace().
VersionTuple Decl::getVersionIntroduced | ( | ) | const |
Retrieve the version of the target platform in which this declaration was introduced.
Definition at line 641 of file DeclBase.cpp.
Referenced by setOwningModuleID().
|
inline |
Definition at line 538 of file DeclBase.h.
References getAttrs(), getMaxAlignment(), hasAttrs(), and setInvalidDecl().
Referenced by clang::Sema::ActOnFinishNamespaceDef(), clang::Sema::ActOnOpenMPDeclareTargetName(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnStartCategoryImplementation(), clang::Sema::ActOnStartClassImplementation(), clang::Sema::ActOnStartOfObjCMethodDef(), clang::Sema::AddCFAuditedAttribute(), clang::ASTRecordWriter::AddFunctionDefinition(), clang::CodeGen::CodeGenModule::AddGlobalAnnotations(), clang::Sema::AddInitializerToDecl(), clang::Sema::AddOptnoneAttributeIfNoConflicts(), clang::Sema::AreMultipleMethodsInGlobalPool(), assignInheritanceModel(), AuditedType(), clang::Sema::BuildResolvedCallExpr(), clang::CodeGen::CGCXXABI::buildThisParam(), clang::Sema::ImplicitExceptionSpecification::CalledDecl(), canRedefineFunction(), clang::Sema::checkAllowedCUDAInitializer(), clang::Sema::CheckARCMethodDecl(), checkDeclInTargetContext(), clang::comments::Sema::checkDeprecatedCommand(), checkForIBOutlets(), clang::Sema::CheckMain(), CheckMoveOnConstruction(), clang::Sema::CheckObjCMethodOverride(), clang::Sema::CheckObjCPropertyAttributes(), clang::Sema::CheckOverrideControl(), clang::Sema::CheckTransparentUnionArgumentConstraints(), checkTypedefTypeForCapability(), checkValueDeclInTarget(), clang::Sema::CheckVirtualDtorCall(), computeKeyFunction(), clang::LinkageComputer::computeLVForDecl(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), clang::CodeGen::CodeGenModule::CreateFunctionTypeMetadataForIcall(), clang::Sema::CUDASetLambdaAttrs(), clang::DeclAttrsMatchCUDAMode(), clang::ASTContext::DeclMustBeEmitted(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), clang::Sema::DiagnoseOwningPropertyGetterSynthesis(), DiagnoseUninitializedUse(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::emitAutoVarTypeCleanup(), EmitAutoVarWithLifetime(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), clang::CodeGen::CodeGenFunction::EmitFieldAnnotations(), EmitFunctionDeclPointer(), clang::CodeGen::CodeGenModule::EmitGlobal(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::CodeGen::CodeGenVTables::EmitThunks(), clang::CodeGen::CodeGenFunction::EmitVarAnnotations(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), extractPBaseFlags(), clang::Sema::FinalizeDeclaration(), findProtocolsWithExplicitImpls(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), GetAllocationSite(), clang::ento::MemRegion::getAsOffset(), clang::ASTContext::getBlockVarCopyInits(), getCallingConventionForDecl(), clang::CodeGen::CodeGenModule::getClassPointerAlignment(), clang::ASTContext::getDeclAlign(), getDeclAlignIfRequired(), clang::CXXMethodDecl::getDevirtualizedMethod(), clang::getDLLAttr(), clang::CodeGen::CodeGenModule::GetGlobalVarAddressSpace(), clang::Sema::getImplicitCodeSegOrSectionAttrForFunction(), clang::CodeGen::CodeGenModule::getLLVMLinkageForDeclarator(), clang::LinkageComputer::getLVForDecl(), getMultiVersionType(), getNonNullAttrs(), clang::index::getSymbolInfo(), getTypeInfoLinkage(), clang::Sema::getUndefinedButUsed(), clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation(), hasDefaultCXXMethodCC(), hasDirectVisibilityAttribute(), clang::CodeGen::CodeGenModule::HasHiddenLTOVisibility(), hasObjCExceptionAttribute(), clang::Expr::HasSideEffects(), clang::Sema::IdentifyCUDATarget(), clang::Sema::InstantiateAttrs(), clang::Sema::InstantiateVariableInitializer(), clang::ObjCInterfaceDecl::isArcWeakrefUnavailable(), isBetterMultiversionCandidate(), isBlockVarRef(), isClassOrMethodDLLImport(), isGeneralizedObjectRef(), clang::Type::isIncompleteType(), isNoexcept(), isObjCReceiverType(), clang::ObjCInterfaceDecl::isObjCRequiresPropertyDefs(), clang::Sema::isOpenMPCapturedByRef(), isTestingFunction(), IsTransparentUnionStandardConversion(), clang::CodeGen::CodeGenModule::isTypeConstant(), isVarDeclStrongDefinition(), isVirtualCall(), isWeakLinkedClass(), LookThroughTransitiveAssignmentsAndCommaOperators(), clang::Sema::makeUnavailableInSystemHeader(), mangleThunkThisAdjustment(), clang::Sema::MarkFunctionReferenced(), clang::Sema::MatchTwoMethodDeclarations(), clang::Sema::maybeAddCUDAHostDeviceAttrs(), clang::CodeGen::CodeGenModule::maybeSetTrivialComdat(), clang::Sema::mergeAlwaysInlineAttr(), clang::Sema::mergeDLLExportAttr(), clang::Sema::mergeDLLImportAttr(), clang::Sema::mergeMinSizeAttr(), clang::Sema::mergeOptimizeNoneAttr(), clang::ASTContext::mergeTransparentUnionType(), clang::Sema::MergeVarDecl(), clang::Sema::NoteOverloadCandidate(), clang::ASTContext::ObjCMethodsAreEqual(), clang::consumed::ConsumedStateMap::operator!=(), clang::Sema::ProcessPropertyDecl(), RecordModifiableNonNullParam(), recordUsesEBO(), roundUpSizeToCharAlignment(), clang::ASTContext::setBlockVarCopyInits(), clang::CodeGen::CodeGenModule::SetCommonAttributes(), setCUDAKernelCallingConvention(), clang::CodeGen::CodeGenModule::setDLLImportDLLExport(), setLinkageForGV(), clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition(), shouldBeInCOMDAT(), shouldConsiderTemplateVisibility(), ShouldDiagnoseUnusedDecl(), shouldExtendReceiverForInnerPointerMessage(), clang::CodeGen::CodeGenFunction::ShouldInstrumentFunction(), clang::MangleContext::shouldMangleDeclName(), ShouldWarnAboutMissingPrototype(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), SuggestInitializationFixit(), useFirstFieldIfTransparentUnion(), useInlineVisibilityHidden(), and clang::Sema::WarnExactTypedMethods().
|
inline |
Definition at line 474 of file DeclBase.h.
Referenced by clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPUseDevicePtrClause(), addAttr(), attr_begin(), attr_end(), AttributesMatch(), clang::Sema::CheckAlignasUnderalignment(), clang::Sema::CheckVariableDeclarationType(), createPrivatesRecordDecl(), emitDeclTargetLinkVarDeclLValue(), getAttr(), getMaxAlignment(), getOrderedEnableIfAttrs(), hasAttr(), hasAttr(), clang::Sema::mergeAvailabilityAttr(), clang::MangleContext::shouldMangleDeclName(), clang::ASTDeclReader::UpdateDecl(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), 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 992 of file DeclBase.h.
References add(), EnableStatistics(), getBody(), getBodyRBrace(), isParameterPack(), isTemplateDecl(), isTemplateParameter(), isTemplateParameterPack(), and PrintStats().
Referenced by clang::CloneDetector::analyzeCodeBody(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), emitOutlinedFunctionPrologue(), generatePathDiagnosticsForNode(), clang::FunctionDecl::getBody(), hasImplicitBody(), clang::CallGraph::includeInGraph(), clang::ento::CheckerManager::runCheckersOnASTBody(), and seenBeforeRec().
|
inlineprotected |
Definition at line 399 of file DeclBase.h.
References CacheValidAndLinkage.
Referenced by clang::LinkageComputer::getLVForDecl().
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 471 of file DeclBase.cpp.
Referenced by isModulePrivate(), and clang::VarDecl::isThisDeclarationADefinition().
|
protected |
Definition at line 119 of file DeclBase.cpp.
References getASTContext(), clang::ASTContext::getLangOpts(), and clang::LangOptions::trackLocalOwningModule().
Referenced by getLocalOwningModule(), getOwningModuleID(), setLocalOwningModule(), and setModuleOwnershipKind().
|
inline |
Is this declaration owned by some module?
Definition at line 754 of file DeclBase.h.
References getModuleOwnershipKind(), and Unowned.
Referenced by getImportedOwningModule(), getLocalOwningModule(), setLexicalDeclContext(), and setLocalOwningModule().
|
inline |
Definition at line 809 of file DeclBase.h.
References getIdentifierNamespace(), and isTagIdentifierNamespace().
Referenced by clang::StoredDeclsList::AddSubsequentDecl(), and clang::VisibleDeclConsumer::includeHiddenDecls().
|
inline |
Whether this particular Decl is a canonical one.
Definition at line 883 of file DeclBase.h.
References getCanonicalDecl().
Referenced by clang::ASTContext::addOverriddenMethod(), clang::CXXMethodDecl::addOverriddenMethod(), clang::ClassTemplateDecl::AddPartialSpecialization(), clang::VarTemplateDecl::AddPartialSpecialization(), clang::NamedDecl::declarationReplaces(), getCanonicalDecl(), clang::ASTDeclWriter::VisitClassTemplateSpecializationDecl(), clang::ASTDeclReader::VisitClassTemplateSpecializationDeclImpl(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclReader::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitFunctionDecl(), clang::ASTDeclReader::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 855 of file DeclBase.h.
References getParentFunctionOrMethod(), and isLexicallyWithinFunctionOrMethod().
Referenced by clang::Sema::InstantiateClass(), clang::Sema::LookupInObjCMethod(), and LookupPotentialTypoResult().
|
inline |
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 671 of file DeclBase.h.
References clang::AR_Deprecated, and getAvailability().
Referenced by AuditedType(), and UseNSOptionsMacro().
bool Decl::isExported | ( | ) | const |
Whether this declaration is exported (by virtue of being lexically within an ExportDecl or by being a NamespaceDecl).
Definition at line 434 of file DeclBase.cpp.
References getLexicalDeclContext(), clang::DeclContext::getLexicalParent(), and isModulePrivate().
Referenced by isModulePrivate().
|
inline |
True if this is the first declaration in its redeclaration chain.
Definition at line 969 of file DeclBase.h.
References getPreviousDecl().
|
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 702 of file DeclBase.h.
References FromASTFile.
Referenced by clang::ASTContext::addedLocalImportDecl(), clang::ASTUnit::addFileLevelDecl(), clang::DeclContext::addHiddenDecl(), compareDeclarations(), clang::CodeGen::CGDebugInfo::completeUnusedClass(), clang::NamedDecl::declarationReplaces(), clang::ASTContext::DeclMustBeEmitted(), clang::ASTReader::forEachImportedKeyDecl(), getDeclForLocalLookup(), getDeclForMerging(), clang::ASTWriter::getDeclID(), clang::ASTWriter::GetDeclRef(), clang::Mergeable< UnresolvedUsingTypenameDecl >::getFirstDecl(), getGlobalID(), getImportedOwningModule(), clang::ASTReader::getKeyDeclaration(), getLocalOwningModule(), getOwningModule(), clang::ASTReader::getOwningModuleFile(), getOwningModuleID(), hasDefaultSetterName(), clang::Sema::hasVisibleMemberSpecialization(), clang::Sema::InstantiateFunctionDefinition(), isDefinedInClangModule(), isImportedDeclContext(), clang::ASTWriter::IsLocalDecl(), clang::ASTDeclWriter::RegisterTemplateSpecialization(), setLexicalDeclContext(), setLocalOwningModule(), setModuleOwnershipKind(), setOwningModuleID(), and clang::ASTDeclWriter::VisitNamespaceDecl().
|
inline |
Whether this declaration is a function or function template.
Definition at line 1018 of file DeclBase.h.
References getAsFunction(), and getDescribedTemplate().
Referenced by clang::VisibleDeclConsumer::includeHiddenDecls().
|
inline |
Determine whether this declaration might be hidden from name lookup.
Note that the declaration might be visible even if this returns false
, if the owning module is visible within the query context.
Definition at line 774 of file DeclBase.h.
References getModuleOwnershipKind(), and Visible.
Referenced by clang::Sema::hasVisibleMemberSpecialization(), isImportedDeclContext(), clang::LookupResult::isVisible(), clang::Sema::isVisible(), clang::ObjCProtocolDecl::lookupMethod(), clang::Sema::MatchTwoMethodDeclarations(), clang::ASTReader::mergeDefinitionVisibility(), NestedProtocolHasNoDefinition(), and setVisibleDespiteOwningModule().
|
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 554 of file DeclBase.h.
Referenced by clang::CodeGen::CodeGenPGO::assignRegionCounters(), AuditedType(), BuildImplicitMemberInitializer(), clang::Sema::buildOverloadedCallSet(), clang::Sema::CheckDestructor(), clang::Sema::checkInitializerLifetime(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitCopyConstructor(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), diagnoseDeprecatedCopyOperation(), clang::CXXRecordDecl::finishedDefaultedOrDeletedMember(), clang::ASTContext::getBuiltinVaListDecl(), clang::ASTContext::getRawCommentForDeclNoCache(), hasImplicitBody(), clang::Sema::IdentifyCUDATarget(), clang::index::IndexingContext::importedModule(), clang::index::IndexingContext::indexDecl(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), clang::FieldDecl::isAnonymousStructOrUnion(), isFunctionLocalClass(), isImportedDeclContext(), clang::RecordDecl::isInjectedClassName(), clang::diff::isSpecializedNodeExcluded(), isTrackedVar(), clang::CXXRecordDecl::isTriviallyCopyable(), clang::ODRHash::isWhitelistedDecl(), clang::ObjCInterfaceDecl::lookupMethod(), RedeclForcesDefC99(), clang::Sema::ShouldDeleteSpecialMember(), shouldReportOccurrenceForSystemDeclOnlyMode(), clang::RecursiveASTVisitor< CallGraph >::TraverseDecl(), clang::Sema::UseArgumentDependentLookup(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), clang::ASTDeclWriter::VisitVarDecl(), and clang::TemplateDeclInstantiator::VisitVarDecl().
bool Decl::isInAnonymousNamespace | ( | ) | const |
Definition at line 347 of file DeclBase.cpp.
References getDeclContext(), and clang::DeclContext::getParent().
Referenced by getExternalLinkageFor(), and getTranslationUnitDecl().
|
inline |
Definition at line 803 of file DeclBase.h.
References getIdentifierNamespace(), and getIdentifierNamespaceForKind().
Referenced by clang::LookupResult::getAcceptableDecl().
bool Decl::isInStdNamespace | ( | ) | const |
Definition at line 357 of file DeclBase.cpp.
References getDeclContext(), and clang::DeclContext::isStdNamespace().
Referenced by getTranslationUnitDecl(), clang::CallExpr::isCallToStdMove(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), IsStdFunction(), and IsStdString().
|
inline |
Definition at line 549 of file DeclBase.h.
Referenced by clang::Sema::ActOnCXXEnterDeclInitializer(), clang::Sema::ActOnCXXExitDeclInitializer(), clang::Sema::ActOnCXXTryBlock(), clang::Sema::ActOnFinishDelayedCXXMethodDeclaration(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnForEachDeclStmt(), clang::Sema::ActOnInitializerError(), clang::Sema::ActOnObjCAtCatchStmt(), clang::Sema::ActOnObjCForCollectionStmt(), clang::Sema::ActOnStartOfObjCMethodDef(), clang::Sema::AddInitializerToDecl(), clang::Sema::AddKnownFunctionAttributes(), adjustDeclContextForDeclaratorDecl(), AnalyzeBitFieldAssignment(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildDeclaratorGroup(), buildDeclareReductionRef(), BuildImplicitMemberInitializer(), clang::Sema::BuildMemberInitializer(), clang::Sema::BuildVarTemplateInstantiation(), canPassInRegisters(), clang::Sema::checkAllowedCUDAInitializer(), clang::Sema::CheckCompletedCoroutineBody(), clang::Sema::CheckCompletedCXXClass(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckConditionVariable(), CheckConstexprCtorInitializer(), CheckConstexprFunction(), clang::Sema::CheckConstructor(), clang::Sema::CheckCXXDefaultArguments(), CheckDeclInExpr(), clang::Sema::checkDeclIsAllowedInOpenMPTarget(), clang::Sema::checkInitMethod(), clang::Sema::CheckMessageArgumentTypes(), clang::Sema::CheckMSVCRTEntryPoint(), clang::Sema::CheckNontrivialField(), clang::Sema::CheckObjCPropertyAttributes(), clang::Sema::CheckOverrideControl(), clang::Sema::CheckPureMethod(), clang::Sema::CheckVariableDeclaration(), clang::Sema::CheckVariableDeclarationType(), CollectFieldInitializer(), ComputeDefaultedSpecialMemberExceptionSpec(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), clang::Sema::DeduceReturnType(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DeduceVariableDeclarationType(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitCopyConstructor(), clang::Sema::DefineImplicitDefaultConstructor(), clang::Sema::DefineImplicitDestructor(), clang::Sema::DefineImplicitLambdaToFunctionPointerConversion(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DefineImplicitMoveConstructor(), clang::Sema::DefineInheritingConstructor(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), clang::Sema::DiagnoseHiddenVirtualMethods(), DiagnoseReinterpretUpDownCast(), clang::Sema::DiagnoseUninstantiableTemplate(), clang::Sema::EndOpenMPDSABlock(), clang::Sema::FinalizeVarWithDestructor(), findCompleteObject(), clang::Sema::FindInstantiatedDecl(), clang::ASTContext::getASTRecordLayout(), getBodyRBrace(), clang::ASTContext::getCommentForDecl(), getContainedDynamicClass(), clang::ASTContext::getDeclAlign(), clang::NamedDecl::getExplicitVisibility(), clang::Sema::getUndefinedButUsed(), HandleClassZeroInitialization(), HandleLValueBase(), HandleLValueDirectBase(), HandleLValueMember(), clang::ASTContext::hasUniqueObjectRepresentations(), clang::Sema::InheritedConstructorInfo::InheritedConstructorInfo(), clang::Sema::InstantiateClass(), clang::Sema::InstantiateClassTemplateSpecialization(), clang::Sema::InstantiateEnum(), clang::Sema::InstantiateFunctionDefinition(), clang::Sema::InstantiateMemInitializers(), clang::Sema::InstantiateVariableDefinition(), clang::Sema::IsDerivedFrom(), isDesignatorAtObjectEnd(), clang::FunctionDecl::isImplicitlyInstantiable(), clang::CXXRecordDecl::isTriviallyCopyable(), clang::Sema::LookupInObjCMethod(), clang::Sema::LookupLiteralOperator(), LookupMemberExpr(), clang::CXXRecordDecl::mayBeAbstract(), clang::Sema::MergeVarDecl(), clang::Sema::MergeVarDeclTypes(), clang::Sema::PerformPendingInstantiations(), clang::Sema::PopParsingDeclaration(), clang::Sema::ProcessPropertyDecl(), clang::TreeTransform< Derived >::RebuildUnresolvedUsingType(), clang::Sema::SetDeclDefaulted(), clang::Sema::SetIvarInitializers(), clang::Sema::setTagNameForLinkagePurposes(), clang::Sema::ShouldDeleteSpecialMember(), ShouldDiagnoseUnusedDecl(), ShouldWarnAboutMissingPrototype(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), clang::Sema::SubstDecl(), clang::TemplateDeclInstantiator::SubstTemplateParams(), clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), TryRefInitWithConversionFunction(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), and clang::ASTDeclWriter::VisitVarDecl().
bool Decl::isLexicallyWithinFunctionOrMethod | ( | ) | const |
Returns true if this declaration lexically is inside a function.
It recognizes non-defining declarations as well as members of local classes:
Definition at line 335 of file DeclBase.cpp.
References getLexicalDeclContext(), clang::DeclContext::getLexicalParent(), and clang::DeclContext::isFunctionOrMethod().
Referenced by clang::TemplateDeclInstantiator::InitFunctionInstantiation(), isDefinedOutsideFunctionOrMethod(), and clang::Sema::SubstParmVarDecl().
|
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 1060 of file DeclBase.h.
References IDNS_LocalExtern.
Referenced by clang::Sema::BuildVariableInstantiation(), clang::Sema::HandleDelayedAccessCheck(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::TemplateDeclInstantiator::VisitVarDecl().
|
inline |
Whether this declaration was marked as being private to the module in which it was defined.
Definition at line 603 of file DeclBase.h.
References getDefiningAttr(), getModuleOwnershipKind(), hasDefiningAttr(), isExported(), and ModulePrivate.
Referenced by clang::Sema::hasVisibleMemberSpecialization(), isExported(), clang::NamedDecl::setDeclName(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), and clang::ASTDeclWriter::VisitVarDecl().
|
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.
Referenced by clang::Sema::ActOnCXXEnterDeclInitializer(), clang::Sema::ActOnCXXExitDeclInitializer(), checkDeclInTargetContext(), getLexicalDeclContext(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::VarDecl::isOutOfLine(), clang::FunctionDecl::isOutOfLine(), and clang::ASTDeclWriter::VisitDecl().
bool Decl::isParameterPack | ( | ) | const |
Whether this declaration is a parameter pack.
Definition at line 211 of file DeclBase.cpp.
References isTemplateParameterPack().
Referenced by hasBody(), and MatchTemplateParameterKind().
bool Decl::isReferenced | ( | ) | const |
Whether any declaration of this entity was referenced.
Definition at line 422 of file DeclBase.cpp.
Referenced by clang::Sema::BuildVariableInstantiation(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), setIsUsed(), ShouldDiagnoseUnusedDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), and clang::ASTDeclWriter::VisitVarDecl().
|
inlinestatic |
Definition at line 813 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 243 of file DeclBase.cpp.
References getDeclContext(), getDescribedTemplate(), getFriendObjectKind(), getLexicalDeclContext(), and isTemplateDecl().
Referenced by clang::CodeGen::CodeGenModule::EmitTopLevelDecl(), and getLexicalDeclContext().
bool Decl::isTemplateDecl | ( | ) | const |
returns true if this declaration is a template
Definition at line 226 of file DeclBase.cpp.
Referenced by hasBody(), and isTemplated().
|
inline |
isTemplateParameter - Determines whether this declaration is a template parameter.
Definition at line 1971 of file DeclBase.h.
References getKind().
Referenced by clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::DiagnoseTemplateParameterShadow(), hasBody(), clang::Sema::hasVisibleMemberSpecialization(), shouldBeHidden(), and clang::ASTDeclReader::VisitDecl().
bool Decl::isTemplateParameterPack | ( | ) | const |
isTemplateParameter - Determines whether this declaration is a template parameter pack.
Definition at line 201 of file DeclBase.cpp.
Referenced by checkLiteralOperatorTemplateParameterList(), hasBody(), isParameterPack(), MatchTemplateParameterKind(), clang::TemplateParameterList::TemplateParameterList(), and clang::ASTDeclReader::VisitDecl().
|
inline |
Whether this declaration was referenced.
This should not be relied upon for anything other than debugging.
Definition at line 582 of file DeclBase.h.
|
inline |
Whether this declaration is a top-level declaration (function, global variable, etc.) that is lexically inside an objc container definition.
Definition at line 589 of file DeclBase.h.
Referenced by clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), and clang::ASTDeclWriter::VisitVarDecl().
|
inline |
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 680 of file DeclBase.h.
References clang::AR_Unavailable, canBeWeakImported(), getAvailability(), and isWeakImported().
Referenced by clang::Sema::isFunctionConsideredUnavailable().
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 397 of file DeclBase.cpp.
References getCanonicalDecl(), and getMostRecentDecl().
Referenced by clang::Sema::BuildVariableInstantiation(), clang::CodeGen::CodeGenModule::EmitOMPDeclareReduction(), clang::Sema::MarkFunctionReferenced(), markUsed(), clang::Sema::MergeVarDecl(), PerformConstructorInitialization(), clang::CodeGen::CodeGenFunction::PushDestructorCleanup(), ShouldDiagnoseUnusedDecl(), ShouldRemoveFromUnused(), clang::Sema::ShouldWarnIfUnusedFileScopedDecl(), clang::updateFlags(), clang::ASTDeclWriter::VisitDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitRecordDecl(), and clang::ASTDeclWriter::VisitVarDecl().
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 685 of file DeclBase.cpp.
References clang::AR_NotYetIntroduced, attrs(), canBeWeakImported(), CheckAvailability(), and getASTContext().
Referenced by clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation(), isUnavailable(), isWeakLinkedClass(), 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 412 of file DeclBase.cpp.
References clang::ASTMutationListener::DeclarationMarkedUsed(), clang::ASTContext::getASTMutationListener(), isUsed(), and setIsUsed().
Referenced by clang::Sema::ActOnAddrLabel(), clang::Sema::ActOnGotoStmt(), clang::Sema::DefineImplicitCopyConstructor(), clang::Sema::DefineImplicitLambdaToFunctionPointerConversion(), clang::Sema::DefineImplicitMoveConstructor(), clang::Sema::GetOrCreateMSAsmLabel(), clang::Sema::MarkFunctionReferenced(), clang::MarkVarDeclODRUsed(), setIsUsed(), and clang::ASTDeclReader::UpdateDecl().
|
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 73 of file DeclBase.cpp.
|
protected |
Allocate memory for a non-deserialized declaration.
Definition at line 93 of file DeclBase.cpp.
References Parent.
void Decl::print | ( | raw_ostream & | Out, |
unsigned | Indentation = 0 , |
||
bool | PrintInstantiation = false |
||
) | const |
Definition at line 115 of file DeclPrinter.cpp.
Referenced by classofKind(), llvm::DOTGraphTraits< ExplodedNode * >::getNodeLabel(), clang::getParameterABISpelling(), isImplicitThis(), clang::PrettyStackTraceDecl::PrettyStackTraceDecl(), and print_block().
void Decl::print | ( | raw_ostream & | Out, |
const PrintingPolicy & | Policy, | ||
unsigned | Indentation = 0 , |
||
bool | PrintInstantiation = false |
||
) | const |
Definition at line 120 of file DeclPrinter.cpp.
|
static |
Definition at line 162 of file DeclPrinter.cpp.
References Begin, End, clang::PrintingPolicy::IncludeTagDefinition, and clang::PrintingPolicy::SuppressSpecifiers.
Referenced by classofKind().
|
static |
Definition at line 169 of file DeclBase.cpp.
Referenced by hasBody().
|
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 948 of file DeclBase.h.
References redecls_begin(), and redecls_end().
Referenced by compareDeclarations(), clang::Sema::DiagnoseOwningPropertyGetterSynthesis(), findAcceptableDecl(), and hasVisibleDeclarationImpl().
|
inline |
Definition at line 952 of file DeclBase.h.
Referenced by redecls().
|
inline |
Definition at line 956 of file DeclBase.h.
Referenced by redecls().
|
inline |
Definition at line 458 of file DeclBase.h.
References Access.
Referenced by clang::Sema::BuildVariableInstantiation(), captureThis(), clang::ASTContext::getBlockDescriptorExtendedType(), clang::ASTContext::getBlockDescriptorType(), clang::ASTContext::getCFConstantStringDecl(), clang::CodeGen::CodeGenModule::getObjCFastEnumerationStateType(), clang::TemplateDeclInstantiator::InitMethodInstantiation(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::Sema::MergeVarDecl(), setInvalidDecl(), clang::Sema::SetMemberAccessSpecifier(), clang::ASTDeclReader::VisitDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::TemplateDeclInstantiator::VisitVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
|
inline |
|
inlineprotected |
Definition at line 395 of file DeclBase.h.
References CacheValidAndLinkage.
Referenced by clang::LinkageComputer::getLVForDecl(), 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 295 of file DeclBase.cpp.
Referenced by adjustDeclContextForDeclaratorDecl(), getLexicalDeclContext(), clang::Sema::SubstParmVarDecl(), and clang::ASTDeclReader::VisitDecl().
Definition at line 555 of file DeclBase.h.
Referenced by clang::Sema::ActOnStartCategoryImplementation(), buildVarDecl(), captureThis(), clang::ImportDecl::CreateImplicit(), createMakeIntegerSeqParameterList(), clang::Sema::DeclareGlobalNewDelete(), clang::CodeGen::CodeGenFunction::EmitAndRegisterVariableArrayDimensions(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), clang::UsingShadowDecl::UsingShadowDecl(), and clang::ASTDeclReader::VisitDecl().
setInvalidDecl - Indicates the Decl had a semantic error.
This allows for graceful error recovery.
Definition at line 132 of file DeclBase.cpp.
References clang::AS_public, and setAccess().
Referenced by clang::Sema::ActOnBaseSpecifier(), clang::Sema::ActOnCapturedRegionError(), clang::Sema::ActOnCXXForRangeDecl(), clang::Sema::ActOnFinishCXXInClassMemberInitializer(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnForEachDeclStmt(), clang::Sema::ActOnInitializerError(), clang::Sema::ActOnLambdaError(), clang::Sema::ActOnOpenMPDeclareReductionDirectiveEnd(), clang::Sema::ActOnParamDefaultArgument(), clang::Sema::ActOnParamDefaultArgumentError(), clang::Sema::ActOnStartCategoryImplementation(), clang::Sema::ActOnStartCategoryInterface(), clang::Sema::ActOnStartClassImplementation(), clang::Sema::ActOnStartOfFunctionDef(), clang::Sema::ActOnStartOfObjCMethodDef(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildObjCExceptionDecl(), clang::Sema::checkAllowedCUDAInitializer(), clang::Sema::CheckCompletedCoroutineBody(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckConstructor(), clang::Sema::checkCUDATargetOverload(), clang::Sema::CheckCXXDefaultArgExpr(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckInheritingConstructorUsingDecl(), clang::Sema::checkInitMethod(), clang::Sema::CheckMain(), clang::Sema::CheckMSVCRTEntryPoint(), clang::Sema::CheckObjCDeclScope(), clang::Sema::CheckObjCPropertyAttributes(), clang::Sema::CheckOverrideControl(), clang::Sema::CheckRedeclarationModuleOwnership(), clang::Sema::CheckUsingShadowDecl(), clang::Sema::checkVarDeclRedefinition(), clang::Sema::DeduceVariableDeclarationType(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitCopyConstructor(), clang::Sema::DefineImplicitDefaultConstructor(), clang::Sema::DefineImplicitDestructor(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DefineImplicitMoveConstructor(), FinishForRangeVarDecl(), hasAttr(), clang::Sema::InheritedConstructorInfo::InheritedConstructorInfo(), clang::Sema::InstantiateClass(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::Sema::InstantiateFunctionDefinition(), clang::Sema::InstantiateInClassInitializer(), clang::Sema::InstantiateMemInitializers(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::Sema::InstantiateVariableInitializer(), clang::Sema::MergeVarDecl(), clang::Sema::SetDeclDeleted(), clang::Sema::SetParamDefaultArgument(), clang::Sema::SubstBaseSpecifiers(), clang::ASTDeclReader::VisitDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::TemplateDeclInstantiator::VisitVarDecl().
|
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 569 of file DeclBase.h.
References clang::C, getCanonicalDecl(), isReferenced(), and markUsed().
Referenced by clang::Sema::BuildVariableInstantiation(), markUsed(), clang::Sema::MergeVarDecl(), and clang::updateFlags().
void Decl::setLexicalDeclContext | ( | DeclContext * | DC | ) |
Definition at line 299 of file DeclBase.cpp.
References getASTContext(), getDeclContext(), getLexicalDeclContext(), getModuleOwnershipKind(), getOwningModule(), hasOwningModule(), isFromASTFile(), setLocalOwningModule(), setModuleOwnershipKind(), and VisibleWhenImported.
Referenced by clang::ObjCImplDecl::addClassMethod(), clang::ObjCImplDecl::addInstanceMethod(), adjustDeclContextForDeclaratorDecl(), clang::Sema::BuildLambdaExpr(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckImplementationIvars(), getLexicalDeclContext(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitEmptyDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), clang::ASTNodeImporter::VisitObjCCategoryImplDecl(), clang::ASTNodeImporter::VisitObjCImplementationDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::ASTNodeImporter::VisitStaticAssertDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
|
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 1042 of file DeclBase.h.
References getIdentifierNamespace(), getPreviousDecl(), IDNS_LocalExtern, IDNS_Ordinary, IDNS_OrdinaryFriend, and IDNS_Tag.
Referenced by clang::Sema::BuildVariableInstantiation(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::ASTDeclReader::VisitVarDeclImpl().
|
inline |
Definition at line 746 of file DeclBase.h.
References hasLocalOwningModuleStorage(), hasOwningModule(), and isFromASTFile().
Referenced by clang::Sema::CheckRedeclarationModuleOwnership(), and setLexicalDeclContext().
|
inline |
Definition at line 420 of file DeclBase.h.
Referenced by clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), 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 791 of file DeclBase.h.
References getModuleOwnershipKind(), hasLocalOwningModuleStorage(), isFromASTFile(), and Unowned.
Referenced by clang::Sema::ActOnStartOfTranslationUnit(), 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 621 of file DeclBase.h.
References getModuleOwnershipKind(), ModulePrivate, setModuleOwnershipKind(), and Unowned.
Referenced by clang::NamedDecl::setDeclName().
|
inline |
Specifies that this declaration is a C++ overloaded non-member.
Definition at line 1119 of file DeclBase.h.
References getKind(), IDNS_NonMemberOperator, and IDNS_Ordinary.
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 1071 of file DeclBase.h.
References getIdentifierNamespace(), getPreviousDecl(), IDNS_LocalExtern, IDNS_Ordinary, IDNS_OrdinaryFriend, IDNS_Tag, IDNS_TagFriend, and IDNS_Type.
Referenced by clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::ASTNodeImporter::VisitFriendDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
|
inlineprotected |
Set the owning module ID.
Definition at line 630 of file DeclBase.h.
References getAvailability(), getVersionIntroduced(), and isFromASTFile().
Referenced by clang::ASTDeclReader::VisitDecl().
Definition at line 584 of file DeclBase.h.
Referenced by clang::Sema::BuildVariableInstantiation(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::Sema::MarkAnyDeclReferenced(), clang::Sema::MarkFunctionReferenced(), and clang::ASTDeclReader::VisitDecl().
Definition at line 593 of file DeclBase.h.
References getExternalSourceSymbolAttr().
Referenced by clang::Sema::ActOnFinishObjCImplementation(), 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 780 of file DeclBase.h.
References isHidden(), setModuleOwnershipKind(), and Visible.
Referenced by clang::Sema::hasVisibleMemberSpecialization(), clang::Sema::InstantiateClass(), clang::Sema::InstantiateEnum(), clang::ASTContext::mergeDefinitionIntoModule(), clang::ASTReader::mergeDefinitionVisibility(), and clang::ASTDeclReader::VisitDecl().
|
inline |
Definition at line 525 of file DeclBase.h.
References attr_begin().
|
inline |
Definition at line 530 of file DeclBase.h.
References attr_end().
|
inline |
Definition at line 520 of file DeclBase.h.
Referenced by AttrFilter(), CheckNonNullArguments(), diagnoseDiagnoseIfAttrsWith(), clang::CodeGen::emitDeclareSimdFunction(), getNonNullAttr(), getNonNullAttrs(), getPrintfFormatArgumentNum(), hasRCAnnotation(), hasSameOverloadableAttrs(), isFunctionAlwaysEnabled(), clang::Sema::mergeFormatAttr(), clang::CodeGen::SanitizerMetadata::reportGlobalToASan(), and clang::CodeGen::CodeGenFunction::StartFunction().
|
protected |
Update a potentially out-of-date declaration.
Definition at line 63 of file DeclBase.cpp.
References getASTContext(), clang::ASTContext::getExternalSource(), and clang::ExternalASTSource::updateOutOfDateIdentifier().
Referenced by Decl(), and clang::TagDecl::getDefinition().
|
friend |
Definition at line 310 of file DeclBase.h.
|
friend |
Definition at line 311 of file DeclBase.h.
|
friend |
Definition at line 312 of file DeclBase.h.
|
friend |
Definition at line 313 of file DeclBase.h.
|
friend |
Definition at line 314 of file DeclBase.h.
|
friend |
Definition at line 242 of file DeclBase.h.
|
friend |
Definition at line 315 of file DeclBase.h.
|
friend |
Definition at line 316 of file DeclBase.h.
|
protected |
Access - Used by C++ decls for the access specifier.
Definition at line 320 of file DeclBase.h.
Referenced by getAccess(), getAccessUnsafe(), getBodyRBrace(), and setAccess().
|
mutableprotected |
If 0, we have not computed the linkage of this declaration.
Otherwise, it is the linkage + 1.
Definition at line 330 of file DeclBase.h.
Referenced by getCachedLinkage(), hasCachedLinkage(), and setCachedLinkage().
|
protected |
Whether this declaration was loaded from an AST file.
Definition at line 323 of file DeclBase.h.
Referenced by isFromASTFile(), and clang::ASTDeclReader::VisitDecl().
|
protected |
IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
Definition at line 326 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 two bits are used for the ModuleOwnershipKind.
Definition at line 239 of file DeclBase.h.
Referenced by clang::DeclContext::BuildDeclChain(), clang::DeclContext::containsDecl(), clang::DeclContext::isDeclInLexicalTraversal(), and clang::DeclContext::removeDecl().