15#ifndef LLVM_CLANG_AST_DECLCXX_H
16#define LLVM_CLANG_AST_DECLCXX_H
37#include "llvm/ADT/ArrayRef.h"
38#include "llvm/ADT/DenseMap.h"
39#include "llvm/ADT/PointerIntPair.h"
40#include "llvm/ADT/PointerUnion.h"
41#include "llvm/ADT/STLExtras.h"
42#include "llvm/ADT/TinyPtrVector.h"
43#include "llvm/ADT/iterator_range.h"
44#include "llvm/Support/Casting.h"
45#include "llvm/Support/Compiler.h"
46#include "llvm/Support/PointerLikeTypeTraits.h"
47#include "llvm/Support/TrailingObjects.h"
57class ClassTemplateDecl;
58class ConstructorUsingShadowDecl;
61class CXXConstructorDecl;
62class CXXDestructorDecl;
63class CXXFinalOverriderMap;
64class CXXIndirectPrimaryBaseSet;
66class DecompositionDecl;
68class FunctionTemplateDecl;
70class MemberSpecializationInfo;
73class TemplateParameterList;
92 :
Decl(AccessSpec, DC, ASLoc), ColonLoc(ColonLoc) {
98 virtual void anchor();
157 LLVM_PREFERRED_TYPE(
bool)
158 unsigned Virtual : 1;
164 LLVM_PREFERRED_TYPE(
bool)
165 unsigned BaseOfClass : 1;
176 LLVM_PREFERRED_TYPE(
bool)
177 unsigned InheritConstructors : 1;
189 :
Range(R), EllipsisLoc(EllipsisLoc), Virtual(
V), BaseOfClass(BC),
190 Access(A), InheritConstructors(
false), BaseTypeInfo(TInfo) {}
217 InheritConstructors = Inherit;
274 enum SpecialMemberFlags {
275 SMF_DefaultConstructor = 0x1,
276 SMF_CopyConstructor = 0x2,
277 SMF_MoveConstructor = 0x4,
278 SMF_CopyAssignment = 0x8,
279 SMF_MoveAssignment = 0x10,
280 SMF_Destructor = 0x20,
292 struct DefinitionData {
293 #define FIELD(Name, Width, Merge) \
294 unsigned Name : Width;
295 #include "CXXRecordDeclDefinitionBits.def"
298 LLVM_PREFERRED_TYPE(
bool)
299 unsigned IsLambda : 1;
302 LLVM_PREFERRED_TYPE(
bool)
303 unsigned IsParsingBaseSpecifiers : 1;
307 LLVM_PREFERRED_TYPE(
bool)
308 unsigned ComputedVisibleConversions : 1;
310 LLVM_PREFERRED_TYPE(
bool)
311 unsigned HasODRHash : 1;
314 unsigned ODRHash = 0;
317 unsigned NumBases = 0;
320 unsigned NumVBases = 0;
334 LazyASTUnresolvedSet Conversions;
341 LazyASTUnresolvedSet VisibleConversions;
344 CXXRecordDecl *Definition;
352 DefinitionData(CXXRecordDecl *
D);
355 CXXBaseSpecifier *getBases()
const {
356 if (!Bases.isOffset())
357 return Bases.get(
nullptr);
358 return getBasesSlowCase();
362 CXXBaseSpecifier *getVBases()
const {
363 if (!VBases.isOffset())
364 return VBases.get(
nullptr);
365 return getVBasesSlowCase();
368 ArrayRef<CXXBaseSpecifier> bases()
const {
return {getBases(), NumBases}; }
370 ArrayRef<CXXBaseSpecifier> vbases()
const {
371 return {getVBases(), NumVBases};
375 CXXBaseSpecifier *getBasesSlowCase()
const;
376 CXXBaseSpecifier *getVBasesSlowCase()
const;
379 struct DefinitionData *DefinitionData;
382 struct LambdaDefinitionData :
public DefinitionData {
394 unsigned DependencyKind : 2;
397 LLVM_PREFERRED_TYPE(
bool)
398 unsigned IsGenericLambda : 1;
402 unsigned CaptureDefault : 2;
405 unsigned NumCaptures : 15;
408 unsigned NumExplicitCaptures : 12;
411 LLVM_PREFERRED_TYPE(
bool)
412 unsigned HasKnownInternalLinkage : 1;
420 unsigned IndexInContext;
432 llvm::TinyPtrVector<Capture*> Captures;
435 TypeSourceInfo *MethodTyInfo;
437 LambdaDefinitionData(CXXRecordDecl *
D, TypeSourceInfo *Info,
unsigned DK,
439 : DefinitionData(
D), DependencyKind(DK), IsGenericLambda(IsGeneric),
440 CaptureDefault(CaptureDefault), NumCaptures(0),
441 NumExplicitCaptures(0), HasKnownInternalLinkage(0),
ManglingNumber(0),
442 IndexInContext(0), MethodTyInfo(Info) {
448 PlainOldData =
false;
452 void AddCaptureList(ASTContext &Ctx, Capture *CaptureList);
455 struct DefinitionData *dataPtr()
const {
458 return DefinitionData;
461 struct DefinitionData &data()
const {
462 auto *DD = dataPtr();
463 assert(DD &&
"queried property of class with no definition");
467 struct LambdaDefinitionData &getLambdaData()
const {
470 auto *DD = DefinitionData;
471 assert(DD && DD->IsLambda &&
"queried lambda property of non-lambda class");
472 return static_cast<LambdaDefinitionData&
>(*DD);
484 llvm::PointerUnion<ClassTemplateDecl *, MemberSpecializationInfo *>
485 TemplateOrInstantiation;
489 void addedClassSubobject(CXXRecordDecl *
Base);
496 void addedMember(Decl *
D);
498 void markedVirtualFunctionPure();
502 FriendDecl *getFirstFriend()
const;
507 bool hasSubobjectAtOffsetZeroOfEmptyBaseType(ASTContext &Ctx,
508 const CXXRecordDecl *
X);
512 SourceLocation StartLoc, SourceLocation IdLoc,
513 IdentifierInfo *
Id, CXXRecordDecl *PrevDecl);
531 return cast_or_null<CXXRecordDecl>(
540 return cast<CXXRecordDecl>(
551 auto *DD = DefinitionData ? DefinitionData : dataPtr();
552 return DD ? DD->Definition :
nullptr;
569 unsigned DependencyKind,
bool IsGeneric,
575 return data().Polymorphic || data().NumVBases != 0;
593 return data().IsParsingBaseSpecifiers;
606 llvm::iterator_range<base_class_const_iterator>;
648 llvm::iterator_range<specific_decl_iterator<CXXMethodDecl>>;
668 llvm::iterator_range<specific_decl_iterator<CXXConstructorDecl>>;
682 class friend_iterator;
692 return data().FirstFriend.isValid();
699 (data().DeclaredSpecialMembers & SMF_CopyConstructor)) &&
700 "this property has not yet been computed by Sema");
701 return data().DefaultedCopyConstructorIsDeleted;
708 (data().DeclaredSpecialMembers & SMF_MoveConstructor)) &&
709 "this property has not yet been computed by Sema");
710 return data().DefaultedMoveConstructorIsDeleted;
716 (data().DeclaredSpecialMembers & SMF_Destructor)) &&
717 "this property has not yet been computed by Sema");
718 return data().DefaultedDestructorIsDeleted;
725 !data().DefaultedCopyConstructorIsDeleted;
732 !data().DefaultedMoveConstructorIsDeleted;
739 !data().DefaultedCopyAssignmentIsDeleted;
746 !data().DefaultedMoveAssignmentIsDeleted;
753 !data().DefaultedDestructorIsDeleted;
758 return (data().DeclaredSpecialMembers & SMF_DefaultConstructor) ||
767 return (!data().UserDeclaredConstructor &&
768 !(data().DeclaredSpecialMembers & SMF_DefaultConstructor) &&
773 (data().HasInheritedDefaultConstructor &&
774 !(data().DeclaredSpecialMembers & SMF_DefaultConstructor));
781 return data().UserDeclaredConstructor;
787 return data().UserProvidedDefaultConstructor;
794 return data().UserDeclaredSpecialMembers & SMF_CopyConstructor;
800 return !(data().DeclaredSpecialMembers & SMF_CopyConstructor);
812 if (data().UserDeclaredSpecialMembers &
813 (SMF_MoveConstructor | SMF_MoveAssignment))
815 return data().NeedOverloadResolutionForCopyConstructor;
821 return data().ImplicitCopyConstructorCanHaveConstParamForNonVBase &&
823 data().ImplicitCopyConstructorCanHaveConstParamForVBase);
829 return data().HasDeclaredCopyConstructorWithConstParam ||
840 return data().UserDeclaredSpecialMembers &
841 (SMF_MoveConstructor | SMF_MoveAssignment);
847 return data().UserDeclaredSpecialMembers & SMF_MoveConstructor;
852 return (data().DeclaredSpecialMembers & SMF_MoveConstructor) ||
859 assert((data().DefaultedCopyConstructorIsDeleted ||
861 "Copy constructor should not be deleted");
862 data().DefaultedCopyConstructorIsDeleted =
true;
868 assert((data().DefaultedMoveConstructorIsDeleted ||
870 "move constructor should not be deleted");
871 data().DefaultedMoveConstructorIsDeleted =
true;
877 assert((data().DefaultedDestructorIsDeleted ||
879 "destructor should not be deleted");
880 data().DefaultedDestructorIsDeleted =
true;
887 data().DefaultedDestructorIsConstexpr = data().NumVBases == 0;
893 return !(data().DeclaredSpecialMembers & SMF_MoveConstructor) &&
903 return data().NeedOverloadResolutionForMoveConstructor;
911 return data().UserDeclaredSpecialMembers & SMF_CopyAssignment;
917 assert((data().DefaultedCopyAssignmentIsDeleted ||
919 "copy assignment should not be deleted");
920 data().DefaultedCopyAssignmentIsDeleted =
true;
926 return !(data().DeclaredSpecialMembers & SMF_CopyAssignment);
938 if (data().UserDeclaredSpecialMembers &
939 (SMF_MoveConstructor | SMF_MoveAssignment))
941 return data().NeedOverloadResolutionForCopyAssignment;
947 return data().ImplicitCopyAssignmentHasConstParam;
954 return data().HasDeclaredCopyAssignmentWithConstParam ||
962 return data().UserDeclaredSpecialMembers & SMF_MoveAssignment;
967 return (data().DeclaredSpecialMembers & SMF_MoveAssignment) ||
974 assert((data().DefaultedMoveAssignmentIsDeleted ||
976 "move assignment should not be deleted");
977 data().DefaultedMoveAssignmentIsDeleted =
true;
984 return !(data().DeclaredSpecialMembers & SMF_MoveAssignment) &&
995 return data().NeedOverloadResolutionForMoveAssignment;
1002 return data().UserDeclaredSpecialMembers & SMF_Destructor;
1008 return !(data().DeclaredSpecialMembers & SMF_Destructor);
1014 return data().NeedOverloadResolutionForDestructor;
1020 auto *DD = DefinitionData;
1021 return DD && DD->IsLambda;
1103 LambdaDefinitionData &LambdaData = getLambdaData();
1104 return LambdaData.Captures.empty() ? nullptr : LambdaData.Captures.front();
1136 llvm::iterator_range<conversion_iterator>
1160 data().HasUninitializedReferenceMember;
1171 bool isPOD()
const {
return data().PlainOldData; }
1192 return data().HasPrivateFields;
1196 return data().HasProtectedFields;
1202 return D.HasPublicFields ||
D.HasProtectedFields ||
D.HasPrivateFields;
1242 (data().HasTrivialSpecialMembers & SMF_DefaultConstructor);
1248 return (data().DeclaredNonTrivialSpecialMembers & SMF_DefaultConstructor) ||
1250 !(data().HasTrivialSpecialMembers & SMF_DefaultConstructor));
1256 return data().HasConstexprNonCopyMoveConstructor ||
1264 return data().DefaultedDefaultConstructorIsConstexpr &&
1271 return data().HasConstexprDefaultConstructor ||
1279 return data().HasTrivialSpecialMembers & SMF_CopyConstructor;
1283 return data().HasTrivialSpecialMembersForCall & SMF_CopyConstructor;
1289 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyConstructor ||
1294 return (data().DeclaredNonTrivialSpecialMembersForCall &
1295 SMF_CopyConstructor) ||
1303 (data().HasTrivialSpecialMembers & SMF_MoveConstructor);
1308 (data().HasTrivialSpecialMembersForCall & SMF_MoveConstructor);
1314 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveConstructor) ||
1316 !(data().HasTrivialSpecialMembers & SMF_MoveConstructor));
1320 return (data().DeclaredNonTrivialSpecialMembersForCall &
1321 SMF_MoveConstructor) ||
1323 !(data().HasTrivialSpecialMembersForCall & SMF_MoveConstructor));
1329 return data().HasTrivialSpecialMembers & SMF_CopyAssignment;
1335 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyAssignment ||
1343 (data().HasTrivialSpecialMembers & SMF_MoveAssignment);
1349 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveAssignment) ||
1351 !(data().HasTrivialSpecialMembers & SMF_MoveAssignment));
1357 return data().DefaultedDestructorIsConstexpr &&
1367 return data().HasTrivialSpecialMembers & SMF_Destructor;
1371 return data().HasTrivialSpecialMembersForCall & SMF_Destructor;
1377 return !(data().HasTrivialSpecialMembers & SMF_Destructor);
1381 return !(data().HasTrivialSpecialMembersForCall & SMF_Destructor);
1385 data().HasTrivialSpecialMembersForCall =
1386 (SMF_CopyConstructor | SMF_MoveConstructor | SMF_Destructor);
1392 return !data().HasUninitializedFields ||
1393 !(data().HasDefaultedDefaultConstructor ||
1403 return data().HasIrrelevantDestructor;
1409 return data().HasNonLiteralTypeFieldsOrBases;
1415 return data().HasInheritedConstructor;
1421 return data().HasInheritedAssignment;
1459 return isLiteral() && data().StructuralIfLiteral;
1556 return RD->isLocalClass();
1673 bool LookupInDependent =
false)
const;
1723 assert(DeclAccess !=
AS_none);
1725 return (PathAccess > DeclAccess ? PathAccess : DeclAccess);
1766 assert(
isLambda() &&
"Not a lambda closure type!");
1767 return getLambdaData().ManglingNumber;
1773 assert(
isLambda() &&
"Not a lambda closure type!");
1774 return getLambdaData().HasKnownInternalLinkage;
1791 assert(
isLambda() &&
"Not a lambda closure type!");
1792 return getLambdaData().IndexInContext;
1857 return getLambdaData().DependencyKind;
1861 return getLambdaData().MethodTyInfo;
1865 assert(DefinitionData && DefinitionData->IsLambda &&
1866 "setting lambda property of non-lambda class");
1867 auto &DL =
static_cast<LambdaDefinitionData &
>(*DefinitionData);
1868 DL.MethodTyInfo = TS;
1872 getLambdaData().DependencyKind =
Kind;
1876 assert(DefinitionData && DefinitionData->IsLambda &&
1877 "setting lambda property of non-lambda class");
1878 auto &DL =
static_cast<LambdaDefinitionData &
>(*DefinitionData);
1879 DL.IsGenericLambda = IsGeneric;
1917 return K >= firstCXXRecord && K <= lastCXXRecord;
1925 llvm::PointerIntPair<Expr *, 2, ExplicitSpecKind> ExplicitSpec{
1939 ExplicitSpec.getPointer();
1955 !ExplicitSpec.getPointer();
1980 void anchor()
override;
2000 :
FunctionDecl(CXXDeductionGuide,
C, DC, StartLoc, NameInfo,
T, TInfo,
2002 TrailingRequiresClause),
2003 Ctor(Ctor), ExplicitSpec(ES),
2004 SourceDeductionGuide(GeneratedFrom, SourceKind) {
2010 CXXConstructorDecl *Ctor;
2011 ExplicitSpecifier ExplicitSpec;
2015 llvm::PointerIntPair<
const CXXDeductionGuideDecl *, 2,
2017 SourceDeductionGuide;
2018 void setExplicitSpecifier(ExplicitSpecifier ES) { ExplicitSpec = ES; }
2056 return SourceDeductionGuide.getPointer();
2060 SourceDeductionGuide.setPointer(DG);
2064 return SourceDeductionGuide.getInt();
2068 SourceDeductionGuide.setInt(SK);
2100 :
Decl(RequiresExprBody, DC, StartLoc),
DeclContext(RequiresExprBody) {}
2130 void anchor()
override;
2140 isInline, ConstexprKind, TrailingRequiresClause) {
2146 static CXXMethodDecl *
2147 Create(ASTContext &
C, CXXRecordDecl *RD, SourceLocation StartLoc,
2148 const DeclarationNameInfo &NameInfo, QualType
T, TypeSourceInfo *TInfo,
2151 const AssociatedConstraint &TrailingRequiresClause = {});
2177 return OOK == OO_New || OOK == OO_Array_New || OOK == OO_Delete ||
2178 OOK == OO_Array_Delete;
2203 bool IsAppleKext)
const {
2233 return cast<CXXMethodDecl>(
2249 llvm::TinyPtrVector<const CXXMethodDecl *>::const_iterator>;
2327 bool MayBeBase =
false);
2331 bool MayBeBase =
false)
const {
2339 bool MayBeBase =
false);
2342 bool MayBeBase =
false)
const {
2350 return K >= firstCXXMethod && K <= lastCXXMethod;
2373 llvm::PointerUnion<TypeSourceInfo *, FieldDecl *, IndirectFieldDecl *>
2396 LLVM_PREFERRED_TYPE(
bool)
2397 unsigned IsDelegating : 1;
2401 LLVM_PREFERRED_TYPE(
bool)
2402 unsigned IsVirtual : 1;
2406 LLVM_PREFERRED_TYPE(
bool)
2407 unsigned IsWritten : 1;
2411 unsigned SourceOrder : 13;
2442 return isa<TypeSourceInfo *>(Initializee) && !IsDelegating;
2454 return isa<IndirectFieldDecl *>(Initializee);
2464 return Init->getStmtClass() == Stmt::CXXDefaultInitExprClass;
2470 return isa<TypeSourceInfo *>(Initializee) && IsDelegating;
2482 return MemberOrEllipsisLocation;
2511 return cast<FieldDecl *>(Initializee);
2517 return cast<FieldDecl *>(Initializee);
2519 return cast<IndirectFieldDecl *>(Initializee)->getAnonField();
2525 return cast<IndirectFieldDecl *>(Initializee);
2530 return MemberOrEllipsisLocation;
2546 return IsWritten ?
static_cast<int>(SourceOrder) : -1;
2557 assert(!IsWritten &&
2558 "setSourceOrder() used on implicit initializer");
2559 assert(SourceOrder == 0 &&
2560 "calling twice setSourceOrder() on the same initializer");
2562 "setSourceOrder() used to make an initializer implicit");
2564 SourceOrder =
static_cast<unsigned>(Pos);
2583 : Shadow(Shadow), BaseCtor(BaseCtor) {}
2585 explicit operator bool()
const {
return Shadow; }
2603 private llvm::TrailingObjects<CXXConstructorDecl, InheritedConstructor,
2604 ExplicitSpecifier> {
2621 void anchor()
override;
2623 size_t numTrailingObjects(OverloadToken<InheritedConstructor>)
const {
2629 return *getTrailingObjects<ExplicitSpecifier>();
2636 enum TrailingAllocKind {
2637 TAKInheritsConstructor = 1,
2638 TAKHasTailExplicit = 1 << 1,
2641 uint64_t getTrailingAllocKind()
const {
2644 Kind |= TAKInheritsConstructor;
2646 Kind |= TAKHasTailExplicit;
2656 uint64_t AllocKind);
2668 "cannot set this explicit specifier. no trail-allocated space for "
2702 const auto *ConstThis =
this;
2721 std::reverse_iterator<init_const_iterator>;
2749 numCtorInitializers &&
"NumCtorInitializers overflow!");
2753 CtorInitializers = Initializers;
2789 unsigned TypeQuals = 0;
2803 unsigned TypeQuals = 0;
2876 Expr *OperatorDeleteThisArg =
nullptr;
2889 void anchor()
override;
2892 static CXXDestructorDecl *
2893 Create(ASTContext &
C, CXXRecordDecl *RD, SourceLocation StartLoc,
2894 const DeclarationNameInfo &NameInfo, QualType
T, TypeSourceInfo *TInfo,
2895 bool UsesFPIntrin,
bool isInline,
bool isImplicitlyDeclared,
2897 const AssociatedConstraint &TrailingRequiresClause = {});
2946 EndLocation, TrailingRequiresClause),
2948 void anchor()
override;
3010 virtual void anchor();
3113 :
NamedDecl(UsingDirective, DC, IdentLoc, getName()), UsingLoc(UsingLoc),
3114 NamespaceLoc(NamespcLoc), QualifierLoc(QualifierLoc),
3115 NominatedNamespace(Nominated), CommonAncestor(CommonAncestor) {}
3125 void anchor()
override;
3145 return NominatedNamespace;
3219 QualifierLoc(QualifierLoc), Namespace(Namespace) {}
3221 void anchor()
override;
3266 if (
auto *AD = dyn_cast<NamespaceAliasDecl>(Namespace))
3269 return cast<NamespaceDecl>(Namespace);
3302 public Mergeable<LifetimeExtendedTemporaryDecl> {
3306 Stmt *ExprWithTemporary =
nullptr;
3311 unsigned ManglingNumber;
3315 LLVM_DECLARE_VIRTUAL_ANCHOR_FUNCTION();
3320 ExprWithTemporary(Temp), ExtendingDecl(EDecl),
3321 ManglingNumber(Mangling) {}
3324 :
Decl(
Decl::LifetimeExtendedTemporary, EmptyShell{}) {}
3328 unsigned Mangling) {
3370 return K == Decl::LifetimeExtendedTemporary;
3403 void anchor()
override;
3415 UsingShadowDecl *getMostRecentDeclImpl()
override {
3462 assert(ND &&
"Target decl is null!");
3478 return dyn_cast_or_null<UsingShadowDecl>(UsingOrNextShadow);
3483 return K == Decl::UsingShadow || K == Decl::ConstructorUsingShadow;
3496 llvm::PointerIntPair<UsingShadowDecl *, 1, bool> FirstUsingShadow;
3503 void anchor()
override;
3536 Current = Current->getNextUsingShadowDecl();
3547 return x.Current == y.Current;
3550 return x.Current != y.Current;
3600 UsingLocation(UL), QualifierLoc(QualifierLoc),
3605 void anchor()
override;
3643 bool HasTypenameKeyword);
3686 LLVM_PREFERRED_TYPE(
bool)
3687 unsigned IsVirtual : 1;
3691 bool TargetInVirtualBase)
3693 Using->getDeclName(), Using,
3694 Target->getUnderlyingDecl()),
3695 NominatedBaseClassShadowDecl(
3696 dyn_cast<ConstructorUsingShadowDecl>(
Target)),
3697 ConstructedBaseClassShadowDecl(NominatedBaseClassShadowDecl),
3698 IsVirtual(TargetInVirtualBase) {
3702 if (NominatedBaseClassShadowDecl &&
3703 NominatedBaseClassShadowDecl->constructsVirtualBase()) {
3704 ConstructedBaseClassShadowDecl =
3705 NominatedBaseClassShadowDecl->ConstructedBaseClassShadowDecl;
3713 void anchor()
override;
3747 return NominatedBaseClassShadowDecl;
3753 return ConstructedBaseClassShadowDecl;
3763 return cast<CXXRecordDecl>((ConstructedBaseClassShadowDecl
3764 ? ConstructedBaseClassShadowDecl
3796 :
BaseUsingDecl(UsingEnum, DC, NL, DN), UsingLocation(UL), EnumLocation(EL),
3799 void anchor()
override;
3867 private llvm::TrailingObjects<UsingPackDecl, NamedDecl *> {
3873 unsigned NumExpansions;
3878 InstantiatedFrom ? InstantiatedFrom->getLocation()
3880 InstantiatedFrom ? InstantiatedFrom->getDeclName()
3882 InstantiatedFrom(InstantiatedFrom), NumExpansions(UsingDecls.size()) {
3883 llvm::uninitialized_copy(UsingDecls, getTrailingObjects());
3886 void anchor()
override;
3901 return getTrailingObjects(NumExpansions);
3909 unsigned NumExpansions);
3912 return InstantiatedFrom->getSourceRange();
3934 public Mergeable<UnresolvedUsingValueDecl> {
3955 UsingLocation(UsingLoc), EllipsisLoc(EllipsisLoc),
3956 QualifierLoc(QualifierLoc), DNLoc(NameInfo.
getInfo()) {}
3958 void anchor()
override;
4031 public Mergeable<UnresolvedUsingTypenameDecl> {
4049 :
TypeDecl(UnresolvedUsingTypename, DC, TargetNameLoc, TargetName,
4051 TypenameLocation(TypenameLoc), EllipsisLoc(EllipsisLoc),
4052 QualifierLoc(QualifierLoc) {}
4054 void anchor()
override;
4116 void anchor()
override;
4131 llvm::PointerIntPair<Expr *, 1, bool> AssertExprAndFailed;
4138 :
Decl(StaticAssert, DC, StaticAssertLoc),
4139 AssertExprAndFailed(AssertExpr, Failed), Message(Message),
4140 RParenLoc(RParenLoc) {}
4142 virtual void anchor();
4159 bool isFailed()
const {
return AssertExprAndFailed.getInt(); }
4186 Expr *Binding =
nullptr;
4192 void anchor()
override;
4219 this->Binding = Binding;
4243 private llvm::TrailingObjects<DecompositionDecl, BindingDecl *> {
4245 unsigned NumBindings;
4251 :
VarDecl(Decomposition,
C, DC, StartLoc, LSquareLoc,
nullptr,
T, TInfo,
4254 llvm::uninitialized_copy(
Bindings, getTrailingObjects());
4256 B->setDecomposedDecl(
this);
4257 if (B->isParameterPack() && B->getBinding()) {
4259 NestedBD->setDecomposedDecl(
this);
4265 void anchor()
override;
4278 unsigned NumBindings);
4282 return getTrailingObjects(NumBindings);
4296 PackBindings =
Bindings.front()->getBindingPackDecls();
4300 return llvm::concat<BindingDecl *const>(std::move(BeforePackBindings),
4301 std::move(PackBindings),
4345 GetterId(Getter), SetterId(Setter) {}
4347 void anchor()
override;
4392 public llvm::FoldingSetNode {
4404 void anchor()
override;
4430 ID.AddInteger(
P.Part1);
4431 ID.AddInteger(
P.Part2);
4432 ID.AddInteger(
P.Part3);
4433 ID.AddInteger(
P.getPart4And5AsUint64());
4448 public Mergeable<UnnamedGlobalConstantDecl>,
4449 public llvm::FoldingSetNode {
4454 void anchor()
override;
4492const StreamingDiagnostic &
operator<<(
const StreamingDiagnostic &DB,
const LambdaCapture * Capture
enum clang::sema::@1840::IndirectLocalPathEntry::EntryKind Kind
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the LambdaCapture class.
Defines several types used to describe C++ lambda expressions that are shared between the parser and ...
Defines the clang::LangOptions interface.
llvm::MachO::Target Target
Defines an enumeration for C++ overloaded operators.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
Defines the clang::TypeLoc interface and its subclasses.
NestedNameSpecifier Specifier
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
void Profile(llvm::FoldingSetNodeID &ID) const
profile this value.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Reads an AST files chain containing the contents of a translation unit.
An object for streaming information to a record.
Writes an AST file containing the contents of a translation unit.
Represents an access specifier followed by colon ':'.
static AccessSpecDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static AccessSpecDecl * Create(ASTContext &C, AccessSpecifier AS, DeclContext *DC, SourceLocation ASLoc, SourceLocation ColonLoc)
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
static bool classof(const Decl *D)
static bool classofKind(Kind K)
SourceLocation getAccessSpecifierLoc() const
The location of the access specifier.
void setAccessSpecifierLoc(SourceLocation ASLoc)
Sets the location of the access specifier.
void setColonLoc(SourceLocation CLoc)
Sets the location of the colon.
Iterates through the using shadow declarations associated with this using declaration.
shadow_iterator()=default
reference operator*() const
pointer operator->() const
shadow_iterator & operator++()
std::forward_iterator_tag iterator_category
shadow_iterator(UsingShadowDecl *C)
friend bool operator==(shadow_iterator x, shadow_iterator y)
shadow_iterator operator++(int)
friend bool operator!=(shadow_iterator x, shadow_iterator y)
std::ptrdiff_t difference_type
Represents a C++ declaration that introduces decls from somewhere else.
llvm::iterator_range< shadow_iterator > shadow_range
bool getShadowFlag() const
A bool flag for use by a derived type.
unsigned shadow_size() const
Return the number of shadowed declarations associated with this using declaration.
void addShadowDecl(UsingShadowDecl *S)
shadow_range shadows() const
shadow_iterator shadow_end() const
static bool classofKind(Kind K)
BaseUsingDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
shadow_iterator shadow_begin() const
void setShadowFlag(bool V)
A bool flag a derived type may set.
void removeShadowDecl(UsingShadowDecl *S)
static bool classof(const Decl *D)
A binding in a decomposition declaration.
VarDecl * getHoldingVar() const
Get the variable (if any) that holds the value of evaluating the binding.
ValueDecl * getDecomposedDecl() const
Get the decomposition declaration that this binding represents a decomposition of.
Expr * getBinding() const
Get the expression to which this declaration is bound.
static bool classof(const Decl *D)
void setBinding(QualType DeclaredType, Expr *Binding)
Set the binding for this BindingDecl, along with its declared type (which should be a possibly-cv-qua...
void setDecomposedDecl(ValueDecl *Decomposed)
Set the decomposed variable for this BindingDecl.
ArrayRef< BindingDecl * > getBindingPackDecls() const
static BindingDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classofKind(Kind K)
Represents a path from a specific derived class (which is not represented as part of the path) to a p...
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
Represents a base class of a C++ class.
void setInheritConstructors(bool Inherit=true)
Set that this base class's constructors should be inherited.
SourceLocation getBeginLoc() const LLVM_READONLY
AccessSpecifier getAccessSpecifierAsWritten() const
Retrieves the access specifier as written in the source code (which may mean that no access specifier...
CXXBaseSpecifier(SourceRange R, bool V, bool BC, AccessSpecifier A, TypeSourceInfo *TInfo, SourceLocation EllipsisLoc)
SourceLocation getEllipsisLoc() const
For a pack expansion, determine the location of the ellipsis.
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
QualType getType() const
Retrieves the type of the base class.
TypeSourceInfo * getTypeSourceInfo() const
Retrieves the type and source location of the base class.
CXXBaseSpecifier()=default
bool getInheritConstructors() const
Determine whether this base class's constructors get inherited.
bool isPackExpansion() const
Determine whether this base specifier is a pack expansion.
SourceLocation getBaseTypeLoc() const LLVM_READONLY
Get the location at which the base class type was written.
SourceLocation getEndLoc() const LLVM_READONLY
bool isBaseOfClass() const
Determine whether this base class is a base of a class declared with the 'class' keyword (vs.
SourceRange getSourceRange() const LLVM_READONLY
Retrieves the source range that contains the entire base specifier.
AccessSpecifier getAccessSpecifier() const
Returns the access specifier for this base specifier.
Represents a C++ constructor within a class.
init_const_iterator init_end() const
Retrieve an iterator past the last initializer.
init_iterator init_end()
Retrieve an iterator past the last initializer.
std::reverse_iterator< init_iterator > init_reverse_iterator
std::reverse_iterator< init_const_iterator > init_const_reverse_iterator
init_reverse_iterator init_rbegin()
CXXConstructorDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
void setInheritingConstructor(bool isIC=true)
State that this is an implicit constructor synthesized to model a call to a constructor inherited fro...
bool isExplicit() const
Return true if the declaration is already resolved to be explicit.
ExplicitSpecifier getExplicitSpecifier()
init_iterator init_begin()
Retrieve an iterator to the first initializer.
CXXConstructorDecl * getTargetConstructor() const
When this constructor delegates to another, retrieve the target.
static bool classofKind(Kind K)
static CXXConstructorDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, uint64_t AllocKind)
bool isDefaultConstructor() const
Whether this constructor is a default constructor (C++ [class.ctor]p5), which can be used to default-...
bool isDelegatingConstructor() const
Determine whether this constructor is a delegating constructor.
bool isSpecializationCopyingObject() const
Determine whether this is a member template specialization that would copy the object to itself.
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
bool isMoveConstructor() const
Determine whether this constructor is a move constructor (C++11 [class.copy]p3), which can be used to...
init_const_reverse_iterator init_rbegin() const
void setNumCtorInitializers(unsigned numCtorInitializers)
void setExplicitSpecifier(ExplicitSpecifier ES)
init_const_range inits() const
bool isCopyOrMoveConstructor() const
Determine whether this a copy or move constructor.
init_const_reverse_iterator init_rend() const
bool isInheritingConstructor() const
Determine whether this is an implicit constructor synthesized to model a call to a constructor inheri...
init_reverse_iterator init_rend()
llvm::iterator_range< init_iterator > init_range
CXXCtorInitializer *const * init_const_iterator
Iterates through the member/base initializer list.
const ExplicitSpecifier getExplicitSpecifier() const
unsigned getNumCtorInitializers() const
Determine the number of arguments used to initialize the member or base.
llvm::iterator_range< init_const_iterator > init_const_range
bool isConvertingConstructor(bool AllowExplicit) const
Whether this constructor is a converting constructor (C++ [class.conv.ctor]), which can be used for u...
const CXXConstructorDecl * getCanonicalDecl() const
static bool classof(const Decl *D)
void setCtorInitializers(CXXCtorInitializer **Initializers)
bool isCopyConstructor() const
Whether this constructor is a copy constructor (C++ [class.copy]p2, which can be used to copy the cla...
Represents a C++ conversion function within a class.
bool isLambdaToBlockPointerConversion() const
Determine whether this conversion function is a conversion from a lambda closure type to a block poin...
bool isExplicit() const
Return true if the declaration is already resolved to be explicit.
static bool classof(const Decl *D)
static bool classofKind(Kind K)
ExplicitSpecifier getExplicitSpecifier()
QualType getConversionType() const
Returns the type that this conversion function is converting to.
void setExplicitSpecifier(ExplicitSpecifier ES)
static CXXConversionDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const CXXConversionDecl * getCanonicalDecl() const
CXXConversionDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
const ExplicitSpecifier getExplicitSpecifier() const
Represents a C++ base or member initializer.
FieldDecl * getMember() const
If this is a member initializer, returns the declaration of the non-static data member being initiali...
bool isDelegatingInitializer() const
Determine whether this initializer is creating a delegating constructor.
bool isWritten() const
Determine whether this initializer is explicitly written in the source code.
Expr * getInit() const
Get the initializer.
SourceLocation getRParenLoc() const
SourceLocation getEllipsisLoc() const
SourceLocation getLParenLoc() const
SourceRange getSourceRange() const LLVM_READONLY
Determine the source range covering the entire initializer.
int getSourceOrder() const
Return the source position of the initializer, counting from 0.
SourceLocation getSourceLocation() const
Determine the source location of the initializer.
bool isAnyMemberInitializer() const
bool isPackExpansion() const
Determine whether this initializer is a pack expansion.
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
bool isMemberInitializer() const
Determine whether this initializer is initializing a non-static data member.
bool isBaseInitializer() const
Determine whether this initializer is initializing a base class.
void setSourceOrder(int Pos)
Set the source order of this initializer.
bool isIndirectMemberInitializer() const
int64_t getID(const ASTContext &Context) const
bool isInClassMemberInitializer() const
Determine whether this initializer is an implicit initializer generated for a field with an initializ...
const Type * getBaseClass() const
If this is a base class initializer, returns the type of the base class.
SourceLocation getMemberLocation() const
FieldDecl * getAnyMember() const
IndirectFieldDecl * getIndirectMember() const
TypeLoc getBaseClassLoc() const
If this is a base class initializer, returns the type of the base class with location information.
bool isBaseVirtual() const
Returns whether the base is virtual or not.
Represents a C++ deduction guide declaration.
void setDeductionCandidateKind(DeductionCandidate K)
void setSourceDeductionGuide(CXXDeductionGuideDecl *DG)
static CXXDeductionGuideDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isExplicit() const
Return true if the declaration is already resolved to be explicit.
CXXConstructorDecl * getCorrespondingConstructor() const
Get the constructor from which this deduction guide was generated, if this is an implicit deduction g...
const CXXDeductionGuideDecl * getSourceDeductionGuide() const
Get the deduction guide from which this deduction guide was generated, if it was generated as part of...
ExplicitSpecifier getExplicitSpecifier()
static bool classofKind(Kind K)
void setSourceDeductionGuideKind(SourceDeductionGuideKind SK)
TemplateDecl * getDeducedTemplate() const
Get the template for which this guide performs deduction.
DeductionCandidate getDeductionCandidateKind() const
const ExplicitSpecifier getExplicitSpecifier() const
static bool classof(const Decl *D)
SourceDeductionGuideKind getSourceDeductionGuideKind() const
Represents a C++ destructor within a class.
const FunctionDecl * getOperatorDelete() const
static CXXDestructorDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const CXXDestructorDecl * getCanonicalDecl() const
CXXDestructorDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
static bool classofKind(Kind K)
void setOperatorDelete(FunctionDecl *OD, Expr *ThisArg)
bool isCalledByDelete(const FunctionDecl *OpDel=nullptr) const
Will this destructor ever be called when considering which deallocation function is associated with t...
Expr * getOperatorDeleteThisArg() const
static bool classof(const Decl *D)
A mapping from each virtual member function to its set of final overriders.
A set of all the primary bases for a class.
Represents a static or instance method of a struct/union/class.
bool isExplicitObjectMemberFunction() const
[C++2b][dcl.fct]/p7 An explicit object member function is a non-static member function with an explic...
static bool classofKind(Kind K)
const CXXMethodDecl * getMostRecentDecl() const
CXXMethodDecl * getCorrespondingMethodDeclaredInClass(const CXXRecordDecl *RD, bool MayBeBase=false)
Find if RD declares a function that overrides this function, and if so, return it.
bool isImplicitObjectMemberFunction() const
[C++2b][dcl.fct]/p7 An implicit object member function is a non-static member function without an exp...
void addOverriddenMethod(const CXXMethodDecl *MD)
bool hasInlineBody() const
const CXXMethodDecl * getDevirtualizedMethod(const Expr *Base, bool IsAppleKext) const
bool isUsualDeallocationFunction(SmallVectorImpl< const FunctionDecl * > &PreventedBy) const
Determine whether this is a usual deallocation function (C++ [basic.stc.dynamic.deallocation]p2),...
unsigned getNumExplicitParams() const
CXXMethodDecl * getMostRecentDecl()
overridden_method_range overridden_methods() const
unsigned size_overridden_methods() const
const CXXMethodDecl *const * method_iterator
QualType getFunctionObjectParameterReferenceType() const
Return the type of the object pointed by this.
RefQualifierKind getRefQualifier() const
Retrieve the ref-qualifier associated with this method.
method_iterator begin_overridden_methods() const
const CXXRecordDecl * getParent() const
Return the parent of this method declaration, which is the class in which this method is defined.
QualType getThisType() const
Return the type of the this pointer.
bool isMoveAssignmentOperator() const
Determine whether this is a move assignment operator.
Qualifiers getMethodQualifiers() const
CXXRecordDecl * getParent()
Return the parent of this method declaration, which is the class in which this method is defined.
QualType getFunctionObjectParameterType() const
const CXXMethodDecl * getCorrespondingMethodDeclaredInClass(const CXXRecordDecl *RD, bool MayBeBase=false) const
CXXMethodDecl * getDevirtualizedMethod(const Expr *Base, bool IsAppleKext)
If it's possible to devirtualize a call to this method, return the called function.
static bool isStaticOverloadedOperator(OverloadedOperatorKind OOK)
Returns true if the given operator is implicitly static in a record context.
CXXMethodDecl * getCorrespondingMethodInClass(const CXXRecordDecl *RD, bool MayBeBase=false)
Find the method in RD that corresponds to this one.
llvm::iterator_range< llvm::TinyPtrVector< const CXXMethodDecl * >::const_iterator > overridden_method_range
static bool classof(const Decl *D)
const CXXMethodDecl * getCanonicalDecl() const
bool isCopyAssignmentOperator() const
Determine whether this is a copy-assignment operator, regardless of whether it was declared implicitl...
CXXMethodDecl(Kind DK, ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool UsesFPIntrin, bool isInline, ConstexprSpecKind ConstexprKind, SourceLocation EndLocation, const AssociatedConstraint &TrailingRequiresClause={})
static CXXMethodDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
method_iterator end_overridden_methods() const
CXXMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool isLambdaStaticInvoker() const
Determine whether this is a lambda closure type's static member function that is used for the result ...
const CXXMethodDecl * getCorrespondingMethodInClass(const CXXRecordDecl *RD, bool MayBeBase=false) const
An iterator over the friend declarations of a class.
Represents a C++ struct/union/class.
ctor_iterator ctor_end() const
bool hasCopyConstructorWithConstParam() const
Determine whether this class has a copy constructor with a parameter type which is a reference to a c...
bool hasConstexprDefaultConstructor() const
Determine whether this class has a constexpr default constructor.
bool hasMoveConstructor() const
Determine whether this class has a move constructor.
bool hasDefaultConstructor() const
Determine whether this class has any default constructors.
friend_range friends() const
friend_iterator friend_begin() const
bool hasMutableFields() const
Determine whether this class, or any of its class subobjects, contains a mutable field.
bool isHLSLIntangible() const
Returns true if the class contains HLSL intangible type, either as a field or in base class.
Decl * getLambdaContextDecl() const
Retrieve the declaration that provides additional context for a lambda, when the normal declaration c...
ctor_iterator ctor_begin() const
bool mayBeAbstract() const
Determine whether this class may end up being abstract, even though it is not yet known to be abstrac...
bool hasTrivialMoveAssignment() const
Determine whether this class has a trivial move assignment operator (C++11 [class....
void setLambdaTypeInfo(TypeSourceInfo *TS)
bool isTriviallyCopyable() const
Determine whether this class is considered trivially copyable per (C++11 [class]p6).
bool hasNonTrivialCopyAssignment() const
Determine whether this class has a non-trivial copy assignment operator (C++ [class....
TemplateParameterList * getGenericLambdaTemplateParameterList() const
Retrieve the generic lambda's template parameter list.
bool isEffectivelyFinal() const
Determine whether it's impossible for a class to be derived from this class.
bool hasSimpleMoveConstructor() const
true if we know for sure that this class has a single, accessible, unambiguous move constructor that ...
bool isAggregate() const
Determine whether this class is an aggregate (C++ [dcl.init.aggr]), which is a class with no user-dec...
void getIndirectPrimaryBases(CXXIndirectPrimaryBaseSet &Bases) const
Get the indirect primary bases for this class.
bool hasTrivialDefaultConstructor() const
Determine whether this class has a trivial default constructor (C++11 [class.ctor]p5).
void setBases(CXXBaseSpecifier const *const *Bases, unsigned NumBases)
Sets the base classes of this struct or class.
bool isGenericLambda() const
Determine whether this class describes a generic lambda function object (i.e.
base_class_iterator bases_end()
llvm::iterator_range< friend_iterator > friend_range
CXXRecordDecl * getMostRecentDecl()
bool hasPrivateFields() const
bool hasTrivialDestructor() const
Determine whether this class has a trivial destructor (C++ [class.dtor]p3)
bool hasUserDeclaredDestructor() const
Determine whether this class has a user-declared destructor.
unsigned getLambdaDependencyKind() const
void setLambdaIsGeneric(bool IsGeneric)
specific_decl_iterator< CXXConstructorDecl > ctor_iterator
Iterator access to constructor members.
bool implicitCopyConstructorHasConstParam() const
Determine whether an implicit copy constructor for this type would have a parameter with a const-qual...
bool defaultedDestructorIsDeleted() const
true if a defaulted destructor for this class would be deleted.
const FunctionDecl * isLocalClass() const
If the class is a local class [class.local], returns the enclosing function declaration.
bool hasInheritedAssignment() const
Determine whether this class has a using-declaration that names a base class assignment operator.
bool hasUninitializedReferenceMember() const
Whether this class or any of its subobjects has any members of reference type which would make value-...
bool allowConstDefaultInit() const
Determine whether declaring a const variable with this type is ok per core issue 253.
CXXRecordDecl * getInstantiatedFromMemberClass() const
If this record is an instantiation of a member class, retrieves the member class from which it was in...
bool hasTrivialDestructorForCall() const
bool hasInjectedClassType() const
Determines whether this declaration has is canonically of an injected class type.
bool defaultedMoveConstructorIsDeleted() const
true if a defaulted move constructor for this class would be deleted.
void completeDefinition() override
Indicates that the definition of this class is now complete.
base_class_const_iterator bases_end() const
bool isLiteral() const
Determine whether this class is a literal type.
bool hasUserDeclaredMoveAssignment() const
Determine whether this class has had a move assignment declared by the user.
CXXRecordDecl * getTemplateInstantiationPattern()
bool hasDeletedDestructor() const
Returns the destructor decl for this class.
bool defaultedDestructorIsConstexpr() const
Determine whether a defaulted default constructor for this class would be constexpr.
bool mayBeNonDynamicClass() const
bool isStandardLayout() const
Determine whether this class is standard-layout per C++ [class]p7.
void setCaptures(ASTContext &Context, ArrayRef< LambdaCapture > Captures)
Set the captures for this lambda closure type.
void pushFriendDecl(FriendDecl *FD)
unsigned getDeviceLambdaManglingNumber() const
Retrieve the device side mangling number.
llvm::iterator_range< capture_const_iterator > capture_const_range
bool hasKnownLambdaInternalLinkage() const
The lambda is known to has internal linkage no matter whether it has name mangling number.
specific_decl_iterator< CXXMethodDecl > method_iterator
Iterator access to method members.
bool hasProtectedFields() const
bool hasAnyDependentBases() const
Determine whether this class has any dependent base classes which are not the current instantiation.
unsigned getLambdaIndexInContext() const
Retrieve the index of this lambda within the context declaration returned by getLambdaContextDecl().
void setTrivialForCallFlags(CXXMethodDecl *MD)
const CXXRecordDecl * getPreviousDecl() const
bool isLambda() const
Determine whether this class describes a lambda function object.
bool hasTrivialMoveConstructor() const
Determine whether this class has a trivial move constructor (C++11 [class.copy]p12)
bool needsImplicitDefaultConstructor() const
Determine if we need to declare a default constructor for this class.
void viewInheritance(ASTContext &Context) const
Renders and displays an inheritance diagram for this C++ class and all of its base classes (transitiv...
bool needsImplicitMoveConstructor() const
Determine whether this class should get an implicit move constructor or if any existing special membe...
bool hasUserDeclaredCopyAssignment() const
Determine whether this class has a user-declared copy assignment operator.
capture_const_iterator captures_end() const
bool isProvablyNotDerivedFrom(const CXXRecordDecl *Base) const
Determine whether this class is provably not derived from the type Base.
void addedSelectedDestructor(CXXDestructorDecl *DD)
Notify the class that this destructor is now selected.
unsigned getLambdaManglingNumber() const
If this is the closure type of a lambda expression, retrieve the number to be used for name mangling ...
bool isNeverDependentLambda() const
bool hasFriends() const
Determines whether this record has any friends.
method_range methods() const
static bool classof(const Decl *D)
bool hasNonTrivialDestructor() const
Determine whether this class has a non-trivial destructor (C++ [class.dtor]p3)
CXXRecordDecl * getDefinition() const
bool needsOverloadResolutionForCopyAssignment() const
Determine whether we need to eagerly declare a defaulted copy assignment operator for this class.
static AccessSpecifier MergeAccess(AccessSpecifier PathAccess, AccessSpecifier DeclAccess)
Calculates the access of a decl that is reached along a path.
bool isParsingBaseSpecifiers() const
void getCaptureFields(llvm::DenseMap< const ValueDecl *, FieldDecl * > &Captures, FieldDecl *&ThisCapture) const
For a closure type, retrieve the mapping from captured variables and this to the non-static data memb...
bool hasConstexprNonCopyMoveConstructor() const
Determine whether this class has at least one constexpr constructor other than the copy or move const...
static CXXRecordDecl * CreateLambda(const ASTContext &C, DeclContext *DC, TypeSourceInfo *Info, SourceLocation Loc, unsigned DependencyKind, bool IsGeneric, LambdaCaptureDefault CaptureDefault)
llvm::iterator_range< conversion_iterator > getVisibleConversionFunctions() const
Get all conversion functions visible in current class, including conversion function templates.
bool defaultedDefaultConstructorIsConstexpr() const
Determine whether a defaulted default constructor for this class would be constexpr.
bool hasTrivialCopyConstructor() const
Determine whether this class has a trivial copy constructor (C++ [class.copy]p6, C++11 [class....
void setImplicitMoveAssignmentIsDeleted()
Set that we attempted to declare an implicit move assignment operator, but overload resolution failed...
bool hasConstexprDestructor() const
Determine whether this class has a constexpr destructor.
bool isPolymorphic() const
Whether this class is polymorphic (C++ [class.virtual]), which means that the class contains or inher...
unsigned getNumBases() const
Retrieves the number of base classes of this class.
bool hasNonLiteralTypeFieldsOrBases() const
Determine whether this class has a non-literal or/ volatile type non-static data member or base class...
base_class_const_range bases() const
bool defaultedCopyConstructorIsDeleted() const
true if a defaulted copy constructor for this class would be deleted.
bool isStructural() const
Determine whether this is a structural type.
bool hasMoveAssignment() const
Determine whether this class has a move assignment operator.
bool isTriviallyCopyConstructible() const
Determine whether this class is considered trivially copyable per.
bool hasTrivialCopyConstructorForCall() const
bool isCapturelessLambda() const
llvm::iterator_range< specific_decl_iterator< CXXMethodDecl > > method_range
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated.
bool hasInitMethod() const
bool lookupInBases(BaseMatchesCallback BaseMatches, CXXBasePaths &Paths, bool LookupInDependent=false) const
Look for entities within the base classes of this C++ class, transitively searching all base class su...
method_iterator method_begin() const
Method begin iterator.
bool lambdaIsDefaultConstructibleAndAssignable() const
Determine whether this lambda should have an implicit default constructor and copy and move assignmen...
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine whether this particular class is a specialization or instantiation of a class template or m...
base_class_iterator bases_begin()
FunctionTemplateDecl * getDependentLambdaCallOperator() const
Retrieve the dependent lambda call operator of the closure type if this is a templated closure type.
bool hasTrivialCopyAssignment() const
Determine whether this class has a trivial copy assignment operator (C++ [class.copy]p11,...
void addedEligibleSpecialMemberFunction(const CXXMethodDecl *MD, unsigned SMKind)
Notify the class that an eligible SMF has been added.
conversion_iterator conversion_end() const
base_class_range vbases()
bool hasUserProvidedDefaultConstructor() const
Whether this class has a user-provided default constructor per C++11.
base_class_iterator vbases_begin()
capture_const_range captures() const
void setImplicitMoveConstructorIsDeleted()
Set that we attempted to declare an implicit move constructor, but overload resolution failed so we d...
void finishedDefaultedOrDeletedMember(CXXMethodDecl *MD)
Indicates that the declaration of a defaulted or deleted special member function is now complete.
bool isAbstract() const
Determine whether this class has a pure virtual function.
base_class_const_iterator bases_begin() const
TypeSourceInfo * getLambdaTypeInfo() const
bool hasVariantMembers() const
Determine whether this class has any variant members.
void setImplicitCopyConstructorIsDeleted()
Set that we attempted to declare an implicit copy constructor, but overload resolution failed so we d...
CXXRecordDecl(Kind K, TagKind TK, const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl)
bool isDynamicClass() const
bool isCLike() const
True if this class is C-like, without C++-specific features, e.g.
void setInstantiationOfMemberClass(CXXRecordDecl *RD, TemplateSpecializationKind TSK)
Specify that this record is an instantiation of the member class RD.
bool hasInClassInitializer() const
Whether this class has any in-class initializers for non-static data members (including those in anon...
bool mayBeDynamicClass() const
bool needsImplicitCopyConstructor() const
Determine whether this class needs an implicit copy constructor to be lazily declared.
base_class_const_iterator vbases_end() const
bool hasIrrelevantDestructor() const
Determine whether this class has a destructor which has no semantic effect.
static CXXRecordDecl * CreateDeserialized(const ASTContext &C, GlobalDeclID ID)
bool isDependentLambda() const
Determine whether this lambda expression was known to be dependent at the time it was created,...
bool hasSimpleMoveAssignment() const
true if we know for sure that this class has a single, accessible, unambiguous move assignment operat...
bool hasNonTrivialMoveConstructor() const
Determine whether this class has a non-trivial move constructor (C++11 [class.copy]p12)
bool hasNonTrivialCopyConstructorForCall() const
bool hasDirectFields() const
Determine whether this class has direct non-static data members.
const CXXRecordDecl * getCanonicalDecl() const
MSInheritanceModel getMSInheritanceModel() const
Returns the inheritance model used for this record.
bool hasUserDeclaredCopyConstructor() const
Determine whether this class has a user-declared copy constructor.
bool isCXX11StandardLayout() const
Determine whether this class was standard-layout per C++11 [class]p7, specifically using the C++11 ru...
bool nullFieldOffsetIsZero() const
In the Microsoft C++ ABI, use zero for the field offset of a null data member pointer if we can guara...
CanQualType getCanonicalTemplateSpecializationType(const ASTContext &Ctx) const
bool hasUserDeclaredConstructor() const
Determine whether this class has any user-declared constructors.
base_class_const_iterator vbases_begin() const
llvm::iterator_range< base_class_iterator > base_class_range
unsigned getODRHash() const
LambdaNumbering getLambdaNumbering() const
llvm::iterator_range< specific_decl_iterator< CXXConstructorDecl > > ctor_range
bool hasDefinition() const
ArrayRef< NamedDecl * > getLambdaExplicitTemplateParameters() const
Retrieve the lambda template parameters that were specified explicitly.
void setImplicitCopyAssignmentIsDeleted()
Set that we attempted to declare an implicit copy assignment operator, but overload resolution failed...
bool needsImplicitDestructor() const
Determine whether this class needs an implicit destructor to be lazily declared.
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
bool isPOD() const
Whether this class is a POD-type (C++ [class]p4)
void getFinalOverriders(CXXFinalOverriderMap &FinaOverriders) const
Retrieve the final overriders for each virtual member function in the class hierarchy where this clas...
llvm::function_ref< bool(const CXXBaseSpecifier *Specifier, CXXBasePath &Path)> BaseMatchesCallback
Function type used by lookupInBases() to determine whether a specific base class subobject matches th...
void removeConversion(const NamedDecl *Old)
Removes a conversion function from this class.
MSInheritanceModel calculateInheritanceModel() const
Calculate what the inheritance model would be for this class.
bool hasSimpleCopyConstructor() const
true if we know for sure that this class has a single, accessible, unambiguous copy constructor that ...
bool isCurrentInstantiation(const DeclContext *CurContext) const
Determine whether this dependent class is a current instantiation, when viewed from within the given ...
MSVtorDispMode getMSVtorDispMode() const
Controls when vtordisps will be emitted if this record is used as a virtual base.
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
base_class_iterator vbases_end()
bool isInjectedClassName() const
Determines whether this declaration represents the injected class name.
void setInitMethod(bool Val)
bool isEmpty() const
Determine whether this is an empty class in the sense of (C++11 [meta.unary.prop]).
LambdaCaptureDefault getLambdaCaptureDefault() const
bool hasMemberName(DeclarationName N) const
Determine whether this class has a member with the given name, possibly in a non-dependent base class...
bool needsOverloadResolutionForMoveAssignment() const
Determine whether we need to eagerly declare a move assignment operator for this class.
CXXDestructorDecl * getDestructor() const
Returns the destructor decl for this class.
bool hasCopyAssignmentWithConstParam() const
Determine whether this class has a copy assignment operator with a parameter type which is a referenc...
bool hasNonTrivialMoveAssignment() const
Determine whether this class has a non-trivial move assignment operator (C++11 [class....
bool hasNonTrivialDestructorForCall() const
void setHasTrivialSpecialMemberForCall()
method_iterator method_end() const
Method past-the-end iterator.
static bool classofKind(Kind K)
capture_const_iterator captures_begin() const
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
llvm::iterator_range< base_class_const_iterator > base_class_const_range
bool hasUserDeclaredMoveOperation() const
Whether this class has a user-declared move constructor or assignment operator.
llvm::function_ref< bool(const CXXRecordDecl *BaseDefinition)> ForallBasesCallback
Function type used by forallBases() as a callback.
bool hasInheritedConstructor() const
Determine whether this class has a using-declaration that names a user-declared base class constructo...
static bool FindVirtualBaseClass(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, const CXXRecordDecl *BaseRecord)
Base-class lookup callback that determines whether the given base class specifier refers to a specifi...
CXXMethodDecl * getLambdaStaticInvoker() const
Retrieve the lambda static invoker, the address of which is returned by the conversion operator,...
bool hasNonTrivialDefaultConstructor() const
Determine whether this class has a non-trivial default constructor (C++11 [class.ctor]p5).
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
CXXRecordDecl * getDefinitionOrSelf() const
static bool FindBaseClass(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, const CXXRecordDecl *BaseRecord)
Base-class lookup callback that determines whether the given base class specifier refers to a specifi...
void setImplicitDestructorIsDeleted()
Set that we attempted to declare an implicit destructor, but overload resolution failed so we deleted...
bool hasUserDeclaredMoveConstructor() const
Determine whether this class has had a move constructor declared by the user.
bool needsImplicitMoveAssignment() const
Determine whether this class should get an implicit move assignment operator or if any existing speci...
bool hasSimpleDestructor() const
true if we know for sure that this class has an accessible destructor that is not deleted.
friend_iterator friend_end() const
void setDescribedClassTemplate(ClassTemplateDecl *Template)
bool isVirtuallyDerivedFrom(const CXXRecordDecl *Base) const
Determine whether this class is virtually derived from the class Base.
bool isInterfaceLike() const
unsigned capture_size() const
void setIsParsingBaseSpecifiers()
bool hasNonTrivialMoveConstructorForCall() const
bool needsImplicitCopyAssignment() const
Determine whether this class needs an implicit copy assignment operator to be lazily declared.
void setLambdaNumbering(LambdaNumbering Numbering)
Set the mangling numbers and context declaration for a lambda class.
bool isAnyDestructorNoReturn() const
Returns true if the class destructor, or any implicitly invoked destructors are marked noreturn.
bool forallBases(ForallBasesCallback BaseMatches) const
Determines if the given callback holds for all the direct or indirect base classes of this type.
base_class_const_range vbases() const
void setLambdaDependencyKind(unsigned Kind)
bool hasTrivialMoveConstructorForCall() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization,...
FunctionDecl * isLocalClass()
bool hasNonTrivialCopyConstructor() const
Determine whether this class has a non-trivial copy constructor (C++ [class.copy]p6,...
CXXMethodDecl * getLambdaCallOperator() const
Retrieve the lambda call operator of the closure type if this is a closure type.
const LambdaCapture * getCapture(unsigned I) const
const CXXRecordDecl * getMostRecentDecl() const
const CXXRecordDecl * getStandardLayoutBaseWithFields() const
If this is a standard-layout class or union, any and all data members will be declared in the same ty...
bool hasSimpleCopyAssignment() const
true if we know for sure that this class has a single, accessible, unambiguous copy assignment operat...
CXXRecordDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
void setTemplateSpecializationKind(TemplateSpecializationKind TSK)
Set the kind of specialization or template instantiation this is.
bool isTrivial() const
Determine whether this class is considered trivial.
unsigned getNumVBases() const
Retrieves the number of virtual base classes of this class.
conversion_iterator conversion_begin() const
CXXRecordDecl * getPreviousDecl()
bool isDerivedFrom(const CXXRecordDecl *Base) const
Determine whether this class is derived from the class Base.
bool implicitCopyAssignmentHasConstParam() const
Determine whether an implicit copy assignment operator for this type would have a parameter with a co...
Declaration of a class template.
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
const CXXRecordDecl * getParent() const
Returns the parent of this using shadow declaration, which is the class in which this is declared.
static ConstructorUsingShadowDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
CXXRecordDecl * getParent()
static bool classof(const Decl *D)
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
static bool classofKind(Kind K)
UsingDecl * getIntroducer() const
Override the UsingShadowDecl's getIntroducer, returning the UsingDecl that introduced this.
bool constructsVirtualBase() const
Returns true if the constructed base class is a virtual base class subobject of this declaration's cl...
ConstructorUsingShadowDecl * getConstructedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the base class for which we don't have an explicit ini...
ConstructorUsingShadowDecl * getNominatedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the direct base class from which this using shadow dec...
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
FunctionDeclBitfields FunctionDeclBits
CXXConstructorDeclBitfields CXXConstructorDeclBits
decl_iterator decls_end() const
LinkageSpecDeclBitfields LinkageSpecDeclBits
decl_iterator decls_begin() const
Decl - This represents one declaration (or definition), e.g.
SourceLocation getEndLoc() const LLVM_READONLY
ASTContext & getASTContext() const LLVM_READONLY
Kind
Lists the kind of concrete classes of Decl.
unsigned getIdentifierNamespace() const
void setAccess(AccessSpecifier AS)
SourceLocation getLocation() const
IdentifierNamespace
IdentifierNamespace - The different namespaces in which declarations may appear.
@ IDNS_TagFriend
This declaration is a friend class.
@ IDNS_OrdinaryFriend
This declaration is a friend function.
@ IDNS_LocalExtern
This declaration is a function-local extern declaration of a variable or function.
void setImplicit(bool I=true)
void setLocation(SourceLocation L)
DeclContext * getDeclContext()
const LangOptions & getLangOpts() const LLVM_READONLY
Helper to get the language options from the ASTContext.
DeclarationNameLoc - Additional source/type location info for a declaration name.
The name of a declaration.
TemplateDecl * getCXXDeductionGuideTemplate() const
If this name is the name of a C++ deduction guide, return the template associated with that name.
static DeclarationName getUsingDirectiveName()
Returns the name for all C++ using-directives.
Represents a ValueDecl that came out of a declarator.
A decomposition declaration.
void printName(raw_ostream &OS, const PrintingPolicy &Policy) const override
Pretty-print the unqualified name of this declaration.
ArrayRef< BindingDecl * > bindings() const
static bool classof(const Decl *D)
auto flat_bindings() const
static bool classofKind(Kind K)
static DecompositionDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned NumBindings)
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
Store information needed for an explicit specifier.
bool isExplicit() const
Determine whether this specifier is known to correspond to an explicit declaration.
ExplicitSpecKind getKind() const
bool isInvalid() const
Determine if the explicit specifier is invalid.
static ExplicitSpecifier Invalid()
static const ExplicitSpecifier getFromDecl(const FunctionDecl *Function)
const Expr * getExpr() const
ExplicitSpecifier()=default
void setKind(ExplicitSpecKind Kind)
static ExplicitSpecifier getFromDecl(FunctionDecl *Function)
bool isSpecified() const
Determine if the declaration had an explicit specifier of any kind.
bool isEquivalent(const ExplicitSpecifier Other) const
Check for equivalence of explicit specifiers.
ExplicitSpecifier(Expr *Expression, ExplicitSpecKind Kind)
This represents one expression.
Represents a member of a struct/union/class.
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Represents a function declaration or definition.
void setIsPureVirtual(bool P=true)
bool UsesFPIntrin() const
Determine whether the function was declared in source context that requires constrained FP intrinsics...
QualType getReturnType() const
FunctionDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
void setRangeEnd(SourceLocation E)
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
Represents a prototype with parameter type info, e.g.
Declaration of a template function.
FunctionType - C99 6.7.5.3 - Function Declarators.
One of these records is kept for each identifier that is lexed.
Represents a field injected from an anonymous union/struct into the parent scope.
Description of a constructor that was inherited from a base class.
InheritedConstructor()=default
CXXConstructorDecl * getConstructor() const
InheritedConstructor(ConstructorUsingShadowDecl *Shadow, CXXConstructorDecl *BaseCtor)
ConstructorUsingShadowDecl * getShadowDecl() const
Describes the capture of a variable or of this, or of a C++1y init-capture.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
const ValueDecl * getExtendingDecl() const
unsigned getManglingNumber() const
APValue * getValue() const
APValue * getOrCreateValue(bool MayCreate) const
Get the storage for the constant value of a materialized temporary of static storage duration.
static bool classof(const Decl *D)
Stmt::child_range childrenExpr()
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Stmt::const_child_range childrenExpr() const
static LifetimeExtendedTemporaryDecl * Create(Expr *Temp, ValueDecl *EDec, unsigned Mangling)
Expr * getTemporaryExpr()
Retrieve the expression to which the temporary materialization conversion was applied.
static LifetimeExtendedTemporaryDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const Expr * getTemporaryExpr() const
ValueDecl * getExtendingDecl()
static bool classofKind(Kind K)
Represents a linkage specification.
void setExternLoc(SourceLocation L)
void setLanguage(LinkageSpecLanguageIDs L)
Set the language specified by this linkage specification.
static bool classofKind(Kind K)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setRBraceLoc(SourceLocation L)
static LinkageSpecDecl * castFromDeclContext(const DeclContext *DC)
static DeclContext * castToDeclContext(const LinkageSpecDecl *D)
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
SourceLocation getExternLoc() const
SourceLocation getRBraceLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Decl *D)
static LinkageSpecDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
static bool classof(const Decl *D)
Parts getParts() const
Get the decomposed parts of this declaration.
static bool classofKind(Kind K)
static void Profile(llvm::FoldingSetNodeID &ID, Parts P)
void Profile(llvm::FoldingSetNodeID &ID)
APValue & getAsAPValue() const
Get the value of this MSGuidDecl as an APValue.
void printName(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const override
Print this UUID in a human-readable format.
An instance of this class represents the declaration of a property member.
static bool classof(const Decl *D)
IdentifierInfo * getGetterId() const
IdentifierInfo * getSetterId() const
static MSPropertyDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Provides information a specialization of a member of a class template, which may be a member function...
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
UsingDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
This represents a decl that may have a name.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
NamedDecl * getMostRecentDecl()
Represents a C++ namespace alias.
static NamespaceAliasDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const NamespaceAliasDecl * getCanonicalDecl() const
redeclarable_base::redecl_range redecl_range
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
SourceLocation getAliasLoc() const
Returns the location of the alias name, i.e.
NamespaceBaseDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
static bool classof(const Decl *D)
SourceLocation getNamespaceLoc() const
Returns the location of the namespace keyword.
SourceLocation getTargetNameLoc() const
Returns the location of the identifier in the named namespace.
NamespaceAliasDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
redeclarable_base::redecl_iterator redecl_iterator
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of the namespace.
static bool classofKind(Kind K)
const NamespaceDecl * getNamespace() const
Represents C++ namespaces and their aliases.
NamespaceDecl * getNamespace()
Represent a C++ namespace.
A C++ nested-name-specifier augmented with source location information.
NestedNameSpecifier getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
A (possibly-)qualified type.
void Profile(llvm::FoldingSetNodeID &ID) const
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
The collection of all-type qualifiers we support.
Represents a struct/union/class.
Provides common interface for the Decls that can be redeclared.
NamespaceAliasDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
UsingShadowDecl * getNextRedeclaration() const
NamespaceAliasDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
redecl_iterator redecls_end() const
llvm::iterator_range< redecl_iterator > redecl_range
NamespaceAliasDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
redecl_iterator redecls_begin() const
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Represents the body of a requires-expression.
static DeclContext * castToDeclContext(const RequiresExprBodyDecl *D)
static RequiresExprBodyDecl * castFromDeclContext(const DeclContext *DC)
static bool classofKind(Kind K)
static RequiresExprBodyDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classof(const Decl *D)
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
Represents a C++11 static_assert declaration.
const Expr * getMessage() const
static bool classofKind(Kind K)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
const Expr * getAssertExpr() const
SourceLocation getRParenLoc() const
static StaticAssertDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classof(const Decl *D)
Stmt - This represents one statement.
llvm::iterator_range< child_iterator > child_range
llvm::iterator_range< const_child_iterator > const_child_range
void startDefinition()
Starts the definition of this tag declaration.
TagDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Stores a list of template parameters for a TemplateDecl and its derived classes.
Represents a declaration of a type.
SourceLocation getBeginLoc() const LLVM_READONLY
Base wrapper for a particular "section" of type source info.
NestedNameSpecifierLoc getPrefix() const
If this type represents a qualified-id, this returns it's nested name specifier.
SourceLocation getBeginLoc() const
Get the begin source location.
A container of type source information.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
QualType getType() const
Return the type wrapped by this type source info.
The base class of the type hierarchy.
const T * castAs() const
Member-template castAs<specific type>.
An artificial decl, representing a global anonymous constant value which is uniquified by value withi...
const APValue & getValue() const
static bool classofKind(Kind K)
static bool classof(const Decl *D)
void printName(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const override
Print this in a human-readable format.
static void Profile(llvm::FoldingSetNodeID &ID, QualType Ty, const APValue &APVal)
void Profile(llvm::FoldingSetNodeID &ID)
The iterator over UnresolvedSets.
This node is generated when a using-declaration that was annotated with attribute((using_if_exists)) ...
static UnresolvedUsingIfExistsDecl * CreateDeserialized(ASTContext &Ctx, GlobalDeclID ID)
static bool classof(const Decl *D)
static bool classofKind(Kind K)
Represents a dependent using declaration which was marked with typename.
bool isPackExpansion() const
Determine whether this is a pack expansion.
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
static bool classofKind(Kind K)
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
static bool classof(const Decl *D)
UnresolvedUsingTypenameDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this declaration.
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
const UnresolvedUsingTypenameDecl * getCanonicalDecl() const
DeclarationNameInfo getNameInfo() const
static UnresolvedUsingTypenameDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Represents a dependent using declaration which was not marked with typename.
const UnresolvedUsingValueDecl * getCanonicalDecl() const
bool isPackExpansion() const
Determine whether this is a pack expansion.
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
static bool classofKind(Kind K)
bool isAccessDeclaration() const
Return true if it is a C++03 access declaration (no 'using').
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
static bool classof(const Decl *D)
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
DeclarationNameInfo getNameInfo() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setUsingLoc(SourceLocation L)
Set the source location of the 'using' keyword.
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
UnresolvedUsingValueDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this declaration.
static UnresolvedUsingValueDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
Represents a C++ using-declaration.
void setTypename(bool TN)
Sets whether the using declaration has 'typename'.
UsingDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this declaration.
bool hasTypename() const
Return true if the using declaration has 'typename'.
bool isAccessDeclaration() const
Return true if it is a C++03 access declaration (no 'using').
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
void setUsingLoc(SourceLocation L)
Set the source location of the 'using' keyword.
static UsingDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const UsingDecl * getCanonicalDecl() const
DeclarationNameInfo getNameInfo() const
static bool classof(const Decl *D)
static bool classofKind(Kind K)
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
Represents C++ using-directive.
static UsingDirectiveDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const NamedDecl * getNominatedNamespaceAsWritten() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
const DeclContext * getCommonAncestor() const
static bool classofKind(Kind K)
SourceLocation getUsingLoc() const
Return the location of the using keyword.
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
const NamespaceDecl * getNominatedNamespace() const
static bool classof(const Decl *D)
NamedDecl * getNominatedNamespaceAsWritten()
DeclContext * getCommonAncestor()
Returns the common ancestor context of this using-directive and its nominated namespace.
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
SourceLocation getIdentLocation() const
Returns the location of this using declaration's identifier.
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of the namespace.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
Represents a C++ using-enum-declaration.
void setEnumType(TypeSourceInfo *TSI)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setEnumLoc(SourceLocation L)
NestedNameSpecifierLoc getQualifierLoc() const
SourceLocation getEnumLoc() const
The source location of the 'enum' keyword.
void setUsingLoc(SourceLocation L)
UsingEnumDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this declaration.
EnumDecl * getEnumDecl() const
const UsingEnumDecl * getCanonicalDecl() const
TypeSourceInfo * getEnumType() const
static bool classofKind(Kind K)
static UsingEnumDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classof(const Decl *D)
NestedNameSpecifier getQualifier() const
TypeLoc getEnumTypeLoc() const
SourceLocation getUsingLoc() const
The source location of the 'using' keyword.
Represents a pack of using declarations that a single using-declarator pack-expanded into.
static UsingPackDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned NumExpansions)
const UsingPackDecl * getCanonicalDecl() const
UsingPackDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
NamedDecl * getInstantiatedFromUsingDecl() const
Get the using declaration from which this was instantiated.
static bool classof(const Decl *D)
static bool classofKind(Kind K)
ArrayRef< NamedDecl * > expansions() const
Get the set of using declarations that this pack expanded into.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
UsingShadowDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
redeclarable_base::redecl_range redecl_range
static UsingShadowDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation Loc, DeclarationName Name, BaseUsingDecl *Introducer, NamedDecl *Target)
UsingShadowDecl * getNextUsingShadowDecl() const
The next using shadow declaration contained in the shadow decl chain of the using declaration which i...
void setTargetDecl(NamedDecl *ND)
Sets the underlying declaration which has been brought into the local scope.
static bool classofKind(Kind K)
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
redeclarable_base::redecl_iterator redecl_iterator
UsingShadowDecl(Kind K, ASTContext &C, DeclContext *DC, SourceLocation Loc, DeclarationName Name, BaseUsingDecl *Introducer, NamedDecl *Target)
static UsingShadowDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classof(const Decl *D)
friend class BaseUsingDecl
BaseUsingDecl * getIntroducer() const
Gets the (written or instantiated) using declaration that introduced this declaration.
const UsingShadowDecl * getCanonicalDecl() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
void setType(QualType newType)
bool isParameterPack() const
Determine whether this value is actually a function parameter pack, init-capture pack,...
Represents a variable declaration or definition.
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
ConstexprSpecKind
Define the kind of constexpr specifier.
LinkageSpecLanguageIDs
Represents the language in a linkage specification.
RefQualifierKind
The kind of C++11 ref-qualifier associated with a function type.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
StorageClass
Storage classes.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
StorageDuration
The storage duration for an object (per C++ [basic.stc]).
@ Template
We are parsing a template declaration.
MSVtorDispMode
In the Microsoft ABI, this controls the placement of virtual displacement members used to implement v...
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
LazyOffsetPtr< Decl, GlobalDeclID, &ExternalASTSource::GetExternalDecl > LazyDeclPtr
A lazy pointer to a declaration.
const FunctionProtoType * T
DeductionCandidate
Only used by CXXDeductionGuideDecl.
MSInheritanceModel
Assigned inheritance model for a class in the MS C++ ABI.
ExplicitSpecKind
Define the meaning of possible values of the kind in ExplicitSpecifier.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
CallingConv
CallingConv - Specifies the calling convention that a function uses.
LazyOffsetPtr< CXXBaseSpecifier, uint64_t, &ExternalASTSource::GetExternalCXXBaseSpecifiers > LazyCXXBaseSpecifiersPtr
A lazy pointer to a set of CXXBaseSpecifiers.
@ Other
Other implicit parameter.
Information about how a lambda is numbered within its context.
unsigned DeviceManglingNumber
bool HasKnownInternalLinkage
A placeholder type used to construct an empty shell of a decl-derived type that will be filled in lat...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
DeclarationName getName() const
getName - Returns the embedded declaration name.
const DeclarationNameLoc & getInfo() const
Parts of a decomposed MSGuidDecl.
uint16_t Part2
...-89ab-...
uint32_t Part1
{01234567-...
uint16_t Part3
...-cdef-...
uint8_t Part4And5[8]
...-0123-456789abcdef}
uint64_t getPart4And5AsUint64() const
Describes how types, statements, expressions, and declarations should be printed.