14 #ifndef LLVM_CLANG_AST_DECL_H
15 #define LLVM_CLANG_AST_DECL_H
26 #include "llvm/ADT/ArrayRef.h"
27 #include "llvm/ADT/Optional.h"
28 #include "llvm/Support/Compiler.h"
29 #include "llvm/Support/raw_ostream.h"
30 #include "llvm/Support/TrailingObjects.h"
33 struct ASTTemplateArgumentListInfo;
36 class DependentFunctionTemplateSpecializationInfo;
38 class FunctionTemplateDecl;
39 class FunctionTemplateSpecializationInfo;
41 class MemberSpecializationInfo;
42 class NestedNameSpecifier;
46 class TemplateArgumentList;
47 class TemplateParameterList;
48 class TypeAliasTemplateDecl;
50 class UnresolvedSetImpl;
51 class VarTemplateDecl;
80 virtual void anchor();
124 virtual void anchor();
146 virtual void anchor();
153 NamedDecl *getUnderlyingDeclImpl() LLVM_READONLY;
157 :
Decl(DK, DC, L), Name(N) { }
170 assert(Name.
isIdentifier() &&
"Name is not a simple identifier");
216 bool Qualified)
const;
242 "declaration with no owning module can't be hidden");
253 if (isa<EnumDecl>(DC))
321 if (this->
getKind() != UsingShadow &&
322 this->
getKind() != ObjCCompatibleAlias &&
323 this->
getKind() != NamespaceAlias)
326 return getUnderlyingDeclImpl();
356 void anchor()
override;
359 bool MSAsmNameResolved;
369 MSAsmNameResolved(
false),
415 llvm::PointerIntPair<NamespaceDecl *, 1, bool> AnonOrFirstNamespaceAndInline;
458 return AnonOrFirstNamespaceAndInline.getInt();
463 AnonOrFirstNamespaceAndInline.setInt(Inline);
522 void anchor()
override;
528 :
NamedDecl(DK, DC, L, N), DeclType(T) {}
584 llvm::PointerUnion<TypeSourceInfo*, ExtInfo*> DeclInfo;
590 bool hasExtInfo()
const {
return DeclInfo.is<
ExtInfo*>(); }
592 const ExtInfo *getExtInfo()
const {
return DeclInfo.get<
ExtInfo*>(); }
598 :
ValueDecl(DK, DC, L, N, T), DeclInfo(TInfo), InnerLocStart(StartL) {
604 ? getExtInfo()->TInfo
609 getExtInfo()->TInfo = TI;
631 return hasExtInfo() ? getExtInfo()->QualifierLoc.getNestedNameSpecifier()
639 return hasExtInfo() ? getExtInfo()->QualifierLoc
646 return hasExtInfo() ? getExtInfo()->NumTemplParamLists : 0;
650 return getExtInfo()->TemplParamLists[index];
660 return K >= firstDeclarator && K <= lastDeclarator;
729 typedef llvm::PointerUnion<Stmt *, EvaluatedStmt *>
InitType;
736 class VarDeclBitfields {
741 unsigned TSCSpec : 2;
742 unsigned InitStyle : 2;
744 enum { NumVarDeclBits = 7 };
764 unsigned : NumVarDeclBits;
768 unsigned HasInheritedDefaultArg : 1;
777 unsigned IsKNRPromoted : 1;
780 unsigned IsObjCMethodParam : 1;
786 unsigned ScopeDepthOrObjCQuals : 7;
797 unsigned : NumVarDeclBits;
801 unsigned ExceptionVar : 1;
806 unsigned NRVOVariable : 1;
810 unsigned CXXForRangeDecl : 1;
814 unsigned ARCPseudoStrong : 1;
817 unsigned IsConstexpr : 1;
820 unsigned IsConcept : 1;
824 unsigned IsInitCapture : 1;
829 unsigned PreviousDeclInSameBlockScope : 1;
882 assert(
VarDeclBits.TSCSpec == TSC &&
"truncation");
959 return DC->getRedeclContext()->isFunctionOrMethod();
1046 if (K == ParmVar || K == ImplicitParam)
1144 assert(!isa<ParmVarDecl>(
this));
1162 assert(!isa<ParmVarDecl>(
this));
1172 assert(!isa<ParmVarDecl>(
this));
1184 assert(!isa<ParmVarDecl>(
this));
1193 assert(!isa<ParmVarDecl>(
this));
1202 assert(!isa<ParmVarDecl>(
this));
1211 assert(!isa<ParmVarDecl>(
this));
1218 return isa<ParmVarDecl>(
this)
1223 assert(!isa<ParmVarDecl>(
this));
1278 void anchor()
override;
1288 :
VarDecl(ImplicitParam, C, DC, IdLoc, IdLoc, Id, Type,
1308 :
VarDecl(DK, C, DC, StartLoc, IdLoc, Id, T, TInfo, S) {
1329 setParameterIndex(parameterIndex);
1339 setParameterIndex(parameterIndex);
1353 return getParameterIndex();
1454 void setParameterIndex(
unsigned parameterIndex) {
1455 if (parameterIndex >= ParameterIndexSentinel) {
1456 setParameterIndexLarge(parameterIndex);
1461 assert(
ParmVarDeclBits.ParameterIndex == parameterIndex &&
"truncation!");
1463 unsigned getParameterIndex()
const {
1465 return d == ParameterIndexSentinel ? getParameterIndexLarge() : d;
1468 void setParameterIndexLarge(
unsigned parameterIndex);
1469 unsigned getParameterIndexLarge()
const;
1492 TK_DependentFunctionTemplateSpecialization
1510 unsigned SClass : 2;
1511 unsigned IsInline : 1;
1512 unsigned IsInlineSpecified : 1;
1513 unsigned IsVirtualAsWritten : 1;
1514 unsigned IsPure : 1;
1515 unsigned HasInheritedPrototype : 1;
1516 unsigned HasWrittenPrototype : 1;
1517 unsigned IsDeleted : 1;
1518 unsigned IsTrivial : 1;
1519 unsigned IsDefaulted : 1;
1520 unsigned IsExplicitlyDefaulted : 1;
1521 unsigned HasImplicitReturnZero : 1;
1522 unsigned IsLateTemplateParsed : 1;
1523 unsigned IsConstexpr : 1;
1526 unsigned UsesSEHTry : 1;
1530 unsigned HasSkippedBody : 1;
1557 TemplateOrSpecialization;
1584 void setFunctionTemplateSpecialization(
ASTContext &
C,
1604 bool isConstexprSpecified)
1609 ParamInfo(nullptr), Body(),
1611 IsInline(isInlineSpecified), IsInlineSpecified(isInlineSpecified),
1612 IsVirtualAsWritten(
false), IsPure(
false), HasInheritedPrototype(
false),
1614 IsDefaulted(
false), IsExplicitlyDefaulted(
false),
1615 HasImplicitReturnZero(
false), IsLateTemplateParsed(
false),
1616 IsConstexpr(isConstexprSpecified), UsesSEHTry(
false),
1617 HasSkippedBody(
false), EndRangeLoc(NameInfo.getEndLoc()),
1618 TemplateOrSpecialization(),
1647 bool isInlineSpecified =
false,
1648 bool hasWrittenPrototype =
true,
1649 bool isConstexprSpecified =
false) {
1653 isInlineSpecified, hasWrittenPrototype,
1654 isConstexprSpecified);
1662 bool isInlineSpecified,
1663 bool hasWrittenPrototype,
1664 bool isConstexprSpecified =
false);
1673 bool Qualified)
const override;
1693 bool hasTrivialBody()
const;
1702 return isDefined(Definition);
1726 return IsDeleted || Body || IsLateTemplateParsed;
1733 return Body || IsLateTemplateParsed;
1736 void setBody(
Stmt *B);
1740 bool isVariadic()
const;
1749 void setPure(
bool P =
true);
1783 return HasWrittenPrototype || HasInheritedPrototype;
1826 bool isMain()
const;
1830 bool isMSVCRTEntryPoint()
const;
1845 bool isReservedGlobalPlacementOperator()
const;
1862 bool isReplaceableGlobalAllocationFunction()
const;
1880 bool isGlobal()
const;
1884 bool isNoReturn()
const;
1897 unsigned getBuiltinID()
const;
1925 unsigned getNumParams()
const;
1928 assert(i < getNumParams() &&
"Illegal param #");
1929 return ParamInfo[i];
1932 assert(i < getNumParams() &&
"Illegal param #");
1933 return ParamInfo[i];
1942 return llvm::makeArrayRef(ParamInfo, getNumParams());
1946 return DeclsInPrototypeScope;
1954 unsigned getMinRequiredArguments()
const;
1975 bool hasUnusedResultAttr()
const;
1987 IsInlineSpecified =
I;
2001 bool isInlineDefinitionExternallyVisible()
const;
2003 bool isMSExternInline()
const;
2005 bool doesDeclarationForceExternallyVisibleDefinition()
const;
2010 return getOverloadedOperator() !=
OO_None;
2038 FunctionDecl *getInstantiatedFromMemberFunction()
const;
2041 TemplatedKind getTemplatedKind()
const;
2074 return getPrimaryTemplate() !=
nullptr;
2079 FunctionDecl *getClassScopeSpecializationPattern()
const;
2089 bool isImplicitlyInstantiable()
const;
2122 getTemplateSpecializationArgsAsWritten()
const;
2149 setFunctionTemplateSpecialization(
getASTContext(), Template, TemplateArgs,
2150 InsertPos, TSK, TemplateArgsAsWritten,
2151 PointOfInstantiation);
2161 getDependentSpecializationInfo()
const;
2188 unsigned getMemoryFunctionKind()
const;
2193 return K >= firstFunction && K <= lastFunction;
2212 mutable unsigned CachedFieldIndex : 31;
2218 enum InitStorageKind {
2234 ISK_CapturedVLAType,
2248 llvm::PointerIntPair<void *, 2, InitStorageKind> InitStorage;
2255 Mutable(Mutable), CachedFieldIndex(0),
2256 InitStorage(BW, (InitStorageKind) InitStyle) {
2257 assert((!BW || InitStyle ==
ICIS_NoInit) &&
"got initializer for bitfield");
2278 return InitStorage.getInt() == ISK_BitWidthOrNothing &&
2279 InitStorage.getPointer() !=
nullptr;
2289 bool isAnonymousStructOrUnion()
const;
2293 ?
static_cast<Expr *
>(InitStorage.getPointer())
2296 unsigned getBitWidthValue(
const ASTContext &Ctx)
const;
2301 assert(InitStorage.getInt() == ISK_BitWidthOrNothing &&
2302 InitStorage.getPointer() ==
nullptr &&
2303 "bit width, initializer or captured type already set");
2304 InitStorage.setPointerAndInt(Width, ISK_BitWidthOrNothing);
2310 assert(isBitField() &&
"no bitfield width to remove");
2311 InitStorage.setPointerAndInt(
nullptr, ISK_BitWidthOrNothing);
2317 InitStorageKind storageKind = InitStorage.getInt();
2318 return (storageKind == ISK_CapturedVLAType
2333 return hasInClassInitializer()
2334 ?
static_cast<Expr *
>(InitStorage.getPointer())
2341 assert(hasInClassInitializer() &&
2342 InitStorage.getPointer() ==
nullptr &&
2343 "bit width, initializer or captured type already set");
2344 InitStorage.setPointer(Init);
2350 assert(hasInClassInitializer() &&
"no initializer to remove");
2351 InitStorage.setPointerAndInt(
nullptr, ISK_BitWidthOrNothing);
2357 return InitStorage.getInt() == ISK_CapturedVLAType;
2363 InitStorage.getPointer())
2403 const llvm::APSInt &V)
2411 const llvm::APSInt &V);
2439 void anchor()
override;
2441 unsigned ChainingSize;
2466 assert(ChainingSize >= 2);
2467 return cast<FieldDecl>(Chaining[ChainingSize - 1]);
2471 assert(ChainingSize >= 2);
2472 return dyn_cast<
VarDecl>(*chain_begin());
2487 void anchor()
override;
2492 mutable const Type *TypeForDecl;
2500 :
NamedDecl(DK, DC, L, Id), TypeForDecl(nullptr), LocStart(StartL) {}
2513 if (LocStart.isValid())
2527 void anchor()
override;
2528 typedef std::pair<TypeSourceInfo*, QualType> ModedTInfo;
2529 llvm::PointerUnion<TypeSourceInfo*, ModedTInfo*> MaybeModedTInfo;
2536 MaybeModedTInfo(TInfo) {}
2559 bool isModed()
const {
return MaybeModedTInfo.is<ModedTInfo*>(); }
2563 ? MaybeModedTInfo.get<ModedTInfo*>()->first
2568 ? MaybeModedTInfo.get<ModedTInfo*>()->second
2572 MaybeModedTInfo = newType;
2575 MaybeModedTInfo =
new (
getASTContext()) ModedTInfo(unmodedTSI, modedTy);
2587 TagDecl *getAnonDeclWithTypedefName(
bool AnyRedecl =
false)
const;
2592 return K >= firstTypedefName && K <= lastTypedefName;
2625 Template(
nullptr) {}
2653 unsigned TagDeclKind : 3;
2658 bool IsCompleteDefinition : 1;
2662 bool IsBeingDefined : 1;
2668 bool IsEmbeddedInDeclarator : 1;
2671 bool IsFreeStanding : 1;
2675 unsigned NumPositiveBits : 8;
2676 unsigned NumNegativeBits : 8;
2685 bool IsScopedUsingClassTag : 1;
2695 bool MayHaveOutOfDateDef : 1;
2699 bool IsCompleteDefinitionRequired : 1;
2715 llvm::PointerUnion<TypedefNameDecl *, ExtInfo *> TypedefNameDeclOrQualifier;
2717 bool hasExtInfo()
const {
return TypedefNameDeclOrQualifier.is<
ExtInfo *>(); }
2718 ExtInfo *getExtInfo() {
return TypedefNameDeclOrQualifier.get<
ExtInfo *>(); }
2719 const ExtInfo *getExtInfo()
const {
2720 return TypedefNameDeclOrQualifier.get<
ExtInfo *>();
2728 TagDeclKind(TK), IsCompleteDefinition(
false), IsBeingDefined(
false),
2729 IsEmbeddedInDeclarator(
false), IsFreeStanding(
false),
2730 IsCompleteDefinitionRequired(
false),
2732 assert((DK != Enum || TK ==
TTK_Enum) &&
2733 "EnumDecl not matched with TTK_Enum");
2751 void completeDefinition();
2783 return isCompleteDefinition();
2789 return IsCompleteDefinition;
2795 return IsCompleteDefinitionRequired;
2800 return IsBeingDefined;
2804 return IsEmbeddedInDeclarator;
2807 IsEmbeddedInDeclarator = isInDeclarator;
2812 IsFreeStanding = isFreeStanding;
2825 void startDefinition();
2840 IsCompleteDefinitionRequired = V;
2875 return (
getDeclName() || getTypedefNameForAnonDecl());
2879 return hasExtInfo() ?
nullptr
2888 return hasExtInfo() ? getExtInfo()->QualifierLoc.getNestedNameSpecifier()
2896 return hasExtInfo() ? getExtInfo()->QualifierLoc
2903 return hasExtInfo() ? getExtInfo()->NumTemplParamLists : 0;
2907 return getExtInfo()->TemplParamLists[i];
2931 void anchor()
override;
2947 llvm::PointerUnion<const Type*, TypeSourceInfo*> IntegerType;
2962 bool Scoped,
bool ScopedUsingClassTag,
bool Fixed)
2964 SpecializationInfo(
nullptr) {
2965 assert(Scoped || !ScopedUsingClassTag);
2966 IntegerType = (
const Type *)
nullptr;
2967 NumNegativeBits = 0;
2968 NumPositiveBits = 0;
2970 IsScopedUsingClassTag = ScopedUsingClassTag;
2985 return cast_or_null<EnumDecl>(
3006 bool IsScoped,
bool IsScopedUsingClassTag,
3015 void completeDefinition(
QualType NewType,
3017 unsigned NumPositiveBits,
3018 unsigned NumNegativeBits);
3023 typedef llvm::iterator_range<specific_decl_iterator<EnumConstantDecl>>
3057 if (
const Type *T = IntegerType.dyn_cast<
const Type*>())
3076 SourceRange getIntegerTypeRange() const LLVM_READONLY;
3080 unsigned getNumPositiveBits()
const {
3081 return NumPositiveBits;
3084 NumPositiveBits = Num;
3085 assert(NumPositiveBits == Num &&
"can't store this bitcount");
3098 return NumNegativeBits;
3101 NumNegativeBits = Num;
3111 return IsScopedUsingClassTag;
3122 return isCompleteDefinition() || isFixed();
3128 EnumDecl *getInstantiatedFromMemberEnum()
const;
3144 return SpecializationInfo;
3171 bool HasFlexibleArrayMember : 1;
3175 bool AnonymousStructOrUnion : 1;
3179 bool HasObjectMember : 1;
3183 bool HasVolatileMember : 1;
3189 mutable bool LoadedFieldsFromExternalStorage : 1;
3204 return cast_or_null<RecordDecl>(
3235 AnonymousStructOrUnion = Anon;
3245 return LoadedFieldsFromExternalStorage;
3248 LoadedFieldsFromExternalStorage = val;
3264 bool isInjectedClassName()
const;
3268 bool isLambda()
const;
3272 bool isCapturedRecord()
const;
3275 void setCapturedRecord();
3293 typedef llvm::iterator_range<specific_decl_iterator<FieldDecl>>
field_range;
3296 field_iterator field_begin()
const;
3305 return field_begin() == field_end();
3310 virtual void completeDefinition();
3314 return K >= firstRecord && K <= lastRecord;
3325 bool mayInsertExtraPadding(
bool EmitRemark =
false)
const;
3329 const FieldDecl *findFirstNamedDataMember()
const;
3333 void LoadFieldsFromExternalStorage()
const;
3337 virtual void anchor();
3342 :
Decl(FileScopeAsm, DC, StartL), AsmString(asmstring), RParenLoc(EndL) {}
3380 llvm::PointerIntPair<VarDecl*, 2> VariableAndFlags;
3389 : VariableAndFlags(variable,
3390 (byRef ? flag_isByRef : 0) | (nested ? flag_isNested : 0)),
3398 bool isByRef()
const {
return VariableAndFlags.getInt() & flag_isByRef; }
3402 bool isNested()
const {
return VariableAndFlags.getInt() & flag_isNested; }
3411 bool IsVariadic : 1;
3412 bool CapturesCXXThis : 1;
3413 bool BlockMissingReturnType : 1;
3414 bool IsConversionFromLambda : 1;
3424 const Capture *Captures;
3425 unsigned NumCaptures;
3427 unsigned ManglingNumber;
3428 Decl *ManglingContextDecl;
3434 BlockMissingReturnType(
true), IsConversionFromLambda(
false),
3435 ParamInfo(nullptr), NumParams(0), Body(nullptr),
3436 SignatureAsWritten(nullptr), Captures(nullptr), NumCaptures(0),
3437 ManglingNumber(0), ManglingContextDecl(nullptr) {}
3465 return llvm::makeArrayRef(ParamInfo, param_size());
3487 assert(i < getNumParams() &&
"Illegal param #");
3488 return ParamInfo[i];
3491 assert(i < getNumParams() &&
"Illegal param #");
3492 return ParamInfo[i];
3498 bool hasCaptures()
const {
return NumCaptures != 0 || CapturesCXXThis; }
3528 bool capturesVariable(
const VarDecl *var)
const;
3531 bool CapturesCXXThis);
3534 return ManglingNumber;
3537 return ManglingContextDecl;
3541 ManglingNumber = Number;
3542 ManglingContextDecl = Ctx;
3573 unsigned ContextParam;
3575 llvm::PointerIntPair<Stmt *, 1, bool> BodyAndNothrow;
3580 return getTrailingObjects<ImplicitParamDecl *>();
3583 ImplicitParamDecl **getParams() {
3584 return getTrailingObjects<ImplicitParamDecl *>();
3589 unsigned NumParams);
3591 unsigned NumParams);
3594 void setBody(
Stmt *B);
3596 bool isNothrow()
const;
3597 void setNothrow(
bool Nothrow =
true);
3602 assert(i < NumParams);
3603 return getParams()[i];
3606 assert(i < NumParams);
3612 assert(ContextParam < NumParams);
3613 return getParam(ContextParam);
3616 assert(i < NumParams);
3666 llvm::PointerIntPair<Module *, 1, bool> ImportedAndComplete;
3699 unsigned NumLocations);
3719 virtual void anchor();
3721 :
Decl(Empty, DC, L) { }
3747 template<
typename decl_type>
3752 "setPreviousDecl on a decl already in a redeclaration chain");
3766 MostRecent->getIdentifierNamespace() &
3770 First =
static_cast<decl_type*
>(
this);
3776 assert(!isa<NamedDecl>(static_cast<decl_type*>(
this)) ||
3777 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
void setHasSkippedBody(bool Skipped=true)
llvm::iterator_range< specific_decl_iterator< FieldDecl > > field_range
void setScopeInfo(unsigned scopeDepth, unsigned parameterIndex)
void setOwningFunction(DeclContext *FD)
setOwningFunction - Sets the function declaration that owns this ParmVarDecl.
static unsigned getFieldIndex(Decl *F)
void setImplicit(bool I=true)
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
static bool classof(const Decl *D)
StringRef getName() const
getName - Get the name of identifier for this declaration as a StringRef.
llvm::iterator_range< chain_iterator > chain_range
ParmVarDecl *const * param_const_iterator
static DeclContext * castToDeclContext(const ExternCContextDecl *D)
void setAnonymousStructOrUnion(bool Anon)
A class which contains all the information about a particular captured value.
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...
A (possibly-)qualified type.
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.
bool isByRef() const
Whether this is a "by ref" capture, i.e.
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
getIdentifier - Get the identifier that names this declaration, if there is one.
static TranslationUnitDecl * castFromDeclContext(const DeclContext *DC)
bool hasDefaultArg() const
hasDefaultArg - Determines whether this parameter has a default argument, either parsed or not...
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...
bool isInitICE() const
Determines whether the initializer is an integral constant expression, or in C++11, whether the initializer is a constant expression.
void setPreviousDecl(VarDecl *PrevDecl)
Set the previous declaration.
FunctionType - C99 6.7.5.3 - Function Declarators.
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
EnumConstantDecl - An instance of this object exists for each enum constant that is defined...
void setEmbeddedInDeclarator(bool isInDeclarator)
redeclarable_base::redecl_range redecl_range
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
CompoundStmt * getCompoundBody() const
C Language Family Type Representation.
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
Defines the clang::Module class, which describes a module in the source code.
DeclaratorDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T, TypeSourceInfo *TInfo, SourceLocation StartL)
redeclarable_base::redecl_iterator redecl_iterator
Decl - This represents one declaration (or definition), e.g.
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
getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in this declaration name, or NULL if this declaration name isn't a simple identifier.
The base class of the type hierarchy.
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
getInClassInitializer - Get the C++11 in-class initializer for this member, or null if one has not be...
InClassInitStyle getInClassInitStyle() const
getInClassInitStyle - Get the kind of (C++11) in-class initializer which this field has...
const VarDecl * getDefinition() const
static CapturedDecl * castFromDeclContext(const DeclContext *DC)
bool hasLoadedFieldsFromExternalStorage() const
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...
VarDecl - An instance of this class is created to represent a variable declaration or definition...
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
TLSKind getTLSKind() const
static bool classofKind(Kind K)
bool hasCaptures() const
hasCaptures - True if this block (or its nested blocks) captures anything of local storage from its e...
size_t numTrailingObjects(OverloadToken< ImplicitParamDecl >)
Declaration context for names declared as extern "C" in C++.
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>".
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...
llvm::PointerUnion< Stmt *, EvaluatedStmt * > InitType
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
Convert the initializer for this declaration to the elaborated EvaluatedStmt form, which contains extra information on the evaluated value of the initializer.
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
bool hasExternalFormalLinkage() const
True if this decl has external linkage.
Types, declared with 'struct foo', typedefs, etc.
Base wrapper for a particular "section" of type source info.
LabelStmt - Represents a label, which has a substatement.
ParmVarDecl ** param_iterator
RecordDecl - Represents a struct/union/class.
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)
One of these records is kept for each identifier that is lexed.
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)
void setUninstantiatedDefaultArg(Expr *arg)
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
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
void setBlockMissingReturnType(bool val)
bool isCompleteDefinition() const
isCompleteDefinition - Return true if this decl has its body fully specified.
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.
const EnumDecl * getCanonicalDecl() const
bool isPure() const
Whether this virtual function is pure, i.e.
static DeclContext * castToDeclContext(const FunctionDecl *D)
ParmVarDecl ** param_iterator
redecl_iterator redecls_begin() const
TagKind getTagKind() const
bool isPreviousDeclInSameBlockScope() const
Whether this local extern variable declaration's previous declaration was declared in the same block ...
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
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
void setNumPositiveBits(unsigned Num)
llvm::iterator_range< param_iterator > param_range
unsigned getNumCaptures() const
getNumCaptures - Returns the number of captured variables.
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
isThisDeclarationADefinition() - Return true if this declaration is a completion definition of the ty...
StorageClass getStorageClass() const
Returns the storage class as written in the source.
bool hasExternalStorage() const
Returns true if a variable has extern or private_extern storage.
static bool classofKind(Kind K)
virtual void getNameForDiagnostic(raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const
getNameForDiagnostic - Appends a human-readable name for this declaration into the given stream...
bool isLinkageValid() const
True if the computed linkage is valid.
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
Whether this function is explicitly defaulted per C++0x.
VarDecl * getActingDefinition()
Get the tentative definition that acts as the real definition in a TU.
ImplicitParamDecl * getParam(unsigned i) const
static NamespaceDecl * castFromDeclContext(const DeclContext *DC)
TemplateParameterList ** TemplParamLists
TemplParamLists - A new-allocated array of size NumTemplParamLists, containing pointers to the "outer...
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
A convenient class for passing around template argument information.
bool isLocalVarDeclOrParm() const
Similar to isLocalVarDecl but also includes parameters.
bool isFunctionOrMethodVarDecl() const
isFunctionOrMethodVarDecl - Similar to isLocalVarDecl, but excludes variables declared in blocks...
bool isDefaulted() const
Whether this function is defaulted per C++0x.
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.
TypeDecl - Represents a declaration of a type.
void setHasObjectMember(bool val)
bool isInitKnownICE() const
Determines whether it is already known whether the initializer is an integral constant expression or ...
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
isOverloadedOperator - Whether this function declaration represents an C++ overloaded operator...
std::string getNameAsString() const
getNameAsString - Get a human-readable name for the declaration, even if it is one of the special kin...
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()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
bool hasLocalOwningModuleStorage() const
std::string getAsString() const
getNameAsString - Retrieve the human-readable string for this name.
void setNumNegativeBits(unsigned Num)
bool isStaticLocal() const
isStaticLocal - Returns true if a variable with function scope is a static local variable.
static VarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S)
static bool classofKind(Kind K)
void setTemplateParameterListsInfo(ASTContext &Context, ArrayRef< TemplateParameterList * > TPLists)
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
detail::InMemoryDirectory::const_iterator I
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()
removeInClassInitializer - Remove the C++11 in-class initializer from this member.
param_const_range params() const
void setInline(bool Inline)
Set whether this is an inline namespace declaration.
bool isKNRPromoted() const
True if the value passed to this parameter must undergo K&R-style default argument promotion: ...
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...
TypeAliasDecl - Represents the declaration of a typedef-name via a C++0x alias-declaration.
A little helper class used to produce diagnostics.
CompoundStmt - This represents a group of statements like { stmt stmt }.
void setHasLoadedFieldsFromExternalStorage(bool val)
unsigned NumTemplParamLists
NumTemplParamLists - The number of "outer" template parameter lists.
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.
FieldDecl * getAnonField() const
unsigned getChainingSize() const
SourceLocation getTypeSpecStartLoc() const
SourceLocation getInnerLocStart() const
getInnerLocStart - Return SourceLocation representing start of source range ignoring outer template d...
bool usesSEHTry() const
Indicates the function uses __try.
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.
static bool classof(const Decl *D)
void setInClassInitializer(Expr *Init)
setInClassInitializer - Set the C++11 in-class initializer for this member.
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)
capture_iterator capture_end()
Stmt ** getInitAddress()
Retrieve the address of the initializer expression.
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.
const Type * getTypeForDecl() const
unsigned param_size() const
const Type * getTypePtrOrNull() const
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
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.
bool isConcept() const
Whether this variable is (C++ Concepts TS) concept.
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.
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()
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.
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
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
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.
TagDecl * getDefinition() const
getDefinition - Returns the TagDecl that actually defines this struct/union/class/enum.
static DeclContext * castToDeclContext(const NamespaceDecl *D)
Linkage getFormalLinkage() const
Get the linkage from a semantic point of view.
void setStorageClass(StorageClass SC)
ObjCStringFormatFamily getObjCFStringFormattingFamily() const
This template specialization was implicitly instantiated from a template.
bool hasNameForLinkage() const
Is this tag type named, either directly or via being defined in a typedef of this type...
const VarDecl * getCanonicalDecl() const
RecordDecl * getDefinition() const
getDefinition - Returns the RecordDecl that actually defines this struct/union/class.
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
void setDeclContext(DeclContext *DC)
setDeclContext - Set both the semantic and lexical DeclContext to 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
getAnyInitializer - Get the initializer for this variable, no matter which declaration it is attached...
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
doesThisDeclarationHaveABody - Returns whether this specific declaration of the function has a body -...
QualifierInfo - A struct with extended info about a syntactic name qualifier, to be used for the case...
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.
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
getOuterLocStart - Return SourceLocation representing start of source range taking into account any o...
Encodes a location in the source.
enumerator_range enumerators() const
static DeclContext * castToDeclContext(const TranslationUnitDecl *D)
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
isLocalVarDecl - Returns true for local variable declarations other than parameters.
capture_const_iterator capture_end() const
LabelDecl - Represents the declaration of a label.
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.
static bool classof(const Decl *D)
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
virtual Stmt * getBody() const
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
ASTContext & getASTContext() const
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
IndirectFieldDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given 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
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
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
printQualifiedName - Returns human-readable qualified name for declaration, like A::B::i, for i being member of namespace A::B.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
void setVirtualAsWritten(bool V)
DeclarationNameLoc - Additional source/type location info for a declaration name. ...
static const char * getStorageClassSpecifierString(StorageClass SC)
getStorageClassSpecifierString - Return the string used to specify the storage class SC...
Decl * getBlockManglingContextDecl() const
decl_iterator - Iterates through the declarations stored within this context.
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
isAnonymousStructOrUnion - Whether this is an anonymous struct or union.
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)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
FunctionDecl * getNextRedeclarationImpl() override
Returns the next redeclaration or itself if this is the only decl.
bool hasUnparsedDefaultArg() const
hasUnparsedDefaultArg - Determines whether this parameter has a default argument that has not yet bee...
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
getPromotionType - Return the integer type that enumerators should promote to.
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)
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
bool isFreeStanding() const
const llvm::APSInt & getInitVal() const
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
IdentifierNamespace
IdentifierNamespace - The different namespaces in which declarations may appear.
bool hasWrittenPrototype() const
TLSKind
Kinds of thread-local storage.
DeclarationName - The name of a declaration.
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
isThisDeclarationADefinition - Returns whether this specific declaration of the function is also a de...
SourceLocation getLocStart() const LLVM_READONLY
EnumDecl - Represents an enum.
unsigned getFunctionScopeDepth() const
detail::InMemoryDirectory::const_iterator E
static bool classof(const Decl *D)
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
Tags, declared with 'struct foo;' and referenced with 'struct foo'.
void setPreviousDeclInSameBlockScope(bool Same)
DefinitionKind hasDefinition() const
static LabelDecl * CreateDeserialized(ASTContext &C, unsigned ID)
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it).
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.
static const TypeInfo & getInfo(unsigned id)
void setUnparsedDefaultArg()
setUnparsedDefaultArg - Specify that this parameter has an unparsed default argument.
NonParmVarDeclBitfields NonParmVarDeclBits
Expr * getUninstantiatedDefaultArg()
SourceLocation getCaretLocation() const
bool TypeAlias
Whether this template specialization type is a substituted type alias.
const T * getAs() const
Member-template getAs<specific type>'.
Decl::Kind getDeclKind() const
static ImplicitParamDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType T)
static ImplicitParamDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc)
QualType getIntegerType() const
getIntegerType - Return the integer type this enum decl corresponds to.
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()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
SourceLocation getAsmLoc() const
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO)...
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
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)
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
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.
ImplicitParamDecl *const * param_iterator
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)
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.
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
void setDefaultArg(Expr *defarg)
void setTSCSpec(ThreadStorageClassSpecifier TSC)
TypeSourceInfo * getSignatureAsWritten() const
llvm::iterator_range< param_const_iterator > param_const_range
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
void setDescribedVarTemplate(VarTemplateDecl *Template)
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
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
APValue * getEvaluatedValue() const
Return the already-evaluated value of this variable's initializer, or NULL if the value is not yet kn...
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)
const VarDecl * getActingDefinition() const
const IndirectFieldDecl * getCanonicalDecl() const
bool isNested() const
Whether this is a nested capture, i.e.
StringLiteral - This represents a string literal expression, e.g.
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
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)
NamedDecl * getMostRecentDecl()
DefinitionKind isThisDeclarationADefinition() const
EnumConstantDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, Expr *E, const llvm::APSInt &V)
SourceLocation getInnerLocStart() const
getInnerLocStart - Return SourceLocation representing start of source range ignoring outer template d...
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.
A trivial tuple used to represent a source range.
SourceLocation getLocation() const
void setIntegerTypeSourceInfo(TypeSourceInfo *TInfo)
Set the underlying integer type source info.
NamedDecl - This represents a decl with a name.
DeclarationNameInfo getNameInfo() const
void setTypeSourceInfo(TypeSourceInfo *newType)
Represents a C array with a specified size that is not an integer-constant-expression.
EnumDecl * getDefinition() const
Automatic storage duration (most local variables).
bool hasImplicitReturnZero() const
Whether falling off this function implicitly returns null/zero.
const NamespaceDecl * getCanonicalDecl() const
TypeSourceInfo * getTypeSourceInfo() const
static bool classofKind(Kind K)
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
hasLocalStorage - Returns true if a variable with function scope is a non-static local variable...
void setRBraceLoc(SourceLocation L)
const RecordDecl * getParent() const
getParent - Returns the parent of this field declaration, which is the struct in which this method is...
void setTemplateParameterListsInfo(ASTContext &Context, ArrayRef< TemplateParameterList * > TPLists)
setTemplateParameterListsInfo - Sets info about "outer" template parameter lists. ...
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
hasInClassInitializer - Determine whether this member has a C++11 in-class initializer.
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.