14 #ifndef LLVM_CLANG_AST_DECL_H
15 #define LLVM_CLANG_AST_DECL_H
25 #include "llvm/ADT/ArrayRef.h"
26 #include "llvm/ADT/Optional.h"
27 #include "llvm/Support/Compiler.h"
28 #include "llvm/Support/raw_ostream.h"
31 struct ASTTemplateArgumentListInfo;
34 class DependentFunctionTemplateSpecializationInfo;
36 class FunctionTemplateDecl;
37 class FunctionTemplateSpecializationInfo;
39 class MemberSpecializationInfo;
41 class NestedNameSpecifier;
45 class TemplateArgumentList;
46 class TemplateParameterList;
47 class TypeAliasTemplateDecl;
49 class UnresolvedSetImpl;
50 class VarTemplateDecl;
79 virtual void anchor();
123 virtual void anchor();
145 virtual void anchor();
152 NamedDecl *getUnderlyingDeclImpl() LLVM_READONLY;
156 :
Decl(DK, DC, L), Name(N) { }
169 assert(Name.
isIdentifier() &&
"Name is not a simple identifier");
215 bool Qualified)
const;
241 "declaration with no owning module can't be hidden");
252 if (isa<EnumDecl>(DC))
320 if (this->
getKind() != UsingShadow &&
321 this->
getKind() != ObjCCompatibleAlias)
324 return getUnderlyingDeclImpl();
354 void anchor()
override;
357 bool MSAsmNameResolved;
367 MSAsmNameResolved(
false),
413 llvm::PointerIntPair<NamespaceDecl *, 1, bool> AnonOrFirstNamespaceAndInline;
456 return AnonOrFirstNamespaceAndInline.getInt();
461 AnonOrFirstNamespaceAndInline.setInt(Inline);
469 return AnonOrFirstNamespaceAndInline.getPointer();
477 return AnonOrFirstNamespaceAndInline.getPointer();
530 void anchor()
override;
536 :
NamedDecl(DK, DC, L, N), DeclType(T) {}
593 llvm::PointerUnion<TypeSourceInfo*, ExtInfo*> DeclInfo;
599 bool hasExtInfo()
const {
return DeclInfo.is<ExtInfo*>(); }
600 ExtInfo *getExtInfo() {
return DeclInfo.get<ExtInfo*>(); }
601 const ExtInfo *getExtInfo()
const {
return DeclInfo.get<ExtInfo*>(); }
607 :
ValueDecl(DK, DC, L, N, T), DeclInfo(TInfo), InnerLocStart(StartL) {
613 ? getExtInfo()->TInfo
618 getExtInfo()->TInfo = TI;
640 return hasExtInfo() ? getExtInfo()->QualifierLoc.getNestedNameSpecifier()
648 return hasExtInfo() ? getExtInfo()->QualifierLoc
655 return hasExtInfo() ? getExtInfo()->NumTemplParamLists : 0;
659 return getExtInfo()->TemplParamLists[index];
669 return K >= firstDeclarator && K <= lastDeclarator;
733 struct UnparsedDefaultArgument;
737 struct UninstantiatedDefaultArgument;
740 UnparsedDefaultArgument *,
741 UninstantiatedDefaultArgument *>
InitType;
748 class VarDeclBitfields {
753 unsigned TSCSpec : 2;
754 unsigned InitStyle : 2;
756 enum { NumVarDeclBits = 7 };
769 unsigned : NumVarDeclBits;
773 unsigned HasInheritedDefaultArg : 1;
776 unsigned IsKNRPromoted : 1;
779 unsigned IsObjCMethodParam : 1;
785 unsigned ScopeDepthOrObjCQuals : 7;
796 unsigned : NumVarDeclBits;
800 unsigned ExceptionVar : 1;
805 unsigned NRVOVariable : 1;
809 unsigned CXXForRangeDecl : 1;
813 unsigned ARCPseudoStrong : 1;
816 unsigned IsConstexpr : 1;
820 unsigned IsInitCapture : 1;
825 unsigned PreviousDeclInSameBlockScope : 1;
878 assert(
VarDeclBits.TSCSpec == TSC &&
"truncation");
955 return DC->getRedeclContext()->isFunctionOrMethod();
1042 if (K == ParmVar || K == ImplicitParam)
1077 return (
const Expr*)
S;
1129 if (Eval->WasEvaluated)
1130 return &Eval->Evaluated;
1139 return Eval->CheckedICE;
1151 "Check whether we already know that the initializer is an ICE");
1188 assert(!isa<ParmVarDecl>(
this));
1206 assert(!isa<ParmVarDecl>(
this));
1216 assert(!isa<ParmVarDecl>(
this));
1228 assert(!isa<ParmVarDecl>(
this));
1237 assert(!isa<ParmVarDecl>(
this));
1246 assert(!isa<ParmVarDecl>(
this));
1253 return isa<ParmVarDecl>(
this)
1258 assert(!isa<ParmVarDecl>(
this));
1313 void anchor()
override;
1323 :
VarDecl(ImplicitParam, C, DC, IdLoc, IdLoc, Id, Type,
1343 :
VarDecl(DK, C, DC, StartLoc, IdLoc, Id, T, TInfo, S) {
1363 setParameterIndex(parameterIndex);
1373 setParameterIndex(parameterIndex);
1387 return getParameterIndex();
1420 Init =
reinterpret_cast<Stmt *
>(defarg);
1427 Init =
reinterpret_cast<UninstantiatedDefaultArgument *
>(arg);
1430 return (
Expr *)
Init.get<UninstantiatedDefaultArgument *>();
1433 return (
const Expr *)
Init.get<UninstantiatedDefaultArgument *>();
1454 return Init.is<UnparsedDefaultArgument*>();
1458 return Init.is<UninstantiatedDefaultArgument*>();
1495 void setParameterIndex(
unsigned parameterIndex) {
1496 if (parameterIndex >= ParameterIndexSentinel) {
1497 setParameterIndexLarge(parameterIndex);
1502 assert(
ParmVarDeclBits.ParameterIndex == parameterIndex &&
"truncation!");
1504 unsigned getParameterIndex()
const {
1506 return d == ParameterIndexSentinel ? getParameterIndexLarge() : d;
1509 void setParameterIndexLarge(
unsigned parameterIndex);
1510 unsigned getParameterIndexLarge()
const;
1533 TK_DependentFunctionTemplateSpecialization
1551 unsigned SClass : 2;
1553 bool IsInlineSpecified : 1;
1554 bool IsVirtualAsWritten : 1;
1556 bool HasInheritedPrototype : 1;
1557 bool HasWrittenPrototype : 1;
1560 bool IsDefaulted : 1;
1561 bool IsExplicitlyDefaulted : 1;
1562 bool HasImplicitReturnZero : 1;
1563 bool IsLateTemplateParsed : 1;
1564 bool IsConstexpr : 1;
1567 bool UsesSEHTry : 1;
1571 unsigned HasSkippedBody : 1;
1598 TemplateOrSpecialization;
1625 void setFunctionTemplateSpecialization(
ASTContext &
C,
1645 bool isConstexprSpecified)
1650 ParamInfo(nullptr), Body(),
1652 IsInline(isInlineSpecified), IsInlineSpecified(isInlineSpecified),
1653 IsVirtualAsWritten(
false), IsPure(
false), HasInheritedPrototype(
false),
1655 IsDefaulted(
false), IsExplicitlyDefaulted(
false),
1656 HasImplicitReturnZero(
false), IsLateTemplateParsed(
false),
1657 IsConstexpr(isConstexprSpecified), UsesSEHTry(
false),
1658 HasSkippedBody(
false), EndRangeLoc(NameInfo.getEndLoc()),
1659 TemplateOrSpecialization(),
1688 bool isInlineSpecified =
false,
1689 bool hasWrittenPrototype =
true,
1690 bool isConstexprSpecified =
false) {
1694 isInlineSpecified, hasWrittenPrototype,
1695 isConstexprSpecified);
1703 bool isInlineSpecified,
1704 bool hasWrittenPrototype,
1705 bool isConstexprSpecified =
false);
1714 bool Qualified)
const override;
1734 bool hasTrivialBody()
const;
1743 return isDefined(Definition);
1767 return IsDeleted || Body || IsLateTemplateParsed;
1774 return Body || IsLateTemplateParsed;
1777 void setBody(
Stmt *B);
1781 bool isVariadic()
const;
1790 void setPure(
bool P =
true);
1824 return HasWrittenPrototype || HasInheritedPrototype;
1867 bool isMain()
const;
1871 bool isMSVCRTEntryPoint()
const;
1886 bool isReservedGlobalPlacementOperator()
const;
1903 bool isReplaceableGlobalAllocationFunction()
const;
1921 bool isGlobal()
const;
1925 bool isNoReturn()
const;
1938 unsigned getBuiltinID()
const;
1966 unsigned getNumParams()
const;
1969 assert(i < getNumParams() &&
"Illegal param #");
1970 return ParamInfo[i];
1973 assert(i < getNumParams() &&
"Illegal param #");
1974 return ParamInfo[i];
1983 return llvm::makeArrayRef(ParamInfo, getNumParams());
1987 return DeclsInPrototypeScope;
1995 unsigned getMinRequiredArguments()
const;
2016 bool hasUnusedResultAttr()
const;
2028 IsInlineSpecified = I;
2042 bool isInlineDefinitionExternallyVisible()
const;
2044 bool isMSExternInline()
const;
2046 bool doesDeclarationForceExternallyVisibleDefinition()
const;
2051 return getOverloadedOperator() !=
OO_None;
2079 FunctionDecl *getInstantiatedFromMemberFunction()
const;
2082 TemplatedKind getTemplatedKind()
const;
2115 TemplateOrSpecialization = Template;
2121 return getPrimaryTemplate() !=
nullptr;
2126 FunctionDecl *getClassScopeSpecializationPattern()
const;
2132 return TemplateOrSpecialization.
2139 bool isImplicitlyInstantiable()
const;
2172 getTemplateSpecializationArgsAsWritten()
const;
2199 setFunctionTemplateSpecialization(
getASTContext(), Template, TemplateArgs,
2200 InsertPos, TSK, TemplateArgsAsWritten,
2201 PointOfInstantiation);
2212 return TemplateOrSpecialization.
2241 unsigned getMemoryFunctionKind()
const;
2246 return K >= firstFunction && K <= lastFunction;
2265 mutable unsigned CachedFieldIndex : 31;
2271 enum InitStorageKind {
2287 ISK_CapturedVLAType,
2301 llvm::PointerIntPair<void *, 2, InitStorageKind> InitStorage;
2308 Mutable(Mutable), CachedFieldIndex(0),
2309 InitStorage(BW, (InitStorageKind) InitStyle) {
2310 assert((!BW || InitStyle ==
ICIS_NoInit) &&
"got initializer for bitfield");
2331 return InitStorage.getInt() == ISK_BitWidthOrNothing &&
2332 InitStorage.getPointer() !=
nullptr;
2342 bool isAnonymousStructOrUnion()
const;
2346 ?
static_cast<Expr *
>(InitStorage.getPointer())
2349 unsigned getBitWidthValue(
const ASTContext &Ctx)
const;
2354 assert(InitStorage.getInt() == ISK_BitWidthOrNothing &&
2355 InitStorage.getPointer() ==
nullptr &&
2356 "bit width, initializer or captured type already set");
2357 InitStorage.setPointerAndInt(Width, ISK_BitWidthOrNothing);
2363 assert(isBitField() &&
"no bitfield width to remove");
2364 InitStorage.setPointerAndInt(
nullptr, ISK_BitWidthOrNothing);
2370 InitStorageKind storageKind = InitStorage.getInt();
2371 return (storageKind == ISK_CapturedVLAType
2386 return hasInClassInitializer()
2387 ?
static_cast<Expr *
>(InitStorage.getPointer())
2394 assert(hasInClassInitializer() &&
2395 InitStorage.getPointer() ==
nullptr &&
2396 "bit width, initializer or captured type already set");
2397 InitStorage.setPointer(Init);
2403 assert(hasInClassInitializer() &&
"no initializer to remove");
2404 InitStorage.setPointerAndInt(
nullptr, ISK_BitWidthOrNothing);
2410 return InitStorage.getInt() == ISK_CapturedVLAType;
2416 InitStorage.getPointer())
2456 const llvm::APSInt &V)
2464 const llvm::APSInt &V);
2491 void anchor()
override;
2493 unsigned ChainingSize;
2498 :
ValueDecl(IndirectField, DC, L, N, T), Chaining(CH), ChainingSize(CHS) {}
2519 assert(ChainingSize >= 2);
2520 return cast<FieldDecl>(Chaining[ChainingSize - 1]);
2524 assert(ChainingSize >= 2);
2525 return dyn_cast<
VarDecl>(*chain_begin());
2537 void anchor()
override;
2542 mutable const Type *TypeForDecl;
2550 :
NamedDecl(DK, DC, L, Id), TypeForDecl(nullptr), LocStart(StartL) {}
2563 if (LocStart.isValid())
2577 void anchor()
override;
2578 typedef std::pair<TypeSourceInfo*, QualType> ModedTInfo;
2579 llvm::PointerUnion<TypeSourceInfo*, ModedTInfo*> MaybeModedTInfo;
2586 MaybeModedTInfo(TInfo) {}
2609 bool isModed()
const {
return MaybeModedTInfo.is<ModedTInfo*>(); }
2613 ? MaybeModedTInfo.get<ModedTInfo*>()->first
2618 ? MaybeModedTInfo.get<ModedTInfo*>()->second
2622 MaybeModedTInfo = newType;
2625 MaybeModedTInfo =
new (
getASTContext()) ModedTInfo(unmodedTSI, modedTy);
2637 TagDecl *getAnonDeclWithTypedefName(
bool AnyRedecl =
false)
const;
2642 return K >= firstTypedefName && K <= lastTypedefName;
2675 Template(
nullptr) {}
2703 unsigned TagDeclKind : 3;
2708 bool IsCompleteDefinition : 1;
2712 bool IsBeingDefined : 1;
2718 bool IsEmbeddedInDeclarator : 1;
2721 bool IsFreeStanding : 1;
2725 unsigned NumPositiveBits : 8;
2726 unsigned NumNegativeBits : 8;
2735 bool IsScopedUsingClassTag : 1;
2745 bool MayHaveOutOfDateDef : 1;
2749 bool IsCompleteDefinitionRequired : 1;
2765 llvm::PointerUnion<NamedDecl *, ExtInfo *> NamedDeclOrQualifier;
2767 bool hasExtInfo()
const {
return NamedDeclOrQualifier.is<
ExtInfo *>(); }
2768 ExtInfo *getExtInfo() {
return NamedDeclOrQualifier.get<ExtInfo *>(); }
2769 const ExtInfo *getExtInfo()
const {
2770 return NamedDeclOrQualifier.get<ExtInfo *>();
2778 TagDeclKind(TK), IsCompleteDefinition(
false), IsBeingDefined(
false),
2779 IsEmbeddedInDeclarator(
false), IsFreeStanding(
false),
2780 IsCompleteDefinitionRequired(
false),
2781 NamedDeclOrQualifier((
NamedDecl *)nullptr) {
2782 assert((DK != Enum || TK ==
TTK_Enum) &&
2783 "EnumDecl not matched with TTK_Enum");
2801 void completeDefinition();
2833 return isCompleteDefinition();
2839 return IsCompleteDefinition;
2845 return IsCompleteDefinitionRequired;
2850 return IsBeingDefined;
2854 return IsEmbeddedInDeclarator;
2857 IsEmbeddedInDeclarator = isInDeclarator;
2862 IsFreeStanding = isFreeStanding;
2875 void startDefinition();
2890 IsCompleteDefinitionRequired = V;
2925 return (
getDeclName() || getTypedefNameForAnonDecl());
2929 return dyn_cast_or_null<DeclaratorDecl>(
2930 NamedDeclOrQualifier.get<
NamedDecl *>());
2933 return hasExtInfo() ?
nullptr : dyn_cast_or_null<DeclaratorDecl>(
2934 NamedDeclOrQualifier.get<
NamedDecl *>());
2938 return hasExtInfo() ?
nullptr : dyn_cast_or_null<TypedefNameDecl>(
2939 NamedDeclOrQualifier.get<
NamedDecl *>());
2949 return hasExtInfo() ? getExtInfo()->QualifierLoc.getNestedNameSpecifier()
2957 return hasExtInfo() ? getExtInfo()->QualifierLoc
2964 return hasExtInfo() ? getExtInfo()->NumTemplParamLists : 0;
2968 return getExtInfo()->TemplParamLists[i];
2992 void anchor()
override;
3008 llvm::PointerUnion<const Type*, TypeSourceInfo*> IntegerType;
3023 bool Scoped,
bool ScopedUsingClassTag,
bool Fixed)
3025 SpecializationInfo(
nullptr) {
3026 assert(Scoped || !ScopedUsingClassTag);
3027 IntegerType = (
const Type *)
nullptr;
3028 NumNegativeBits = 0;
3029 NumPositiveBits = 0;
3031 IsScopedUsingClassTag = ScopedUsingClassTag;
3046 return cast_or_null<EnumDecl>(
3067 bool IsScoped,
bool IsScopedUsingClassTag,
3076 void completeDefinition(
QualType NewType,
3078 unsigned NumPositiveBits,
3079 unsigned NumNegativeBits);
3084 typedef llvm::iterator_range<specific_decl_iterator<EnumConstantDecl>>
3118 if (
const Type *T = IntegerType.dyn_cast<
const Type*>())
3137 SourceRange getIntegerTypeRange() const LLVM_READONLY;
3141 unsigned getNumPositiveBits()
const {
3142 return NumPositiveBits;
3145 NumPositiveBits = Num;
3146 assert(NumPositiveBits == Num &&
"can't store this bitcount");
3159 return NumNegativeBits;
3162 NumNegativeBits = Num;
3172 return IsScopedUsingClassTag;
3183 return isCompleteDefinition() || isFixed();
3189 EnumDecl *getInstantiatedFromMemberEnum()
const;
3205 return SpecializationInfo;
3232 bool HasFlexibleArrayMember : 1;
3236 bool AnonymousStructOrUnion : 1;
3240 bool HasObjectMember : 1;
3244 bool HasVolatileMember : 1;
3250 mutable bool LoadedFieldsFromExternalStorage : 1;
3265 return cast_or_null<RecordDecl>(
3296 AnonymousStructOrUnion = Anon;
3318 bool isInjectedClassName()
const;
3322 bool isLambda()
const;
3326 bool isCapturedRecord()
const;
3329 void setCapturedRecord();
3347 typedef llvm::iterator_range<specific_decl_iterator<FieldDecl>>
field_range;
3350 field_iterator field_begin()
const;
3359 return field_begin() == field_end();
3364 virtual void completeDefinition();
3368 return K >= firstRecord && K <= lastRecord;
3379 bool mayInsertExtraPadding(
bool EmitRemark =
false)
const;
3383 const FieldDecl *findFirstNamedDataMember()
const;
3387 void LoadFieldsFromExternalStorage()
const;
3391 virtual void anchor();
3396 :
Decl(FileScopeAsm, DC, StartL), AsmString(asmstring), RParenLoc(EndL) {}
3434 llvm::PointerIntPair<VarDecl*, 2> VariableAndFlags;
3443 : VariableAndFlags(variable,
3444 (byRef ? flag_isByRef : 0) | (nested ? flag_isNested : 0)),
3452 bool isByRef()
const {
return VariableAndFlags.getInt() & flag_isByRef; }
3456 bool isNested()
const {
return VariableAndFlags.getInt() & flag_isNested; }
3465 bool IsVariadic : 1;
3466 bool CapturesCXXThis : 1;
3467 bool BlockMissingReturnType : 1;
3468 bool IsConversionFromLambda : 1;
3479 unsigned NumCaptures;
3481 unsigned ManglingNumber;
3482 Decl *ManglingContextDecl;
3488 BlockMissingReturnType(
true), IsConversionFromLambda(
false),
3489 ParamInfo(nullptr), NumParams(0), Body(nullptr),
3490 SignatureAsWritten(nullptr), Captures(nullptr), NumCaptures(0),
3491 ManglingNumber(0), ManglingContextDecl(nullptr) {}
3519 return llvm::makeArrayRef(ParamInfo, param_size());
3541 assert(i < getNumParams() &&
"Illegal param #");
3542 return ParamInfo[i];
3545 assert(i < getNumParams() &&
"Illegal param #");
3546 return ParamInfo[i];
3552 bool hasCaptures()
const {
return NumCaptures != 0 || CapturesCXXThis; }
3582 bool capturesVariable(
const VarDecl *var)
const;
3585 const Capture *begin,
3587 bool capturesCXXThis);
3590 return ManglingNumber;
3593 return ManglingContextDecl;
3597 ManglingNumber = Number;
3598 ManglingContextDecl = Ctx;
3621 unsigned ContextParam;
3623 llvm::PointerIntPair<Stmt *, 1, bool> BodyAndNothrow;
3627 NumParams(NumParams), ContextParam(0), BodyAndNothrow(
nullptr,
false) { }
3636 unsigned NumParams);
3638 unsigned NumParams);
3640 Stmt *
getBody()
const override {
return BodyAndNothrow.getPointer(); }
3644 void setNothrow(
bool Nothrow =
true) { BodyAndNothrow.setInt(Nothrow); }
3649 assert(i < NumParams);
3650 return getParams()[i];
3653 assert(i < NumParams);
3659 assert(ContextParam < NumParams);
3660 return getParam(ContextParam);
3663 assert(i < NumParams);
3711 llvm::PointerIntPair<Module *, 1, bool> ImportedAndComplete;
3743 unsigned NumLocations);
3763 virtual void anchor();
3765 :
Decl(Empty, DC, L) { }
3791 template<
typename decl_type>
3796 "setPreviousDecl on a decl already in a redeclaration chain");
3810 MostRecent->getIdentifierNamespace() &
3814 First =
static_cast<decl_type*
>(
this);
3820 assert(!isa<NamedDecl>(static_cast<decl_type*>(
this)) ||
3821 cast<NamedDecl>(static_cast<decl_type*>(
this))->
isLinkageValid());
static bool classof(const Decl *D)
static bool classofKind(Kind K)
ArrayRef< ParmVarDecl * > parameters() const
static NamespaceDecl * Create(ASTContext &C, DeclContext *DC, bool Inline, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, NamespaceDecl *PrevDecl)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
ArrayRef< ParmVarDecl * > parameters() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization, retrieves the member specialization information.
void setHasSkippedBody(bool Skipped=true)
llvm::iterator_range< specific_decl_iterator< FieldDecl > > field_range
void setScopeInfo(unsigned scopeDepth, unsigned parameterIndex)
void setOwningFunction(DeclContext *FD)
static unsigned getFieldIndex(Decl *F)
void setImplicit(bool I=true)
void setNothrow(bool Nothrow=true)
static bool classof(const Decl *D)
StringRef getName() const
llvm::iterator_range< chain_iterator > chain_range
ParmVarDecl *const * param_const_iterator
static DeclContext * castToDeclContext(const ExternCContextDecl *D)
void setAnonymousStructOrUnion(bool Anon)
APValue * evaluateValue() const
Attempt to evaluate the value of the initializer attached to this declaration, and produce notes expl...
TemplateSpecializationKind getTemplateSpecializationKind() const
If this variable is an instantiation of a variable template or a static data member of a class templa...
void setHidden(bool Hide)
Set whether this declaration is hidden from name lookup.
static bool classofKind(Kind K)
param_const_iterator param_end() const
bool isBitField() const
Determines whether this field is a bitfield.
StringRef getMSAsmLabel() const
QualType getCallResultType() const
Determine the type of an expression that calls this function.
bool hasLinkageBeenComputed() const
True if something has required us to compute the linkage of this declaration.
static bool classofKind(Kind K)
unsigned param_size() const
static VarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
QualifierInfo()
Default constructor.
IdentifierInfo * getIdentifier() const
static TranslationUnitDecl * castFromDeclContext(const DeclContext *DC)
bool IsEnumDeclScoped(EnumDecl *ED)
Check if the given decl is scoped.
static bool classofKind(Kind K)
param_const_iterator param_begin() const
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
void setPreviousDecl(VarDecl *PrevDecl)
Set the previous declaration. If PrevDecl is NULL, set this as the first and only declaration...
TagDecl(Kind DK, TagKind TK, const ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, TagDecl *PrevDecl, SourceLocation StartL)
bool IsICE
Whether this statement is an integral constant expression, or in C++11, whether the statement is a co...
const Expr * getInitExpr() const
void setEmbeddedInDeclarator(bool isInDeclarator)
redeclarable_base::redecl_range redecl_range
CompoundStmt * getCompoundBody() const
void setParam(unsigned i, ImplicitParamDecl *P)
bool IsEvaluating
Whether this statement is being evaluated.
Expr * getCopyExpr() const
unsigned getFunctionScopeIndex() const
Returns the index of this parameter in its prototype or method scope.
QualType getUnderlyingType() const
DeclaratorDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T, TypeSourceInfo *TInfo, SourceLocation StartL)
redeclarable_base::redecl_iterator redecl_iterator
void setRangeEnd(SourceLocation E)
chain_range chain() const
EnumDecl * getPreviousDecl()
const VariableArrayType * getCapturedVLAType() const
Get the captured variable length array type.
param_iterator param_end()
void setModulePrivate(bool MP=true)
Specify whether this declaration was marked as being private to the module in which it was defined...
NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
const RecordDecl * getMostRecentDecl() const
bool hasFlexibleArrayMember() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization...
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
capture_const_range captures() const
IdentifierInfo * getAsIdentifierInfo() const
Represents an empty-declaration.
void setCopyExpr(Expr *e)
enumerator_iterator enumerator_end() const
bool hasLinkage() const
Determine whether this declaration has linkage.
const EnumDecl * getMostRecentDecl() const
Declaration of a variable template.
const Expr * getInit() const
NamespaceDecl - Represent a C++ namespace.
ObjCDeclQualifier getObjCDeclQualifier() const
Redeclarable< TagDecl > redeclarable_base
A container of type source information.
StorageDuration
The storage duration for an object (per C++ [basic.stc]).
StringLiteral * getAsmString()
TypeSourceInfo * getIntegerTypeSourceInfo() const
Return the type source info for the underlying integer type, if no type source info exists...
bool CheckingICE
Whether we are checking whether this statement is an integral constant expression.
enumerator_iterator enumerator_begin() const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
void setInitStyle(InitializationStyle Style)
redeclarable_base::redecl_iterator redecl_iterator
Expr * getInClassInitializer() const
InClassInitStyle getInClassInitStyle() const
const VarDecl * getDefinition() const
static CapturedDecl * castFromDeclContext(const DeclContext *DC)
VarDecl * getMostRecentDeclImpl() override
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...
ExplicitVisibilityKind
Kinds of explicit visibility.
bool isUsableInConstantExpressions(ASTContext &C) const
Determine whether this variable's value can be used in a constant expression, according to the releva...
bool isFileVarDecl() const
isFileVarDecl - Returns true for file scoped variable declaration.
bool WasEvaluated
Whether this statement was already evaluated.
bool capturesCXXThis() const
RecordDecl * getPreviousDecl()
unsigned getBlockManglingNumber() const
void setUninstantiatedDefaultArg(Expr *arg)
TLSKind getTLSKind() const
static bool classofKind(Kind K)
Declaration context for names declared as extern "C" in C++. This is neither the semantic nor lexical...
llvm::iterator_range< capture_iterator > capture_range
The "__interface" keyword.
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
bool hasGlobalStorage() const
Returns true for all variables that do not have local storage.
NamespaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this namespace.
const TypedefNameDecl * getCanonicalDecl() const
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>". This is safe to be used inside an AST node, in contrast with TemplateArgumentListInfo.
Stores a list of template parameters for a TemplateDecl and its derived classes.
static StringRef getTagTypeKindName(TagTypeKind Kind)
static bool classof(const Decl *D)
Visibility getVisibility() const
Determines the visibility of this entity.
NamespaceDecl * getAnonymousNamespace() const
Describes how types, statements, expressions, and declarations should be printed. ...
decl_iterator decls_end() const
capture_iterator capture_begin()
ParmVarDecl - Represents a parameter to a function.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
Provides information about a dependent function-template specialization declaration.
EvaluatedStmt * ensureEvaluatedStmt() const
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
bool hasExternalFormalLinkage() const
True if this decl has external linkage.
void setTemplateParameterListsInfo(ASTContext &Context, unsigned NumTPLists, TemplateParameterList **TPLists)
Base wrapper for a particular "section" of type source info.
ParmVarDecl ** param_iterator
Visibility getVisibility() const
bool isFunctionTemplateSpecialization() const
Determine whether this function is a function template specialization.
bool hasUninstantiatedDefaultArg() const
Provides common interface for the Decls that can be redeclared.
FunctionDecl * getPreviousDeclImpl() override
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain...
static bool classofKind(Kind K)
void setIntegerType(QualType T)
Set the underlying integer type.
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
static bool classofKind(Kind K)
Defines the Linkage enumeration and various utility functions.
static bool classof(const Decl *D)
redeclarable_base::redecl_iterator redecl_iterator
void setCompleteDefinition(bool V)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
bool CheckedICE
Whether we already checked whether this statement was an integral constant expression.
SourceLocation getPointOfInstantiation() const
If this variable is an instantiation of a variable template or a static data member of a class templa...
static bool classof(const Decl *D)
bool isIdentifier() const
Predicate functions for querying what type of name this is.
QualType getReturnType() const
void setBlockMissingReturnType(bool val)
bool isCompleteDefinition() const
void setLocStart(SourceLocation L)
bool isAnonymousNamespace() const
Returns true if this is an anonymous namespace declaration.
bool declarationReplaces(NamedDecl *OldD, bool IsKnownNewer=true) const
Determine whether this declaration, if known to be well-formed within its context, will replace the declaration OldD if introduced into scope. A declaration will replace another declaration if, for example, it is a redeclaration of the same variable or function, but not if it is a declaration of a different kind (function vs. class) or an overloaded function.
const EnumDecl * getCanonicalDecl() const
static DeclContext * castToDeclContext(const FunctionDecl *D)
ParmVarDecl ** param_iterator
redecl_iterator redecls_begin() const
TagKind getTagKind() const
bool isPreviousDeclInSameBlockScope() const
void overrideType(QualType T)
Override the type stored in this TypeSourceInfo. Use with caution!
Linkage getFormalLinkage(Linkage L)
This declaration is definitely a definition.
static bool classofKind(Kind K)
Stmt * getBody() const override
void setNumPositiveBits(unsigned Num)
llvm::iterator_range< param_iterator > param_range
unsigned getNumCaptures() const
TypedefNameDecl * getNextRedeclarationImpl() override
Returns the next redeclaration or itself if this is the only decl.
static NamespaceDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Describes a module or submodule.
bool isThisDeclarationADefinition() const
StorageClass getStorageClass() const
Returns the storage class as written in the source. For the computed linkage of symbol, see getLinkage.
bool hasExternalStorage() const
Returns true if a variable has extern or private_extern storage.
static bool classofKind(Kind K)
ImplicitParamDecl ** param_iterator
virtual void getNameForDiagnostic(raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const
bool isLinkageValid() const
True if the computed linkage is valid. Used for consistency checking. Should always return true...
Provides information about a function template specialization, which is a FunctionDecl that has been ...
TypedefNameDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this typedef-name.
bool isExplicitlyDefaulted() const
VarDecl * getActingDefinition()
Get the tentative definition that acts as the real definition in a TU. Returns null if there is a pro...
ImplicitParamDecl * getParam(unsigned i) const
static NamespaceDecl * castFromDeclContext(const DeclContext *DC)
TemplateParameterList ** TemplParamLists
InitializationStyle
Initialization styles.
static bool classof(const Decl *D)
VarDecl * getNextRedeclaration() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
TypeDecl(Kind DK, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation StartL=SourceLocation())
QualType getOriginalType() const
bool isInline() const
Returns true if this is an inline namespace declaration.
static ExternCContextDecl * Create(const ASTContext &C, TranslationUnitDecl *TU)
DeclLink RedeclLink
Points to the next redeclaration in the chain.
SourceLocation getRBraceLoc() const
bool isLocalVarDeclOrParm() const
Similar to isLocalVarDecl but also includes parameters.
bool isFunctionOrMethodVarDecl() const
bool isExternC() const
Determines whether this variable is a variable with external, C linkage.
Visibility
Describes the different kinds of visibility that a declaration may have.
field_range fields() const
VarDecl * getVarDecl() const
llvm::iterator_range< param_const_iterator > param_const_range
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setHasObjectMember(bool val)
A set of unresolved declarations.
bool hasCapturedVLAType() const
Determine whether this member captures the variable length array type.
void setHasImplicitReturnZero(bool IRZ)
void setExceptionVariable(bool EV)
bool isOverloadedOperator() const
std::string getNameAsString() const
LabelStmt * getStmt() const
chain_iterator chain_begin() const
static bool classof(const Decl *D)
FunctionDecl * getMostRecentDeclImpl() override
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...
SourceLocation getRBraceLoc() const
static BlockDecl * castFromDeclContext(const DeclContext *DC)
TagDecl * getPreviousDeclImpl() override
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain...
bool isWeak() const
Determine whether this symbol is weakly-imported, or declared with the weak or weak-ref attr...
static bool classof(const Decl *D)
TypedefNameDecl * getPreviousDeclImpl() override
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain...
DeclContext * getLexicalDeclContext()
bool hasLocalOwningModuleStorage() const
std::string getAsString() const
getNameAsString - Retrieve the human-readable string for this name.
void setNumNegativeBits(unsigned Num)
bool isStaticLocal() const
static VarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S)
static bool classofKind(Kind K)
This represents the body of a CapturedStmt, and serves as its DeclContext.
static ParmVarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
decl_iterator decls_begin() const
const EnumConstantDecl * getCanonicalDecl() const
void setInitVal(const llvm::APSInt &V)
NamedDecl *const * chain_iterator
void setInitExpr(Expr *E)
void setStmt(LabelStmt *T)
void setLocStart(SourceLocation L)
static FunctionDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation NLoc, DeclarationName N, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInlineSpecified=false, bool hasWrittenPrototype=true, bool isConstexprSpecified=false)
bool isUnnamedBitfield() const
Determines whether this is an unnamed bitfield.
VarDecl * getPreviousDeclImpl() override
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain...
param_iterator param_begin()
void setHasInheritedPrototype(bool P=true)
field_iterator field_end() const
llvm::iterator_range< capture_const_iterator > capture_const_range
bool hasPrototype() const
Whether this function has a prototype, either because one was explicitly written or because it was "i...
static bool classof(const Decl *D)
static bool classof(const Decl *D)
void removeInClassInitializer()
param_const_range params() const
void setInline(bool Inline)
Set whether this is an inline namespace declaration.
bool isKNRPromoted() const
unsigned getNumParams() const
bool isLateTemplateParsed() const
Whether this templated function will be late parsed.
llvm::iterator_range< redecl_iterator > redecl_range
void setLazyBody(uint64_t Offset)
bool isExternalFormalLinkage(Linkage L)
RecordDecl * getMostRecentDecl()
A placeholder type used to construct an empty shell of a decl-derived type that will be filled in lat...
A little helper class used to produce diagnostics.
unsigned NumTemplParamLists
bool isConversionFromLambda() const
static bool classof(const Decl *D)
static bool classofKind(Kind K)
SourceLocation getLocStart() const LLVM_READONLY
bool isParameterPack() const
Determine whether this parameter is actually a function parameter pack.
Represents a ValueDecl that came out of a declarator. Contains type source information through TypeSo...
void setTemplateParameterListsInfo(ASTContext &Context, unsigned NumTPLists, TemplateParameterList **TPLists)
FieldDecl * getAnonField() const
unsigned getChainingSize() const
SourceLocation getTypeSpecStartLoc() const
SourceLocation getInnerLocStart() const
bool usesSEHTry() const
Whether this is a (C++11) constexpr function or constexpr constructor.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this variable is an instantiation of a static data member of a class template specialization, retrieves the member specialization information.
ArrayRef< NamedDecl * > getDeclsInPrototypeScope() const
bool isCXXInstanceMember() const
Determine whether the given declaration is an instance member of a C++ class.
Redeclarable< TypedefNameDecl > redeclarable_base
ID
Defines the set of possible language-specific address spaces.
StorageClass getStorageClass() const
Returns the storage class as written in the source. For the computed linkage of symbol, see getLinkage.
static bool classof(const Decl *D)
void setInClassInitializer(Expr *Init)
bool isCXXClassMember() const
Determine whether this declaration is a C++ class member.
FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)
static bool classof(const Decl *D)
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
capture_iterator capture_end()
TypedefNameDecl * getMostRecentDeclImpl() override
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...
bool isDeleted() const
Whether this function has been deleted.
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
bool hasDeclaratorForAnonDecl() const
const Type * getTypeForDecl() const
unsigned param_size() const
const Type * getTypePtrOrNull() const
bool isDirectInit() const
Whether the initializer is a direct-initializer (list or call).
TypedefNameDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
StringRef getName() const
Return the actual identifier string.
const EnumDecl * getPreviousDecl() const
void setBitWidth(Expr *Width)
setBitWidth - Set the bit-field width for this member.
ParmVarDecl *const * param_const_iterator
bool hasSkippedBody() const
True if the function was a definition but its body was skipped.
static bool classofKind(Kind K)
VarDecl * getOutOfLineDefinition()
If this is a static data member, find its out-of-line definition.
bool isDeletedAsWritten() const
VarDecl * getVariable() const
The variable being captured.
const NamedDecl * getMostRecentDecl() const
const NamedDecl * getUnderlyingDecl() const
Expr * getBitWidth() const
void setRBraceLoc(SourceLocation L)
param_range params() const
Retrieve an iterator range for the parameter declarations.
void setContextParam(unsigned i, ImplicitParamDecl *P)
capture_const_iterator capture_begin() const
Defines an enumeration for C++ overloaded operators.
Stmt * getBody() const override
const ParmVarDecl * getParamDecl(unsigned i) const
static DeclLink PreviousDeclLink(VarDecl *D)
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
DeclContext * getDeclContext()
Redeclarable< VarDecl > redeclarable_base
static bool classofKind(Kind K)
This declaration is a tentative definition.
bool hasDefaultArg() const
unsigned getContextParamPosition() const
static bool classof(const Decl *D)
void setCompleteDefinitionRequired(bool V=true)
bool isMSAsmLabel() const
bool isInExternCContext() const
Determines whether this variable's context is, or is nested within, a C++ extern "C" linkage spec...
EnumDecl * getMostRecentDecl()
void setDefaultArg(Expr *defarg)
const FieldDecl * getCanonicalDecl() const
void setLateTemplateParsed(bool ILT=true)
SourceRange getDefaultArgRange() const
Retrieve the source range that covers the entire default argument.
void setLocStart(SourceLocation L)
static DeclContext * castToDeclContext(const CapturedDecl *D)
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
bool isObjCMethodParameter() const
void setConstexpr(bool IC)
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
StorageClass
Storage classes.
Expr * getUninstantiatedDefaultArg()
SourceLocation getRParenLoc() const
bool isExceptionVariable() const
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C ...
Direct list-initialization (C++11)
bool isFunctionOrMethod() const
InClassInitStyle
In-class initialization styles for non-static data members.
Declaration of an alias template.
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
bool isExternallyVisible(Linkage L)
bool isExternallyVisible() const
void setModedTypeSourceInfo(TypeSourceInfo *unmodedTSI, QualType modedTy)
param_const_iterator param_end() const
void setParams(ArrayRef< ParmVarDecl * > NewParamInfo)
specific_decl_iterator< FieldDecl > field_iterator
static bool classof(const Decl *D)
DeclarationName getDeclName() const
TagDecl * getMostRecentDeclImpl() override
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...
TypeAliasTemplateDecl * getDescribedAliasTemplate() const
Linkage getLinkageInternal() const
Determine what kind of linkage this entity has. This is not the linkage as defined by the standard or...
TagDecl * getDefinition() const
static DeclContext * castToDeclContext(const NamespaceDecl *D)
Linkage getFormalLinkage() const
Get the linkage from a semantic point of view. Entities in anonymous namespaces are external (in c++9...
void setStorageClass(StorageClass SC)
ObjCStringFormatFamily getObjCFStringFormattingFamily() const
bool hasNameForLinkage() const
const VarDecl * getCanonicalDecl() const
RecordDecl * getDefinition() const
bool hasInheritedPrototype() const
Whether this function inherited its prototype from a previous declaration.
bool checkInitIsICE() const
Determine whether the value of the initializer attached to this declaration is an integral constant e...
bool IsEnumDeclComplete(EnumDecl *ED)
Check if the given decl is complete.
void setBlockMangling(unsigned Number, Decl *Ctx)
bool isTemplateInstantiation(TemplateSpecializationKind Kind)
Determine whether this template specialization kind refers to an instantiation of an entity (as oppos...
TypeSourceInfo * getTypeSourceInfo() const
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace. This is false for non-original (subsequent) namespace declarations and anonymous namespaces.
void setDeclContext(DeclContext *DC)
TypedefNameDecl * getTypedefNameForAnonDecl() const
VarDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
static bool classofKind(Kind K)
static bool classof(const Decl *D)
const Expr * getAnyInitializer() const
Optional< Visibility > getExplicitVisibility(ExplicitVisibilityKind kind) const
If visibility was explicitly specified for this declaration, return that visibility.
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
VarDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
const ParmVarDecl * getParamDecl(unsigned i) const
param_iterator param_begin()
bool isEmbeddedInDeclarator() const
void setIsVariadic(bool value)
BlockDecl(DeclContext *DC, SourceLocation CaretLoc)
void setTypeForDecl(const Type *TD)
static bool classof(const Decl *D)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool doesThisDeclarationHaveABody() const
static bool classofKind(Kind K)
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
static bool classofKind(Kind K)
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl. It will iterate at least once ...
static bool classof(const Decl *D)
param_const_range params() const
static ExternCContextDecl * castFromDeclContext(const DeclContext *DC)
const Capture * capture_iterator
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
NamespaceDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
void setIsConversionFromLambda(bool val)
redeclarable_base::redecl_range redecl_range
void setKNRPromoted(bool promoted)
SourceLocation getOuterLocStart() const
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
enumerator_range enumerators() const
static DeclContext * castToDeclContext(const TranslationUnitDecl *D)
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
static bool classof(const Decl *D)
static bool classofKind(Kind K)
ParmVarDecl * getParamDecl(unsigned i)
void setAnonymousNamespace(NamespaceDecl *D)
static bool classofKind(Kind K)
SourceLocation getLocStart() const LLVM_READONLY
void setFreeStanding(bool isFreeStanding=true)
const Capture * capture_const_iterator
TagDecl - Represents the declaration of a struct/union/class/enum.
LanguageLinkage
Describes the different kinds of language linkage (C++ [dcl.link]) that an entity may have...
ASTContext & getASTContext() const LLVM_READONLY
bool isLocalVarDecl() const
capture_const_iterator capture_end() const
TagDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
void printName(raw_ostream &os) const
llvm::iterator_range< param_iterator > param_range
redeclarable_base::redecl_range redecl_range
void setDefaulted(bool D=true)
void setHasFlexibleArrayMember(bool V)
EnumDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool blockMissingReturnType() const
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
C-style initialization with assignment.
redecl_iterator redecls_end() const
void setInstantiationOfMemberEnum(EnumDecl *ED, TemplateSpecializationKind TSK)
Specify that this enumeration is an instantiation of the member enumeration ED.
param_iterator param_begin() const
Retrieve an iterator pointing to the first parameter decl.
Stmt ** getInitAddress()
Retrieve the address of the initializer expression.
static bool classof(const Decl *D)
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
virtual Stmt * getBody() const
ASTContext & getASTContext() const
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
redeclarable_base::redecl_range redecl_range
void setDeclName(DeclarationName N)
Set the name of this declaration.
Capture(VarDecl *variable, bool byRef, bool nested, Expr *copy)
FunctionDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass S, bool isInlineSpecified, bool isConstexprSpecified)
ParmVarDecl * getParamDecl(unsigned i)
bool hasVolatileMember() const
void setTagKind(TagKind TK)
This declaration is only a declaration.
Direct list-initialization.
void removeBitWidth()
removeBitWidth - Remove the bit-field width from this member.
LinkageInfo getLinkageAndVisibility() const
Determines the linkage and visibility of this entity.
ThreadStorageClassSpecifier getTSCSpec() const
llvm::iterator_range< specific_decl_iterator< EnumConstantDecl > > enumerator_range
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isDependentType() const
Whether this declaration declares a type that is dependent, i.e., a type that somehow depends on temp...
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.
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
bool hasObjectMember() const
bool hasCachedLinkage() const
Stmt * getBody() const override
static DeclContext * castToDeclContext(const BlockDecl *D)
void setExplicitlyDefaulted(bool ED=true)
void setHasInheritedDefaultArg(bool I=true)
llvm::iterator_range< param_iterator > param_range
QualType getType() const
Return the type wrapped by this type source info.
static bool classofKind(Kind K)
void printQualifiedName(raw_ostream &OS) const
Describes a module import declaration, which makes the contents of the named module visible in the cu...
void setVirtualAsWritten(bool V)
static const char * getStorageClassSpecifierString(StorageClass SC)
Decl * getBlockManglingContextDecl() const
const RecordDecl * getPreviousDecl() const
void setTemplateSpecializationKind(TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
For a static data member that was instantiated from a static data member of a class template...
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
Base class for declarations which introduce a typedef-name.
const VarDecl * getDefinition(ASTContext &C) const
bool isAnonymousStructOrUnion() const
TLS with a dynamic initializer.
void setAnonymousNamespace(NamespaceDecl *D)
TagTypeKind
The kind of a tag type.
unsigned getNumParams() const
static bool classofKind(Kind K)
static ParmVarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg)
void setDescribedAliasTemplate(TypeAliasTemplateDecl *TAT)
void setBody(CompoundStmt *B)
void setImplicitlyInline()
Flag that this function is implicitly inline.
void setHasVolatileMember(bool val)
FunctionDecl * getNextRedeclarationImpl() override
Returns the next redeclaration or itself if this is the only decl.
bool hasUnparsedDefaultArg() const
redeclarable_base::redecl_range redecl_range
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
VarDecl * getNextRedeclarationImpl() override
Returns the next redeclaration or itself if this is the only decl.
QualType getPromotionType() const
unsigned getNumTemplateParameterLists() const
InitType Init
The initializer for this variable or, for a ParmVarDecl, the C++ default argument.
ParmVarDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg)
Redeclarable< FunctionDecl > redeclarable_base
Reads an AST files chain containing the contents of a translation unit.
TagDecl * getNextRedeclarationImpl() override
Returns the next redeclaration or itself if this is the only decl.
void setARCPseudoStrong(bool ps)
bool isFreeStanding() const
const llvm::APSInt & getInitVal() const
bool hasWrittenPrototype() const
TLSKind
Kinds of thread-local storage.
chain_iterator chain_end() const
void setInstantiationOfMemberFunction(FunctionDecl *FD, TemplateSpecializationKind TSK)
Specify that this record is an instantiation of the member function FD.
specific_decl_iterator< EnumConstantDecl > enumerator_iterator
ParmVarDeclBitfields ParmVarDeclBits
bool isThisDeclarationADefinition() const
SourceLocation getLocStart() const LLVM_READONLY
unsigned getFunctionScopeDepth() const
static bool classof(const Decl *D)
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
void setPreviousDeclInSameBlockScope(bool Same)
DefinitionKind hasDefinition() const
static LabelDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static LabelDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdentL, IdentifierInfo *II)
param_iterator param_end()
void setInitCapture(bool IC)
bool isCompleteDefinitionRequired() const
Return true if this complete decl is required to be complete for some existing use.
bool hasInheritedDefaultArg() const
redeclarable_base::redecl_iterator redecl_iterator
Not an overloaded operator.
static FunctionDecl * castFromDeclContext(const DeclContext *DC)
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
param_const_iterator param_begin() const
unsigned getNumNegativeBits() const
Returns the width in bits required to store all the negative enumerators of this enum. These widths include the rightmost leading 1; that is:
static const TypeInfo & getInfo(unsigned id)
void setUnparsedDefaultArg()
NonParmVarDeclBitfields NonParmVarDeclBits
SourceLocation getCaretLocation() const
Decl::Kind getDeclKind() const
static ImplicitParamDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType T)
void setDescribedFunctionTemplate(FunctionTemplateDecl *Template)
static ImplicitParamDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc)
QualType getIntegerType() const
void setTypeSourceInfo(TypeSourceInfo *TI)
void setInstantiationOfStaticDataMember(VarDecl *VD, TemplateSpecializationKind TSK)
Specify that this variable is an instantiation of the static data member VD.
void setUsesSEHTry(bool UST)
static bool classof(const Decl *D)
bool isComplete() const
Returns true if this can be considered a complete type.
LanguageLinkage getLanguageLinkage() const
Compute the language linkage.
DeclContext * getRedeclContext()
SourceLocation getAsmLoc() const
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO)...
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
void setCXXForRangeDecl(bool FRD)
ImplicitParamDecl * getContextParam() const
Retrieve the parameter containing captured variables.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static bool classofKind(Kind K)
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
bool isStaticDataMember() const
Determines whether this is a static data member.
redeclarable_base::redecl_iterator redecl_iterator
static bool classofKind(Kind K)
void setInnerLocStart(SourceLocation L)
void setObjCMethodScopeInfo(unsigned parameterIndex)
bool isCXXForRangeDecl() const
Determine whether this variable is the for-range-declaration in a C++0x for-range statement...
std::string getQualifiedNameAsString() const
virtual bool isDefined() const
void setSignatureAsWritten(TypeSourceInfo *Sig)
void setPromotionType(QualType T)
Set the promotion type.
void setAsmString(StringLiteral *Asm)
void setRParenLoc(SourceLocation L)
A template argument list.
unsigned Hidden
Whether this declaration is hidden from normal name lookup, e.g., because it is was loaded from an AS...
param_iterator param_end() const
Retrieve an iterator one past the last parameter decl.
NestedNameSpecifierLoc QualifierLoc
static bool classofKind(Kind K)
Call-style initialization (C++98)
static DeclContext * castToDeclContext(const TagDecl *D)
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
ValueDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T)
ThreadStorageClassSpecifier
Thread storage-class-specifier.
bool isARCPseudoStrong() const
Determine whether this variable is an ARC pseudo-__strong variable. A pseudo-__strong variable has a ...
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
void setTSCSpec(ThreadStorageClassSpecifier TSC)
TypeSourceInfo * getSignatureAsWritten() const
llvm::iterator_range< param_const_iterator > param_const_range
void setDescribedVarTemplate(VarTemplateDecl *Template)
llvm::PointerUnion4< Stmt *, EvaluatedStmt *, UnparsedDefaultArgument *, UninstantiatedDefaultArgument * > InitType
bool isOutOfLine() const override
Determine whether this is or was instantiated from an out-of-line definition of a static data member...
static TranslationUnitDecl * Create(ASTContext &C)
static bool classofKind(Kind K)
void setConstexpr(bool IC)
ImplicitParamDecl(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType Type)
Provides information a specialization of a member of a class template, which may be a member function...
void setMSAsmLabel(StringRef Name)
Decl(Kind DK, DeclContext *DC, SourceLocation L)
VarDecl * getDefinition()
const FunctionDecl * getCanonicalDecl() const
DeclaratorDecl * getDeclaratorForAnonDecl() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
unsigned kind
All of the diagnostics that can be emitted by the frontend.
const Expr * getUninstantiatedDefaultArg() const
TemplateParameterList * getTemplateParameterList(unsigned i) const
static bool classofKind(Kind K)
void setDeclaratorForAnonDecl(DeclaratorDecl *DD)
const VarDecl * getActingDefinition() const
TLS with a known-constant initializer.
Kind
Lists the kind of concrete classes of Decl.
const Expr * getDefaultArg() const
static TagDecl * castFromDeclContext(const DeclContext *DC)
VarDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass SC)
VarDeclBitfields VarDeclBits
APValue * getEvaluatedValue() const
Return the already-evaluated value of this variable's initializer, or NULL if the value is not yet kn...
NamespaceDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
TranslationUnitDecl - The top declaration context.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
NamespaceDecl * getAnonymousNamespace() const
Retrieve the anonymous namespace nested inside this namespace, if any.
bool isInExternCXXContext() const
Determines whether this variable's context is, or is nested within, a C++ extern "C++" linkage spec...
static bool classof(const Decl *D)
bool isInitKnownICE() const
Determines whether it is already known whether the initializer is an integral constant expression or ...
NamedDecl * getMostRecentDecl()
DefinitionKind isThisDeclarationADefinition() const
EnumConstantDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, Expr *E, const llvm::APSInt &V)
SourceLocation getInnerLocStart() const
bool isResolvedMSAsmLabel() const
void setObjCDeclQualifier(ObjCDeclQualifier QTVal)
void setMSAsmLabelResolved()
TemplateParameterList * getTemplateParameterList(unsigned index) const
StringRef getKindName() const
void setFunctionTemplateSpecialization(FunctionTemplateDecl *Template, const TemplateArgumentList *TemplateArgs, void *InsertPos, TemplateSpecializationKind TSK=TSK_ImplicitInstantiation, const TemplateArgumentListInfo *TemplateArgsAsWritten=nullptr, SourceLocation PointOfInstantiation=SourceLocation())
Specify that this function declaration is actually a function template specialization.
bool isInitICE() const
Determines whether the initializer is an integral constant expression, or in C++11, whether the initializer is a constant expression.
A trivial tuple used to represent a source range.
SourceLocation getLocation() const
void setIntegerTypeSourceInfo(TypeSourceInfo *TInfo)
Set the underlying integer type source info.
DeclarationNameInfo getNameInfo() const
void setTypeSourceInfo(TypeSourceInfo *newType)
EnumDecl * getDefinition() const
Automatic storage duration (most local variables).
bool hasImplicitReturnZero() const
const NamespaceDecl * getCanonicalDecl() const
TypeSourceInfo * getTypeSourceInfo() const
static bool classofKind(Kind K)
const NamespaceDecl * getOriginalNamespace() const
Get the original (first) namespace declaration.
void setNRVOVariable(bool NRVO)
StorageDuration getStorageDuration() const
Get the storage duration of this variable, per C++ [basic.stc].
static bool classof(const Decl *D)
void setType(QualType newType)
virtual bool hasBody() const
Returns true if this Decl represents a declaration for a body of code, such as a function or method d...
void setDeletedAsWritten(bool D=true)
void setInlineSpecified(bool I)
Set whether the "inline" keyword was specified for this function.
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined...
bool isBeingDefined() const
isBeingDefined - Return true if this decl is currently being defined.
Declaration of a template function.
bool hasLocalStorage() const
void setRBraceLoc(SourceLocation L)
const RecordDecl * getParent() const
bool isMutable() const
isMutable - Determines whether this field is mutable (C++ only).
bool isHidden() const
Determine whether this declaration is hidden from name lookup.
bool hasInClassInitializer() const
unsigned getNumTemplateParameterLists() const
Structure used to store a statement, the constant value to which it was evaluated (if any)...
const StringLiteral * getAsmString() const
TemplatedKind
The kind of templated function a FunctionDecl can be.