clang API Documentation
#include <Decl.h>
Classes | |
class | ParmVarDeclBitfields |
class | VarDeclBitfields |
Public Types | |
enum | InitializationStyle { CInit, CallInit, ListInit } |
Initialization styles. More... | |
enum | TLSKind { TLS_None, TLS_Static, TLS_Dynamic } |
Kinds of thread-local storage. More... | |
enum | DefinitionKind { DeclarationOnly, TentativeDefinition, Definition } |
typedef redeclarable_base::redecl_range | redecl_range |
typedef redeclarable_base::redecl_iterator | redecl_iterator |
Public Member Functions | |
SourceRange | getSourceRange () const override LLVM_READONLY |
Source range that this declaration covers. | |
StorageClass | getStorageClass () const |
Returns the storage class as written in the source. For the computed linkage of symbol, see getLinkage. | |
void | setStorageClass (StorageClass SC) |
void | setTSCSpec (ThreadStorageClassSpecifier TSC) |
ThreadStorageClassSpecifier | getTSCSpec () const |
TLSKind | getTLSKind () const |
bool | hasLocalStorage () const |
bool | isStaticLocal () const |
bool | hasExternalStorage () const |
Returns true if a variable has extern or __private_extern__ storage. | |
bool | hasGlobalStorage () const |
Returns true for all variables that do not have local storage. | |
StorageDuration | getStorageDuration () const |
Get the storage duration of this variable, per C++ [basic.stc]. | |
LanguageLinkage | getLanguageLinkage () const |
Compute the language linkage. | |
bool | isExternC () const |
Determines whether this variable is a variable with external, C linkage. | |
bool | isInExternCContext () const |
Determines whether this variable's context is, or is nested within, a C++ extern "C" linkage spec. | |
bool | isInExternCXXContext () const |
Determines whether this variable's context is, or is nested within, a C++ extern "C++" linkage spec. | |
bool | isLocalVarDecl () const |
bool | isFunctionOrMethodVarDecl () const |
bool | isStaticDataMember () const |
Determines whether this is a static data member. | |
VarDecl * | getCanonicalDecl () override |
Retrieves the "canonical" declaration of the given declaration. | |
const VarDecl * | getCanonicalDecl () const |
DefinitionKind | isThisDeclarationADefinition (ASTContext &) const |
Check whether this declaration is a definition. If this could be a tentative definition (in C), don't check whether there's an overriding definition. | |
DefinitionKind | isThisDeclarationADefinition () const |
DefinitionKind | hasDefinition (ASTContext &) const |
Check whether this variable is defined in this translation unit. | |
DefinitionKind | hasDefinition () const |
VarDecl * | getActingDefinition () |
Get the tentative definition that acts as the real definition in a TU. Returns null if there is a proper definition available. | |
const VarDecl * | getActingDefinition () const |
VarDecl * | getDefinition (ASTContext &) |
Get the real (not just tentative) definition for this declaration. | |
const VarDecl * | getDefinition (ASTContext &C) const |
VarDecl * | getDefinition () |
const VarDecl * | getDefinition () const |
bool | isOutOfLine () const override |
Determine whether this is or was instantiated from an out-of-line definition of a static data member. | |
VarDecl * | getOutOfLineDefinition () |
If this is a static data member, find its out-of-line definition. | |
bool | isFileVarDecl () const |
isFileVarDecl - Returns true for file scoped variable declaration. | |
const Expr * | getAnyInitializer () const |
const Expr * | getAnyInitializer (const VarDecl *&D) const |
bool | hasInit () const |
const Expr * | getInit () const |
Expr * | getInit () |
Stmt ** | getInitAddress () |
Retrieve the address of the initializer expression. | |
void | setInit (Expr *I) |
bool | isUsableInConstantExpressions (ASTContext &C) const |
Determine whether this variable's value can be used in a constant expression, according to the relevant language standard. This only checks properties of the declaration, and does not check whether the initializer is in fact a constant expression. | |
EvaluatedStmt * | ensureEvaluatedStmt () const |
APValue * | evaluateValue () const |
Attempt to evaluate the value of the initializer attached to this declaration, and produce notes explaining why it cannot be evaluated or is not a constant expression. Returns a pointer to the value if evaluation succeeded, 0 otherwise. | |
APValue * | evaluateValue (SmallVectorImpl< PartialDiagnosticAt > &Notes) const |
APValue * | getEvaluatedValue () const |
Return the already-evaluated value of this variable's initializer, or NULL if the value is not yet known. Returns pointer to untyped APValue if the value could not be evaluated. | |
bool | isInitKnownICE () const |
Determines whether it is already known whether the initializer is an integral constant expression or not. | |
bool | isInitICE () const |
Determines whether the initializer is an integral constant expression, or in C++11, whether the initializer is a constant expression. | |
bool | checkInitIsICE () const |
Determine whether the value of the initializer attached to this declaration is an integral constant expression. | |
void | setInitStyle (InitializationStyle Style) |
InitializationStyle | getInitStyle () const |
The style of initialization for this declaration. | |
bool | isDirectInit () const |
Whether the initializer is a direct-initializer (list or call). | |
bool | isExceptionVariable () const |
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C @catch statement. | |
void | setExceptionVariable (bool EV) |
bool | isNRVOVariable () const |
Determine whether this local variable can be used with the named return value optimization (NRVO). | |
void | setNRVOVariable (bool NRVO) |
bool | isCXXForRangeDecl () const |
Determine whether this variable is the for-range-declaration in a C++0x for-range statement. | |
void | setCXXForRangeDecl (bool FRD) |
bool | isARCPseudoStrong () const |
Determine whether this variable is an ARC pseudo-__strong variable. A pseudo-__strong variable has a __strong-qualified type but does not actually retain the object written into it. Generally such variables are also 'const' for safety. | |
void | setARCPseudoStrong (bool ps) |
bool | isConstexpr () const |
Whether this variable is (C++11) constexpr. | |
void | setConstexpr (bool IC) |
bool | isInitCapture () const |
Whether this variable is the implicit variable for a lambda init-capture. | |
void | setInitCapture (bool IC) |
bool | isPreviousDeclInSameBlockScope () const |
void | setPreviousDeclInSameBlockScope (bool Same) |
VarDecl * | getInstantiatedFromStaticDataMember () const |
If this variable is an instantiated static data member of a class template specialization, returns the templated static data member from which it was instantiated. | |
TemplateSpecializationKind | getTemplateSpecializationKind () const |
If this variable is an instantiation of a variable template or a static data member of a class template, determine what kind of template specialization or instantiation this is. | |
SourceLocation | getPointOfInstantiation () const |
If this variable is an instantiation of a variable template or a static data member of a class template, determine its point of instantiation. | |
MemberSpecializationInfo * | getMemberSpecializationInfo () const |
If this variable is an instantiation of a static data member of a class template specialization, retrieves the member specialization information. | |
void | setTemplateSpecializationKind (TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation()) |
For a static data member that was instantiated from a static data member of a class template, set the template specialiation kind. | |
void | setInstantiationOfStaticDataMember (VarDecl *VD, TemplateSpecializationKind TSK) |
Specify that this variable is an instantiation of the static data member VD. | |
VarTemplateDecl * | getDescribedVarTemplate () const |
Retrieves the variable template that is described by this variable declaration. | |
void | setDescribedVarTemplate (VarTemplateDecl *Template) |
Static Public Member Functions | |
static const char * | getStorageClassSpecifierString (StorageClass SC) |
static VarDecl * | Create (ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S) |
static VarDecl * | CreateDeserialized (ASTContext &C, unsigned ID) |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
Protected Types | |
enum | { NumParameterIndexBits = 8 } |
typedef llvm::PointerUnion4 < Stmt *, EvaluatedStmt *, UnparsedDefaultArgument *, UninstantiatedDefaultArgument * > | InitType |
typedef Redeclarable< VarDecl > | redeclarable_base |
Protected Member Functions | |
VarDecl (Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass SC) | |
VarDecl * | getNextRedeclarationImpl () override |
Returns the next redeclaration or itself if this is the only decl. | |
VarDecl * | getPreviousDeclImpl () override |
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain. | |
VarDecl * | getMostRecentDeclImpl () override |
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chain. | |
Protected Attributes | |
InitType | Init |
The initializer for this variable or, for a ParmVarDecl, the C++ default argument. | |
union { | |
unsigned AllBits | |
VarDeclBitfields VarDeclBits | |
ParmVarDeclBitfields ParmVarDeclBits | |
}; | |
Friends | |
class | ASTDeclReader |
class | StmtIteratorBase |
class | ASTNodeImporter |
VarDecl - An instance of this class is created to represent a variable declaration or definition.
typedef llvm::PointerUnion4<Stmt *, EvaluatedStmt *, UnparsedDefaultArgument *, UninstantiatedDefaultArgument *> clang::VarDecl::InitType [protected] |
typedef redeclarable_base::redecl_iterator clang::VarDecl::redecl_iterator |
Reimplemented from clang::Redeclarable< VarDecl >.
typedef Redeclarable<VarDecl> clang::VarDecl::redeclarable_base [protected] |
VarDecl::VarDecl | ( | Kind | DK, |
ASTContext & | C, | ||
DeclContext * | DC, | ||
SourceLocation | StartLoc, | ||
SourceLocation | IdLoc, | ||
IdentifierInfo * | Id, | ||
QualType | T, | ||
TypeSourceInfo * | TInfo, | ||
StorageClass | SC | ||
) | [protected] |
Definition at line 1707 of file Decl.cpp.
References AllBits, clang::SrcMgr::static_assert(), and VarDeclBits.
Referenced by Create(), and CreateDeserialized().
bool VarDecl::checkInitIsICE | ( | ) | const |
Determine whether the value of the initializer attached to this declaration is an integral constant expression.
Definition at line 2086 of file Decl.cpp.
References clang::EvaluatedStmt::CheckedICE, clang::EvaluatedStmt::CheckingICE, ensureEvaluatedStmt(), evaluateValue(), clang::Decl::getASTContext(), clang::ASTContext::getLangOpts(), Init, clang::EvaluatedStmt::IsICE, clang::Expr::isIntegerConstantExpr(), clang::Expr::isValueDependent(), clang::ValueDecl::isWeak(), and clang::EvaluatedStmt::Value.
Referenced by clang::Sema::CheckCompleteVariableDeclaration(), CheckICE(), evaluateVarDeclInit(), and clang::IsVariableAConstantExpression().
static bool clang::VarDecl::classof | ( | const Decl * | D | ) | [inline, static] |
Reimplemented from clang::DeclaratorDecl.
Reimplemented in clang::VarTemplatePartialSpecializationDecl, clang::VarTemplateSpecializationDecl, clang::ParmVarDecl, and clang::ImplicitParamDecl.
Definition at line 1222 of file Decl.h.
References clang::Decl::getKind().
static bool clang::VarDecl::classofKind | ( | Kind | K | ) | [inline, static] |
Reimplemented from clang::DeclaratorDecl.
Reimplemented in clang::VarTemplatePartialSpecializationDecl, clang::VarTemplateSpecializationDecl, clang::ParmVarDecl, and clang::ImplicitParamDecl.
VarDecl * VarDecl::Create | ( | ASTContext & | C, |
DeclContext * | DC, | ||
SourceLocation | StartLoc, | ||
SourceLocation | IdLoc, | ||
IdentifierInfo * | Id, | ||
QualType | T, | ||
TypeSourceInfo * | TInfo, | ||
StorageClass | S | ||
) | [static] |
Definition at line 1722 of file Decl.cpp.
References AttributeLangSupport::C, and VarDecl().
Referenced by clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::ActOnVariableDeclarator(), addAsFieldToClosureType(), clang::Sema::BuildAnonymousStructOrUnion(), clang::Sema::BuildBlockForLambdaConversion(), clang::Sema::BuildExceptionDeclaration(), BuildImplicitMemberInitializer(), clang::Sema::BuildObjCExceptionDecl(), buildSingleCopyAssignRecursively(), BuildVarDecl(), clang::Sema::createLambdaInitCaptureVarDecl(), clang::Sema::DeclClonePragmaWeak(), clang::ASTNodeImporter::VisitVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
VarDecl * VarDecl::CreateDeserialized | ( | ASTContext & | C, |
unsigned | ID | ||
) | [static] |
Reimplemented in clang::VarTemplatePartialSpecializationDecl, clang::VarTemplateSpecializationDecl, clang::ParmVarDecl, and clang::ImplicitParamDecl.
Definition at line 1729 of file Decl.cpp.
References AttributeLangSupport::C, clang::SC_None, and VarDecl().
EvaluatedStmt * VarDecl::ensureEvaluatedStmt | ( | ) | const |
Convert the initializer for this declaration to the elaborated EvaluatedStmt form, which contains extra information on the evaluated value of the initializer.
Definition at line 2013 of file Decl.cpp.
References clang::Decl::getASTContext(), Init, and S.
Referenced by checkInitIsICE(), evaluateValue(), IsVariableNonDependentAndAConstantExpression(), VariableCanNeverBeAConstantExpression(), clang::ASTNodeImporter::VisitVarDecl(), and clang::ASTDeclReader::VisitVarDeclImpl().
APValue * VarDecl::evaluateValue | ( | ) | const |
Attempt to evaluate the value of the initializer attached to this declaration, and produce notes explaining why it cannot be evaluated or is not a constant expression. Returns a pointer to the value if evaluation succeeded, 0 otherwise.
Definition at line 2028 of file Decl.cpp.
Referenced by clang::Sema::CheckCompleteVariableDeclaration(), checkInitIsICE(), clang::CodeGen::CodeGenModule::EmitConstantInit(), and evaluateVarDeclInit().
APValue * VarDecl::evaluateValue | ( | SmallVectorImpl< PartialDiagnosticAt > & | Notes | ) | const |
Definition at line 2040 of file Decl.cpp.
References clang::ASTContext::AddDeallocation(), clang::EvaluatedStmt::CheckedICE, clang::frontend::CPlusPlus11, ensureEvaluatedStmt(), clang::Expr::EvaluateAsInitializer(), clang::EvaluatedStmt::Evaluated, clang::Decl::getASTContext(), Init, clang::EvaluatedStmt::IsEvaluating, clang::EvaluatedStmt::IsICE, clang::APValue::isUninit(), clang::Expr::isValueDependent(), clang::APValue::needsCleanup(), clang::EvaluatedStmt::Value, and clang::EvaluatedStmt::WasEvaluated.
Get the tentative definition that acts as the real definition in a TU. Returns null if there is a proper definition available.
Definition at line 1897 of file Decl.cpp.
References Definition, clang::Redeclarable< VarDecl >::getFirstDecl(), isThisDeclarationADefinition(), clang::Redeclarable< decl_type >::redecls(), and TentativeDefinition.
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), and getDefinition().
const VarDecl* clang::VarDecl::getActingDefinition | ( | ) | const [inline] |
const Expr* clang::VarDecl::getAnyInitializer | ( | ) | const [inline] |
getAnyInitializer - Get the initializer for this variable, no matter which declaration it is attached to.
Definition at line 1001 of file Decl.h.
Referenced by clang::Sema::AddInitializerToDecl(), clang::CodeGen::EmitOMPThreadPrivateVarDefinition(), evaluateVarDeclInit(), clang::ASTNodeImporter::ImportDefinition(), clang::Sema::InstantiateVariableInitializer(), clang::IsVariableAConstantExpression(), IsVariableNonDependentAndAConstantExpression(), and VariableCanNeverBeAConstantExpression().
const Expr * VarDecl::getAnyInitializer | ( | const VarDecl *& | D | ) | const |
getAnyInitializer - Get the initializer for this variable, no matter which declaration it is attached to. Also get that declaration.
Definition at line 1936 of file Decl.cpp.
References clang::Redeclarable< VarDecl >::redecls().
VarDecl * VarDecl::getCanonicalDecl | ( | ) | [override, virtual] |
Retrieves the "canonical" declaration of the given declaration.
Reimplemented from clang::Decl.
Definition at line 1823 of file Decl.cpp.
References clang::Redeclarable< VarDecl >::getFirstDecl().
Referenced by clang::Sema::ActOnOpenMPIdExpression(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), clang::VarTemplateDecl::findPartialSpecInstantiatedFromMember(), isInstantiationOfStaticDataMember(), clang::MarkVarDeclODRUsed(), and clang::Sema::MergeVarDecl().
const VarDecl* clang::VarDecl::getCanonicalDecl | ( | ) | const [inline] |
Reimplemented from clang::Decl.
VarDecl * VarDecl::getDefinition | ( | ASTContext & | C | ) |
Get the real (not just tentative) definition for this declaration.
Definition at line 1914 of file Decl.cpp.
References Definition, clang::Redeclarable< VarDecl >::getFirstDecl(), and clang::Redeclarable< decl_type >::redecls().
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), clang::Sema::ActOnOpenMPReductionClause(), clang::Sema::AddInitializerToDecl(), clang::CodeGen::EmitOMPThreadPrivateVarDefinition(), clang::Sema::FinalizeDeclaration(), findCompleteObject(), getDefinition(), clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation(), clang::ASTNodeImporter::ImportDefinition(), clang::Sema::InstantiateVariableDefinition(), clang::Sema::MergeVarDecl(), clang::Sema::RequireCompleteExprType(), ShouldRemoveFromUnused(), clang::ASTNodeImporter::VisitVarDecl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
const VarDecl* clang::VarDecl::getDefinition | ( | ASTContext & | C | ) | const [inline] |
Definition at line 967 of file Decl.h.
References getDefinition().
VarDecl* clang::VarDecl::getDefinition | ( | ) | [inline] |
Definition at line 970 of file Decl.h.
References getDefinition().
const VarDecl* clang::VarDecl::getDefinition | ( | ) | const [inline] |
Definition at line 973 of file Decl.h.
References getDefinition().
VarTemplateDecl * VarDecl::getDescribedVarTemplate | ( | ) | const |
Retrieves the variable template that is described by this variable declaration.
Every variable template is represented as a VarTemplateDecl and a VarDecl. The former contains template properties (such as the template parameter lists) while the latter contains the actual description of the template's contents. VarTemplateDecl::getTemplatedDecl() retrieves the VarDecl that from a VarTemplateDecl, while getDescribedVarTemplate() retrieves the VarTemplateDecl from a VarDecl.
Definition at line 2151 of file Decl.cpp.
References clang::Decl::getASTContext(), and clang::ASTContext::getTemplateOrSpecializationInfo().
Referenced by clang::Sema::ActOnVariableDeclarator(), clang::Sema::BuildVarTemplateInstantiation(), clang::Sema::FinalizeDeclaration(), clang::Sema::MergeVarDecl(), clang::ASTDeclWriter::VisitVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
APValue* clang::VarDecl::getEvaluatedValue | ( | ) | const [inline] |
Return the already-evaluated value of this variable's initializer, or NULL if the value is not yet known. Returns pointer to untyped APValue if the value could not be evaluated.
Definition at line 1072 of file Decl.h.
Referenced by evaluateVarDeclInit().
const Expr* clang::VarDecl::getInit | ( | ) | const [inline] |
Definition at line 1013 of file Decl.h.
References S.
Referenced by clang::Sema::ActOnOpenMPReductionClause(), clang::Sema::AddInitializerToDecl(), clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), clang::Sema::BuildCXXDefaultArgExpr(), clang::Sema::BuildDeclaratorGroup(), clang::Sema::buildInitCaptureField(), clang::Sema::CheckCompleteVariableDeclaration(), checkElementNonNil(), clang::ASTContext::DeclMustBeEmitted(), DiagnoseUninitializedUse(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), clang::CodeGen::CodeGenModule::EmitConstantInit(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), EmitDeclInit(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::CodeGen::CodeGenModule::EmitTentativeDefinition(), clang::Sema::FinalizeDeclaration(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(), clang::ParmVarDecl::getDefaultArg(), clang::ParmVarDecl::getDefaultArgRange(), clang::CXXForRangeStmt::getRangeInit(), getSelfInitExpr(), getSourceRange(), InitCatchParam(), clang::Sema::InstantiateVariableInitializer(), isVarDeclStrongDefinition(), maybeEmitZeroInitializationFixit(), clang::Sema::MergeCXXFunctionDecl(), SuggestInitializationFixit(), tryCaptureAsConstant(), clang::ento::ExprEngine::VisitDeclStmt(), clang::ento::FindLastStoreBRVisitor::VisitNode(), clang::ento::ExprEngine::VisitObjCForCollectionStmt(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitVarDecl(), and clang::consumed::ConsumedStmtVisitor::VisitVarDecl().
Expr* clang::VarDecl::getInit | ( | ) | [inline] |
Stmt** clang::VarDecl::getInitAddress | ( | ) | [inline] |
Retrieve the address of the initializer expression.
Definition at line 1038 of file Decl.h.
Referenced by clang::StmtIteratorBase::GetDeclExpr().
InitializationStyle clang::VarDecl::getInitStyle | ( | ) | const [inline] |
The style of initialization for this declaration.
C-style initialization is "int x = 1;". Call-style initialization is a C++98 direct-initializer, e.g. "int x(1);". The Init expression will be the expression inside the parens or a "ClassType(a,b,c)" class constructor expression for class types. List-style initialization is C++11 syntax, e.g. "int x{1};". Clients can distinguish between different forms of initialization by checking this value. In particular, "int x = {1};" is C-style, "int x({1})" is call-style, and "int x{1};" is list-style; the Init expression in all three cases is an InitListExpr.
Definition at line 1118 of file Decl.h.
Referenced by clang::Sema::BuildVariableInstantiation(), clang::Sema::InstantiateVariableInitializer(), clang::ASTDeclWriter::VisitParmVarDecl(), and clang::ASTDeclWriter::VisitVarDecl().
VarDecl * VarDecl::getInstantiatedFromStaticDataMember | ( | ) | const |
If this variable is an instantiated static data member of a class template specialization, returns the templated static data member from which it was instantiated.
Definition at line 2122 of file Decl.cpp.
References getMemberSpecializationInfo().
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::CheckMemberSpecialization(), getExplicitVisibilityAux(), clang::Sema::InstantiateClassMembers(), clang::Sema::InstantiateVariableDefinition(), isInstantiationOfStaticDataMember(), and isOutOfLine().
LanguageLinkage VarDecl::getLanguageLinkage | ( | ) | const |
Compute the language linkage.
Definition at line 1807 of file Decl.cpp.
References getDeclLanguageLinkage().
If this variable is an instantiation of a static data member of a class template specialization, retrieves the member specialization information.
Definition at line 2160 of file Decl.cpp.
References clang::Decl::getASTContext(), clang::ASTContext::getTemplateOrSpecializationInfo(), and isStaticDataMember().
Referenced by clang::Sema::CheckMemberSpecialization(), getInstantiatedFromStaticDataMember(), getPointOfInstantiation(), getTemplateSpecializationKind(), clang::Sema::InstantiateClassMembers(), setTemplateSpecializationKind(), clang::ASTWriter::StaticDataMemberInstantiated(), and clang::ASTDeclWriter::VisitVarDecl().
VarDecl* clang::VarDecl::getMostRecentDeclImpl | ( | ) | [inline, override, protected, virtual] |
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chain.
Reimplemented from clang::Decl.
VarDecl* clang::VarDecl::getNextRedeclarationImpl | ( | ) | [inline, override, protected, virtual] |
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 from clang::Decl.
If this is a static data member, find its out-of-line definition.
Definition at line 1962 of file Decl.cpp.
References isStaticDataMember(), and clang::Redeclarable< VarDecl >::redecls().
Referenced by clang::Sema::InstantiateClassMembers().
If this variable is an instantiation of a variable template or a static data member of a class template, determine its point of instantiation.
Reimplemented in clang::VarTemplateSpecializationDecl.
Definition at line 2140 of file Decl.cpp.
References getMemberSpecializationInfo().
Referenced by clang::Sema::ActOnExplicitInstantiation(), DoMarkVarDeclReferenced(), and clang::Sema::InstantiateVariableDefinition().
VarDecl* clang::VarDecl::getPreviousDeclImpl | ( | ) | [inline, override, protected, virtual] |
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
Reimplemented from clang::Decl.
SourceRange VarDecl::getSourceRange | ( | ) | const [override, virtual] |
Source range that this declaration covers.
Reimplemented from clang::DeclaratorDecl.
Reimplemented in clang::ParmVarDecl.
Definition at line 1755 of file Decl.cpp.
References getInit(), clang::Decl::getLocation(), clang::DeclaratorDecl::getOuterLocStart(), Init, and clang::SourceLocation::isValid().
Referenced by clang::Sema::AddInitializerToDecl(), clang::Sema::CheckConditionVariable(), clang::Sema::checkRetainCycles(), DiagUninitUse(), clang::IfStmt::setConditionVariable(), clang::SwitchStmt::setConditionVariable(), clang::WhileStmt::setConditionVariable(), and clang::ForStmt::setConditionVariable().
StorageClass clang::VarDecl::getStorageClass | ( | ) | const [inline] |
Returns the storage class as written in the source. For the computed linkage of symbol, see getLinkage.
Definition at line 821 of file Decl.h.
Referenced by clang::Sema::ActOnCXXForRangeDecl(), clang::Sema::ActOnVariableDeclarator(), addFunctionPointerConversion(), clang::Sema::AddInitializerToDecl(), AddVariableConstraints(), clang::Sema::BuildBlockForLambdaConversion(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), clang::Sema::MergeVarDecl(), clang::Sema::SubstParmVarDecl(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), clang::ASTDeclWriter::VisitParmVarDecl(), clang::ASTNodeImporter::VisitParmVarDecl(), clang::ASTDeclWriter::VisitVarDecl(), clang::ASTNodeImporter::VisitVarDecl(), clang::ASTDeclReader::VisitVarDeclImpl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
const char * VarDecl::getStorageClassSpecifierString | ( | StorageClass | SC | ) | [static] |
getStorageClassSpecifierString - Return the string used to specify the storage class SC
.
It is illegal to call this function with SC == None.
Definition at line 1693 of file Decl.cpp.
References clang::SC_Auto, clang::SC_Extern, clang::SC_None, clang::SC_OpenCLWorkGroupLocal, clang::SC_PrivateExtern, clang::SC_Register, and clang::SC_Static.
StorageDuration clang::VarDecl::getStorageDuration | ( | ) | const [inline] |
Get the storage duration of this variable, per C++ [basic.stc].
Definition at line 875 of file Decl.h.
References clang::SD_Automatic, clang::SD_Static, and clang::SD_Thread.
If this variable is an instantiation of a variable template or a static data member of a class template, determine what kind of template specialization or instantiation this is.
Definition at line 2129 of file Decl.cpp.
References getMemberSpecializationInfo(), and clang::TSK_Undeclared.
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::AddInitializerToDecl(), basicGVALinkageForVariable(), clang::Sema::CheckMemberSpecialization(), clang::Sema::CheckVarTemplateId(), DoMarkVarDeclReferenced(), clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation(), clang::Sema::InstantiateVariableDefinition(), clang::VarTemplateSpecializationDecl::isExplicitInstantiationOrSpecialization(), isThisDeclarationADefinition(), and clang::Sema::PerformPendingInstantiations().
VarDecl::TLSKind VarDecl::getTLSKind | ( | ) | const |
Definition at line 1740 of file Decl.cpp.
References TLS_Dynamic, TLS_None, TLS_Static, clang::TSCS___thread, clang::TSCS__Thread_local, clang::TSCS_thread_local, clang::TSCS_unspecified, and VarDeclBits.
Referenced by clang::Sema::CheckCompleteVariableDeclaration(), EmitDeclDestroy(), EmitDeclInit(), EmitGlobalVarDeclLValue(), clang::Sema::FinalizeDeclaration(), isThreadWrapperReplaceable(), isVarDeclStrongDefinition(), clang::Sema::MergeVarDecl(), and clang::CodeGen::CodeGenModule::setTLSMode().
ThreadStorageClassSpecifier clang::VarDecl::getTSCSpec | ( | ) | const [inline] |
Definition at line 830 of file Decl.h.
Referenced by clang::Sema::BuildVariableInstantiation(), handleDeclspecThreadAttr(), clang::ASTDeclWriter::VisitParmVarDecl(), and clang::ASTDeclWriter::VisitVarDecl().
VarDecl::DefinitionKind VarDecl::hasDefinition | ( | ASTContext & | C | ) | const |
Check whether this variable is defined in this translation unit.
Definition at line 1923 of file Decl.cpp.
References DeclarationOnly, Definition, clang::Redeclarable< VarDecl >::getFirstDecl(), and clang::Redeclarable< decl_type >::redecls().
Referenced by clang::MarkVarDeclODRUsed().
DefinitionKind clang::VarDecl::hasDefinition | ( | ) | const [inline] |
bool clang::VarDecl::hasExternalStorage | ( | ) | const [inline] |
Returns true if a variable has extern or __private_extern__ storage.
Definition at line 863 of file Decl.h.
References clang::SC_Extern, and clang::SC_PrivateExtern.
Referenced by clang::Sema::ActOnVariableDeclarator(), clang::Sema::AddInitializerToDecl(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), isThisDeclarationADefinition(), isVarDeclStrongDefinition(), clang::Sema::MergeVarDecl(), and shouldConsiderLinkage().
bool clang::VarDecl::hasGlobalStorage | ( | ) | const [inline] |
Returns true for all variables that do not have local storage.
This includes all global variables as well as static variables declared within a function.
Definition at line 872 of file Decl.h.
Referenced by clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckShadow(), clang::Sema::CheckVariableDeclarationType(), EmitDeclInit(), clang::Sema::FinalizeVarWithDestructor(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalVar(), clang::ento::MemRegionManager::getVarRegion(), isAlwaysAlive(), and isTrackedVar().
bool clang::VarDecl::hasInit | ( | ) | const [inline] |
Definition at line 1010 of file Decl.h.
Referenced by clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::InstantiateVariableDefinition(), clang::ASTContext::isMSStaticDataMemberInlineDefinition(), isThisDeclarationADefinition(), clang::MarkVarDeclODRUsed(), and clang::consumed::ConsumedStmtVisitor::VisitVarDecl().
bool clang::VarDecl::hasLocalStorage | ( | ) | const [inline] |
hasLocalStorage - Returns true if a variable with function scope is a non-static local variable.
Definition at line 837 of file Decl.h.
References clang::SC_Auto, clang::SC_None, clang::SC_Register, and clang::TSCS_unspecified.
Referenced by clang::Sema::ActOnForStmt(), clang::Sema::ActOnObjCForCollectionStmt(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::AddInitializerToDecl(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::CodeCompleteLambdaIntroducer(), DoMarkVarDeclReferenced(), clang::CodeGen::CodeGenModule::EmitConstantInit(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::Expr::EvaluateAsInitializer(), clang::ento::MemRegionManager::getVarRegion(), handleCleanupAttr(), handleDeclspecThreadAttr(), clang::Sema::isCopyElisionCandidate(), isInitializationOfVar(), isInvalidICRSource(), clang::PseudoConstantAnalysis::isPseudoConstant(), isReferenceToNonConstCapture(), shouldExtendReceiverForInnerPointerMessage(), and clang::Sema::tryCaptureVariable().
bool clang::VarDecl::isARCPseudoStrong | ( | ) | const [inline] |
Determine whether this variable is an ARC pseudo-__strong variable. A pseudo-__strong variable has a __strong-qualified type but does not actually retain the object written into it. Generally such variables are also 'const' for safety.
Definition at line 1156 of file Decl.h.
Referenced by CheckForModifiableLvalue(), clang::CodeGen::CodeGenFunction::emitAutoVarTypeCleanup(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), and clang::ASTDeclWriter::VisitVarDecl().
bool clang::VarDecl::isConstexpr | ( | ) | const [inline] |
Whether this variable is (C++11) constexpr.
Definition at line 1160 of file Decl.h.
Referenced by clang::Sema::ActOnCXXForRangeDecl(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckVariableDeclarationType(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), findCompleteObject(), isUsableInConstantExpressions(), and clang::ASTDeclWriter::VisitVarDecl().
bool clang::VarDecl::isCXXForRangeDecl | ( | ) | const [inline] |
Determine whether this variable is the for-range-declaration in a C++0x for-range statement.
Definition at line 1149 of file Decl.h.
Referenced by clang::Sema::BuildVariableInstantiation(), clang::Sema::InstantiateVariableInitializer(), and clang::ASTDeclWriter::VisitVarDecl().
bool clang::VarDecl::isDirectInit | ( | ) | const [inline] |
Whether the initializer is a direct-initializer (list or call).
Definition at line 1123 of file Decl.h.
Referenced by clang::Sema::InstantiateVariableInitializer().
bool clang::VarDecl::isExceptionVariable | ( | ) | const [inline] |
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C @catch statement.
Definition at line 1129 of file Decl.h.
Referenced by clang::Sema::isCopyElisionCandidate(), isTrackedVar(), clang::ASTDeclWriter::VisitParmVarDecl(), and clang::ASTDeclWriter::VisitVarDecl().
bool VarDecl::isExternC | ( | ) | const |
Determines whether this variable is a variable with external, C linkage.
Definition at line 1811 of file Decl.cpp.
References isDeclExternC().
Referenced by clang::Sema::AddInitializerToDecl().
bool clang::VarDecl::isFileVarDecl | ( | ) | const [inline] |
isFileVarDecl - Returns true for file scoped variable declaration.
Definition at line 985 of file Decl.h.
References getKind(), and isStaticDataMember().
Referenced by clang::Sema::AddInitializerToDecl(), clang::Sema::CheckVariableDeclarationType(), clang::ASTContext::DeclMustBeEmitted(), clang::Sema::FinalizeDeclaration(), isThisDeclarationADefinition(), clang::Sema::MergeVarDecl(), ReportOriginalDSA(), and clang::ASTNodeImporter::VisitVarDecl().
bool clang::VarDecl::isFunctionOrMethodVarDecl | ( | ) | const [inline] |
isFunctionOrMethodVarDecl - Similar to isLocalVarDecl, but excludes variables declared in blocks.
Definition at line 911 of file Decl.h.
References clang::DeclContext::getDeclKind(), getKind(), clang::DeclContext::getRedeclContext(), and clang::DeclContext::isFunctionOrMethod().
bool VarDecl::isInExternCContext | ( | ) | const |
Determines whether this variable's context is, or is nested within, a C++ extern "C" linkage spec.
Definition at line 1815 of file Decl.cpp.
References clang::Decl::getLexicalDeclContext(), and clang::DeclContext::isExternCContext().
bool VarDecl::isInExternCXXContext | ( | ) | const |
Determines whether this variable's context is, or is nested within, a C++ extern "C++" linkage spec.
Definition at line 1819 of file Decl.cpp.
References clang::Decl::getLexicalDeclContext(), and clang::DeclContext::isExternCXXContext().
bool clang::VarDecl::isInitCapture | ( | ) | const [inline] |
Whether this variable is the implicit variable for a lambda init-capture.
Definition at line 1164 of file Decl.h.
Referenced by clang::Sema::AddInitializerToDecl(), clang::Sema::BuildVariableInstantiation(), clang::Sema::DiagnoseAutoDeductionFailure(), clang::LambdaCapture::isInitCapture(), isReferenceToNonConstCapture(), isTrackedVar(), RebuildLambdaScopeInfo(), clang::Sema::tryCaptureVariable(), and clang::ASTDeclWriter::VisitVarDecl().
bool clang::VarDecl::isInitICE | ( | ) | const [inline] |
Determines whether the initializer is an integral constant expression, or in C++11, whether the initializer is a constant expression.
Definition at line 1094 of file Decl.h.
Referenced by clang::Sema::CheckCompleteVariableDeclaration(), and clang::ASTDeclWriter::VisitVarDecl().
bool clang::VarDecl::isInitKnownICE | ( | ) | const [inline] |
Determines whether it is already known whether the initializer is an integral constant expression or not.
Definition at line 1082 of file Decl.h.
Referenced by clang::ASTDeclWriter::VisitVarDecl().
bool clang::VarDecl::isLocalVarDecl | ( | ) | const [inline] |
isLocalVarDecl - Returns true for local variable declarations other than parameters. Note that this includes static variables inside of functions. It also includes variables inside blocks.
void foo() { int x; static int y; extern int z; }
Definition at line 901 of file Decl.h.
References getKind().
Referenced by clang::Sema::ActOnForStmt(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::AddInitializerToDecl(), clang::CodeGen::CodeGenFunction::OMPPrivateScope::addPrivate(), clang::CodeGen::CodeGenFunction::EmitDecl(), isTrackedVar(), clang::Sema::MergeVarDecl(), clang::Sema::MergeVarDeclTypes(), and ReportOriginalDSA().
bool clang::VarDecl::isNRVOVariable | ( | ) | const [inline] |
Determine whether this local variable can be used with the named return value optimization (NRVO).
The named return value optimization (NRVO) works by marking certain non-volatile local variables of class type as NRVO objects. These locals can be allocated within the return slot of their containing function, in which case there is no need to copy the object to the return slot when returning from the function. Within the function body, each return that returns the NRVO object will have this variable as its NRVO candidate.
Definition at line 1144 of file Decl.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitReturnStmt(), and clang::ASTDeclWriter::VisitVarDecl().
bool VarDecl::isOutOfLine | ( | ) | const [override, virtual] |
Determine whether this is or was instantiated from an out-of-line definition of a static data member.
Reimplemented from clang::Decl.
Definition at line 1946 of file Decl.cpp.
References getInstantiatedFromStaticDataMember(), clang::Decl::isOutOfLine(), and isStaticDataMember().
Referenced by clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::BuildVariableInstantiation(), clang::Sema::FinalizeDeclaration(), clang::Sema::InstantiateVariableInitializer(), clang::ASTContext::isMSStaticDataMemberInlineDefinition(), isThisDeclarationADefinition(), and clang::Sema::MergeVarDecl().
bool clang::VarDecl::isPreviousDeclInSameBlockScope | ( | ) | const [inline] |
Whether this local extern variable declaration's previous declaration was declared in the same block scope. Only correct in C++.
Definition at line 1169 of file Decl.h.
Referenced by clang::Sema::BuildVariableInstantiation(), mergeTypeWithPrevious(), and clang::ASTDeclWriter::VisitVarDecl().
bool clang::VarDecl::isStaticDataMember | ( | ) | const [inline] |
Determines whether this is a static data member.
This will only be true in C++, and applies to, e.g., the variable 'x' in:
struct S { static int x; };
Definition at line 927 of file Decl.h.
References getKind().
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckMemberSpecialization(), clang::Sema::FinalizeDeclaration(), clang::ASTContext::getInstantiatedFromStaticDataMember(), getMemberSpecializationInfo(), getOutOfLineDefinition(), clang::Sema::InstantiateClassMembers(), clang::Sema::InstantiateVariableDefinition(), clang::Sema::InstantiateVariableInitializer(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), isInstantiationOf(), isInstantiationOfStaticDataMember(), clang::ASTContext::isMSStaticDataMemberInlineDefinition(), isOutOfLine(), isThisDeclarationADefinition(), clang::MarkVarDeclODRUsed(), clang::Sema::MergeVarDecl(), clang::Sema::PerformPendingInstantiations(), ReportOriginalDSA(), clang::ASTContext::setInstantiatedFromStaticDataMember(), and clang::ASTDeclWriter::VisitParmVarDecl().
bool clang::VarDecl::isStaticLocal | ( | ) | const [inline] |
isStaticLocal - Returns true if a variable with function scope is a static local variable.
Definition at line 854 of file Decl.h.
References clang::SC_None, clang::SC_Static, and clang::TSCS_thread_local.
Referenced by clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnVariableDeclarator(), basicGVALinkageForVariable(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckVariableDeclarationType(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::Sema::FinalizeDeclaration(), clang::Sema::FinalizeVarWithDestructor(), clang::ento::MemRegionManager::getVarRegion(), isInitializationOfVar(), clang::PseudoConstantAnalysis::isPseudoConstant(), isThreadWrapperReplaceable(), and ReportOriginalDSA().
Check whether this declaration is a definition. If this could be a tentative definition (in C), don't check whether there's an overriding definition.
Definition at line 1825 of file Decl.cpp.
References DeclarationOnly, Definition, clang::Redeclarable< VarDecl >::getFirstDecl(), clang::ASTContext::getLangOpts(), getTemplateSpecializationKind(), hasExternalStorage(), hasInit(), isFileVarDecl(), isOutOfLine(), isSingleLineLanguageLinkage(), isStaticDataMember(), TentativeDefinition, clang::TSK_ExplicitSpecialization, and clang::TSK_Undeclared.
Referenced by clang::Sema::ActOnOpenMPAlignedClause(), clang::Sema::ActOnOpenMPCopyinClause(), clang::Sema::ActOnOpenMPCopyprivateClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnOpenMPLastprivateClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::CheckVariableDeclarationType(), clang::ASTContext::DeclMustBeEmitted(), clang::Sema::FinalizeDeclaration(), clang::VarTemplateDecl::isThisDeclarationADefinition(), clang::Sema::MergeVarDecl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
DefinitionKind clang::VarDecl::isThisDeclarationADefinition | ( | ) | const [inline] |
Definition at line 947 of file Decl.h.
Referenced by getActingDefinition().
bool VarDecl::isUsableInConstantExpressions | ( | ASTContext & | C | ) | const |
Determine whether this variable's value can be used in a constant expression, according to the relevant language standard. This only checks properties of the declaration, and does not check whether the initializer is in fact a constant expression.
Definition at line 1983 of file Decl.cpp.
References clang::ASTContext::getLangOpts(), clang::ValueDecl::getType(), and isConstexpr().
Referenced by clang::Sema::CheckCompleteVariableDeclaration(), DoMarkVarDeclReferenced(), and clang::IsVariableAConstantExpression().
void clang::VarDecl::setARCPseudoStrong | ( | bool | ps | ) | [inline] |
Definition at line 1157 of file Decl.h.
Referenced by clang::Sema::ActOnForEachDeclStmt().
void clang::VarDecl::setConstexpr | ( | bool | IC | ) | [inline] |
Definition at line 1161 of file Decl.h.
Referenced by clang::Sema::ActOnVariableDeclarator(), clang::Sema::AddInitializerToDecl(), and clang::Sema::BuildVariableInstantiation().
void clang::VarDecl::setCXXForRangeDecl | ( | bool | FRD | ) | [inline] |
Definition at line 1150 of file Decl.h.
Referenced by clang::Sema::ActOnCXXForRangeDecl(), and clang::Sema::BuildVariableInstantiation().
void VarDecl::setDescribedVarTemplate | ( | VarTemplateDecl * | Template | ) |
Definition at line 2156 of file Decl.cpp.
References clang::Decl::getASTContext(), and clang::ASTContext::setTemplateOrSpecializationInfo().
Referenced by clang::Sema::ActOnVariableDeclarator(), clang::ASTDeclReader::VisitVarDeclImpl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
void clang::VarDecl::setExceptionVariable | ( | bool | EV | ) | [inline] |
Definition at line 1132 of file Decl.h.
Referenced by clang::Sema::BuildExceptionDeclaration(), and clang::Sema::BuildObjCExceptionDecl().
void VarDecl::setInit | ( | Expr * | I | ) |
Definition at line 1974 of file Decl.cpp.
References clang::ASTContext::Deallocate(), clang::Decl::getASTContext(), and Init.
Referenced by clang::Sema::ActOnForEachDeclStmt(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildExceptionDeclaration(), buildSingleCopyAssignRecursively(), clang::Sema::createLambdaInitCaptureVarDecl(), clang::ASTNodeImporter::ImportDefinition(), clang::ASTNodeImporter::VisitVarDecl(), and clang::ASTDeclReader::VisitVarDeclImpl().
void clang::VarDecl::setInitCapture | ( | bool | IC | ) | [inline] |
Definition at line 1165 of file Decl.h.
Referenced by clang::Sema::BuildVariableInstantiation(), and clang::Sema::createLambdaInitCaptureVarDecl().
void clang::VarDecl::setInitStyle | ( | InitializationStyle | Style | ) | [inline] |
Definition at line 1104 of file Decl.h.
References Style.
Referenced by clang::Sema::AddInitializerToDecl(), and clang::Sema::BuildVariableInstantiation().
void VarDecl::setInstantiationOfStaticDataMember | ( | VarDecl * | VD, |
TemplateSpecializationKind | TSK | ||
) |
Specify that this variable is an instantiation of the static data member VD.
Definition at line 2192 of file Decl.cpp.
References clang::Decl::getASTContext(), and clang::ASTContext::setInstantiatedFromStaticDataMember().
Referenced by clang::Sema::ActOnVarTemplateSpecialization(), and clang::Sema::BuildVariableInstantiation().
void clang::VarDecl::setNRVOVariable | ( | bool | NRVO | ) | [inline] |
void clang::VarDecl::setPreviousDeclInSameBlockScope | ( | bool | Same | ) | [inline] |
Definition at line 1172 of file Decl.h.
Referenced by clang::Sema::ActOnVariableDeclarator(), and clang::Sema::BuildVariableInstantiation().
void VarDecl::setStorageClass | ( | StorageClass | SC | ) |
Definition at line 1735 of file Decl.cpp.
References clang::isLegalForVariable(), and VarDeclBits.
Referenced by clang::Sema::ActOnVariableDeclarator().
void VarDecl::setTemplateSpecializationKind | ( | TemplateSpecializationKind | TSK, |
SourceLocation | PointOfInstantiation = SourceLocation() |
||
) |
For a static data member that was instantiated from a static data member of a class template, set the template specialiation kind.
Definition at line 2169 of file Decl.cpp.
References getMemberSpecializationInfo(), clang::SourceLocation::isValid(), and clang::TSK_ExplicitSpecialization.
Referenced by clang::Sema::CheckMemberSpecialization(), clang::Sema::CheckVarTemplateId(), DoMarkVarDeclReferenced(), clang::Sema::InstantiateClassMembers(), and clang::Sema::InstantiateVariableDefinition().
void clang::VarDecl::setTSCSpec | ( | ThreadStorageClassSpecifier | TSC | ) | [inline] |
Definition at line 826 of file Decl.h.
Referenced by clang::Sema::ActOnVariableDeclarator(), and clang::Sema::BuildVariableInstantiation().
friend class ASTDeclReader [friend] |
Reimplemented from clang::DeclaratorDecl.
Reimplemented in clang::VarTemplatePartialSpecializationDecl, and clang::VarTemplateSpecializationDecl.
friend class ASTNodeImporter [friend] |
friend class StmtIteratorBase [friend] |
union { ... } [protected] |
InitType clang::VarDecl::Init [mutable, protected] |
The initializer for this variable or, for a ParmVarDecl, the C++ default argument.
Definition at line 703 of file Decl.h.
Referenced by checkInitIsICE(), ensureEvaluatedStmt(), evaluateValue(), getSourceRange(), and setInit().
Definition at line 782 of file Decl.h.
Referenced by clang::ASTDeclReader::VisitParmVarDecl().
VarDeclBitfields clang::VarDecl::VarDeclBits |
Definition at line 781 of file Decl.h.
Referenced by getTLSKind(), setStorageClass(), VarDecl(), and clang::ASTDeclReader::VisitVarDeclImpl().