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 {
372 ArrayRef<CXXBaseSpecifier> vbases()
const {
377 CXXBaseSpecifier *getBasesSlowCase()
const;
378 CXXBaseSpecifier *getVBasesSlowCase()
const;
381 struct DefinitionData *DefinitionData;
384 struct LambdaDefinitionData :
public DefinitionData {
396 unsigned DependencyKind : 2;
399 LLVM_PREFERRED_TYPE(
bool)
400 unsigned IsGenericLambda : 1;
404 unsigned CaptureDefault : 2;
407 unsigned NumCaptures : 15;
410 unsigned NumExplicitCaptures : 12;
413 LLVM_PREFERRED_TYPE(
bool)
414 unsigned HasKnownInternalLinkage : 1;
418 unsigned ManglingNumber : 31;
422 unsigned IndexInContext;
434 llvm::TinyPtrVector<Capture*> Captures;
437 TypeSourceInfo *MethodTyInfo;
439 LambdaDefinitionData(CXXRecordDecl *
D, TypeSourceInfo *Info,
unsigned DK,
441 : DefinitionData(
D), DependencyKind(DK), IsGenericLambda(IsGeneric),
442 CaptureDefault(CaptureDefault), NumCaptures(0),
443 NumExplicitCaptures(0), HasKnownInternalLinkage(0), ManglingNumber(0),
444 IndexInContext(0), MethodTyInfo(Info) {
450 PlainOldData =
false;
454 void AddCaptureList(ASTContext &Ctx, Capture *CaptureList);
457 struct DefinitionData *dataPtr()
const {
460 return DefinitionData;
463 struct DefinitionData &data()
const {
464 auto *DD = dataPtr();
465 assert(DD &&
"queried property of class with no definition");
469 struct LambdaDefinitionData &getLambdaData()
const {
472 auto *DD = DefinitionData;
473 assert(DD && DD->IsLambda &&
"queried lambda property of non-lambda class");
474 return static_cast<LambdaDefinitionData&
>(*DD);
486 llvm::PointerUnion<ClassTemplateDecl *, MemberSpecializationInfo *>
487 TemplateOrInstantiation;
491 void addedClassSubobject(CXXRecordDecl *
Base);
498 void addedMember(Decl *
D);
500 void markedVirtualFunctionPure();
504 FriendDecl *getFirstFriend()
const;
509 bool hasSubobjectAtOffsetZeroOfEmptyBaseType(ASTContext &Ctx,
510 const CXXRecordDecl *
X);
514 SourceLocation StartLoc, SourceLocation IdLoc,
515 IdentifierInfo *
Id, CXXRecordDecl *PrevDecl);
533 return cast_or_null<CXXRecordDecl>(
542 return cast<CXXRecordDecl>(
568 auto *DD = DefinitionData ? DefinitionData : dataPtr();
569 return DD ? DD->Definition :
nullptr;
578 bool DelayTypeCreation =
false);
581 unsigned DependencyKind,
bool IsGeneric,
587 return data().Polymorphic || data().NumVBases != 0;
605 return data().IsParsingBaseSpecifiers;
618 llvm::iterator_range<base_class_const_iterator>;
660 llvm::iterator_range<specific_decl_iterator<CXXMethodDecl>>;
680 llvm::iterator_range<specific_decl_iterator<CXXConstructorDecl>>;
694 class friend_iterator;
704 return data().FirstFriend.isValid();
711 (data().DeclaredSpecialMembers & SMF_CopyConstructor)) &&
712 "this property has not yet been computed by Sema");
713 return data().DefaultedCopyConstructorIsDeleted;
720 (data().DeclaredSpecialMembers & SMF_MoveConstructor)) &&
721 "this property has not yet been computed by Sema");
722 return data().DefaultedMoveConstructorIsDeleted;
728 (data().DeclaredSpecialMembers & SMF_Destructor)) &&
729 "this property has not yet been computed by Sema");
730 return data().DefaultedDestructorIsDeleted;
737 !data().DefaultedCopyConstructorIsDeleted;
744 !data().DefaultedMoveConstructorIsDeleted;
751 !data().DefaultedCopyAssignmentIsDeleted;
758 !data().DefaultedMoveAssignmentIsDeleted;
765 !data().DefaultedDestructorIsDeleted;
770 return (data().DeclaredSpecialMembers & SMF_DefaultConstructor) ||
779 return (!data().UserDeclaredConstructor &&
780 !(data().DeclaredSpecialMembers & SMF_DefaultConstructor) &&
785 (data().HasInheritedDefaultConstructor &&
786 !(data().DeclaredSpecialMembers & SMF_DefaultConstructor));
793 return data().UserDeclaredConstructor;
799 return data().UserProvidedDefaultConstructor;
806 return data().UserDeclaredSpecialMembers & SMF_CopyConstructor;
812 return !(data().DeclaredSpecialMembers & SMF_CopyConstructor);
824 if (data().UserDeclaredSpecialMembers &
825 (SMF_MoveConstructor | SMF_MoveAssignment))
827 return data().NeedOverloadResolutionForCopyConstructor;
833 return data().ImplicitCopyConstructorCanHaveConstParamForNonVBase &&
835 data().ImplicitCopyConstructorCanHaveConstParamForVBase);
841 return data().HasDeclaredCopyConstructorWithConstParam ||
852 return data().UserDeclaredSpecialMembers &
853 (SMF_MoveConstructor | SMF_MoveAssignment);
859 return data().UserDeclaredSpecialMembers & SMF_MoveConstructor;
864 return (data().DeclaredSpecialMembers & SMF_MoveConstructor) ||
871 assert((data().DefaultedCopyConstructorIsDeleted ||
873 "Copy constructor should not be deleted");
874 data().DefaultedCopyConstructorIsDeleted =
true;
880 assert((data().DefaultedMoveConstructorIsDeleted ||
882 "move constructor should not be deleted");
883 data().DefaultedMoveConstructorIsDeleted =
true;
889 assert((data().DefaultedDestructorIsDeleted ||
891 "destructor should not be deleted");
892 data().DefaultedDestructorIsDeleted =
true;
898 return !(data().DeclaredSpecialMembers & SMF_MoveConstructor) &&
908 return data().NeedOverloadResolutionForMoveConstructor;
916 return data().UserDeclaredSpecialMembers & SMF_CopyAssignment;
922 assert((data().DefaultedCopyAssignmentIsDeleted ||
924 "copy assignment should not be deleted");
925 data().DefaultedCopyAssignmentIsDeleted =
true;
931 return !(data().DeclaredSpecialMembers & SMF_CopyAssignment);
943 if (data().UserDeclaredSpecialMembers &
944 (SMF_MoveConstructor | SMF_MoveAssignment))
946 return data().NeedOverloadResolutionForCopyAssignment;
952 return data().ImplicitCopyAssignmentHasConstParam;
959 return data().HasDeclaredCopyAssignmentWithConstParam ||
967 return data().UserDeclaredSpecialMembers & SMF_MoveAssignment;
972 return (data().DeclaredSpecialMembers & SMF_MoveAssignment) ||
979 assert((data().DefaultedMoveAssignmentIsDeleted ||
981 "move assignment should not be deleted");
982 data().DefaultedMoveAssignmentIsDeleted =
true;
989 return !(data().DeclaredSpecialMembers & SMF_MoveAssignment) &&
1000 return data().NeedOverloadResolutionForMoveAssignment;
1007 return data().UserDeclaredSpecialMembers & SMF_Destructor;
1013 return !(data().DeclaredSpecialMembers & SMF_Destructor);
1019 return data().NeedOverloadResolutionForDestructor;
1025 auto *DD = DefinitionData;
1026 return DD && DD->IsLambda;
1108 LambdaDefinitionData &LambdaData = getLambdaData();
1109 return LambdaData.Captures.empty() ? nullptr : LambdaData.Captures.front();
1141 llvm::iterator_range<conversion_iterator>
1165 data().HasUninitializedReferenceMember;
1176 bool isPOD()
const {
return data().PlainOldData; }
1197 return data().HasPrivateFields;
1201 return data().HasProtectedFields;
1207 return D.HasPublicFields ||
D.HasProtectedFields ||
D.HasPrivateFields;
1247 (data().HasTrivialSpecialMembers & SMF_DefaultConstructor);
1253 return (data().DeclaredNonTrivialSpecialMembers & SMF_DefaultConstructor) ||
1255 !(data().HasTrivialSpecialMembers & SMF_DefaultConstructor));
1261 return data().HasConstexprNonCopyMoveConstructor ||
1269 return data().DefaultedDefaultConstructorIsConstexpr &&
1276 return data().HasConstexprDefaultConstructor ||
1284 return data().HasTrivialSpecialMembers & SMF_CopyConstructor;
1288 return data().HasTrivialSpecialMembersForCall & SMF_CopyConstructor;
1294 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyConstructor ||
1299 return (data().DeclaredNonTrivialSpecialMembersForCall &
1300 SMF_CopyConstructor) ||
1308 (data().HasTrivialSpecialMembers & SMF_MoveConstructor);
1313 (data().HasTrivialSpecialMembersForCall & SMF_MoveConstructor);
1319 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveConstructor) ||
1321 !(data().HasTrivialSpecialMembers & SMF_MoveConstructor));
1325 return (data().DeclaredNonTrivialSpecialMembersForCall &
1326 SMF_MoveConstructor) ||
1328 !(data().HasTrivialSpecialMembersForCall & SMF_MoveConstructor));
1334 return data().HasTrivialSpecialMembers & SMF_CopyAssignment;
1340 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyAssignment ||
1348 (data().HasTrivialSpecialMembers & SMF_MoveAssignment);
1354 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveAssignment) ||
1356 !(data().HasTrivialSpecialMembers & SMF_MoveAssignment));
1362 return data().DefaultedDestructorIsConstexpr &&
1372 return data().HasTrivialSpecialMembers & SMF_Destructor;
1376 return data().HasTrivialSpecialMembersForCall & SMF_Destructor;
1382 return !(data().HasTrivialSpecialMembers & SMF_Destructor);
1386 return !(data().HasTrivialSpecialMembersForCall & SMF_Destructor);
1390 data().HasTrivialSpecialMembersForCall =
1391 (SMF_CopyConstructor | SMF_MoveConstructor | SMF_Destructor);
1397 return !data().HasUninitializedFields ||
1398 !(data().HasDefaultedDefaultConstructor ||
1408 return data().HasIrrelevantDestructor;
1414 return data().HasNonLiteralTypeFieldsOrBases;
1420 return data().HasInheritedConstructor;
1426 return data().HasInheritedAssignment;
1464 return isLiteral() && data().StructuralIfLiteral;
1554 return RD->isLocalClass();
1671 bool LookupInDependent =
false)
const;
1716 std::vector<const NamedDecl *>
1718 llvm::function_ref<
bool(
const NamedDecl *ND)> Filter);
1729 assert(DeclAccess !=
AS_none);
1731 return (PathAccess > DeclAccess ? PathAccess : DeclAccess);
1772 assert(
isLambda() &&
"Not a lambda closure type!");
1773 return getLambdaData().ManglingNumber;
1779 assert(
isLambda() &&
"Not a lambda closure type!");
1780 return getLambdaData().HasKnownInternalLinkage;
1797 assert(
isLambda() &&
"Not a lambda closure type!");
1798 return getLambdaData().IndexInContext;
1863 return getLambdaData().DependencyKind;
1867 return getLambdaData().MethodTyInfo;
1871 assert(DefinitionData && DefinitionData->IsLambda &&
1872 "setting lambda property of non-lambda class");
1873 auto &DL =
static_cast<LambdaDefinitionData &
>(*DefinitionData);
1874 DL.MethodTyInfo = TS;
1878 getLambdaData().DependencyKind =
Kind;
1882 assert(DefinitionData && DefinitionData->IsLambda &&
1883 "setting lambda property of non-lambda class");
1884 auto &DL =
static_cast<LambdaDefinitionData &
>(*DefinitionData);
1885 DL.IsGenericLambda = IsGeneric;
1894 return K >= firstCXXRecord && K <= lastCXXRecord;
1902 llvm::PointerIntPair<Expr *, 2, ExplicitSpecKind> ExplicitSpec{
1916 ExplicitSpec.getPointer();
1932 !ExplicitSpec.getPointer();
1957 void anchor()
override;
1965 :
FunctionDecl(CXXDeductionGuide,
C, DC, StartLoc, NameInfo,
T, TInfo,
1967 Ctor(Ctor), ExplicitSpec(ES) {
2035 :
Decl(RequiresExprBody, DC, StartLoc),
DeclContext(RequiresExprBody) {}
2065 void anchor()
override;
2073 Expr *TrailingRequiresClause =
nullptr)
2075 isInline, ConstexprKind, TrailingRequiresClause) {
2086 Expr *TrailingRequiresClause =
nullptr);
2112 return OOK == OO_New || OOK == OO_Array_New || OOK == OO_Delete ||
2113 OOK == OO_Array_Delete;
2138 bool IsAppleKext)
const {
2168 return cast<CXXMethodDecl>(
2184 llvm::TinyPtrVector<const CXXMethodDecl *>::const_iterator>;
2262 bool MayBeBase =
false);
2266 bool MayBeBase =
false)
const {
2274 bool MayBeBase =
false);
2277 bool MayBeBase =
false)
const {
2285 return K >= firstCXXMethod && K <= lastCXXMethod;
2308 llvm::PointerUnion<TypeSourceInfo *, FieldDecl *, IndirectFieldDecl *>
2331 LLVM_PREFERRED_TYPE(
bool)
2332 unsigned IsDelegating : 1;
2336 LLVM_PREFERRED_TYPE(
bool)
2337 unsigned IsVirtual : 1;
2341 LLVM_PREFERRED_TYPE(
bool)
2342 unsigned IsWritten : 1;
2346 unsigned SourceOrder : 13;
2399 return Init->getStmtClass() == Stmt::CXXDefaultInitExprClass;
2417 return MemberOrEllipsisLocation;
2465 return MemberOrEllipsisLocation;
2481 return IsWritten ?
static_cast<int>(SourceOrder) : -1;
2492 assert(!IsWritten &&
2493 "setSourceOrder() used on implicit initializer");
2494 assert(SourceOrder == 0 &&
2495 "calling twice setSourceOrder() on the same initializer");
2497 "setSourceOrder() used to make an initializer implicit");
2499 SourceOrder =
static_cast<unsigned>(Pos);
2518 : Shadow(Shadow), BaseCtor(BaseCtor) {}
2520 explicit operator bool()
const {
return Shadow; }
2538 private llvm::TrailingObjects<CXXConstructorDecl, InheritedConstructor,
2539 ExplicitSpecifier> {
2554 Expr *TrailingRequiresClause);
2556 void anchor()
override;
2558 size_t numTrailingObjects(OverloadToken<InheritedConstructor>)
const {
2561 size_t numTrailingObjects(OverloadToken<ExplicitSpecifier>)
const {
2567 return *getTrailingObjects<ExplicitSpecifier>();
2574 enum TrailingAllocKind {
2575 TAKInheritsConstructor = 1,
2576 TAKHasTailExplicit = 1 << 1,
2579 uint64_t getTrailingAllocKind()
const {
2580 return numTrailingObjects(OverloadToken<InheritedConstructor>()) |
2581 (numTrailingObjects(OverloadToken<ExplicitSpecifier>()) << 1);
2590 uint64_t AllocKind);
2597 Expr *TrailingRequiresClause =
nullptr);
2602 "cannot set this explicit specifier. no trail-allocated space for "
2636 const auto *ConstThis =
this;
2655 std::reverse_iterator<init_const_iterator>;
2683 numCtorInitializers &&
"NumCtorInitializers overflow!");
2687 CtorInitializers = Initializers;
2723 unsigned TypeQuals = 0;
2737 unsigned TypeQuals = 0;
2810 Expr *OperatorDeleteThisArg =
nullptr;
2816 Expr *TrailingRequiresClause =
nullptr)
2823 void anchor()
override;
2829 bool UsesFPIntrin,
bool isInline,
bool isImplicitlyDeclared,
2831 Expr *TrailingRequiresClause =
nullptr);
2872 Expr *TrailingRequiresClause =
nullptr)
2875 EndLocation, TrailingRequiresClause),
2877 void anchor()
override;
2890 Expr *TrailingRequiresClause =
nullptr);
2939 virtual void anchor();
3042 :
NamedDecl(UsingDirective, DC, IdentLoc, getName()), UsingLoc(UsingLoc),
3043 NamespaceLoc(NamespcLoc), QualifierLoc(QualifierLoc),
3044 NominatedNamespace(Nominated), CommonAncestor(CommonAncestor) {}
3054 void anchor()
override;
3074 return NominatedNamespace;
3147 NamespaceLoc(NamespaceLoc), IdentLoc(IdentLoc),
3148 QualifierLoc(QualifierLoc), Namespace(Namespace) {}
3150 void anchor()
override;
3197 if (
auto *AD = dyn_cast<NamespaceAliasDecl>(Namespace))
3198 return AD->getNamespace();
3200 return cast<NamespaceDecl>(Namespace);
3233 public Mergeable<LifetimeExtendedTemporaryDecl> {
3237 Stmt *ExprWithTemporary =
nullptr;
3242 unsigned ManglingNumber;
3246 virtual void anchor();
3251 ExprWithTemporary(Temp), ExtendingDecl(EDecl),
3252 ManglingNumber(Mangling) {}
3255 :
Decl(
Decl::LifetimeExtendedTemporary, EmptyShell{}) {}
3259 unsigned Mangling) {
3301 return K == Decl::LifetimeExtendedTemporary;
3334 void anchor()
override;
3346 UsingShadowDecl *getMostRecentDeclImpl()
override {
3393 assert(ND &&
"Target decl is null!");
3409 return dyn_cast_or_null<UsingShadowDecl>(UsingOrNextShadow);
3414 return K == Decl::UsingShadow || K == Decl::ConstructorUsingShadow;
3427 llvm::PointerIntPair<UsingShadowDecl *, 1, bool> FirstUsingShadow;
3434 void anchor()
override;
3467 Current = Current->getNextUsingShadowDecl();
3478 return x.Current == y.Current;
3481 return x.Current != y.Current;
3531 UsingLocation(UL), QualifierLoc(QualifierLoc),
3536 void anchor()
override;
3574 bool HasTypenameKeyword);
3617 LLVM_PREFERRED_TYPE(
bool)
3618 unsigned IsVirtual : 1;
3622 bool TargetInVirtualBase)
3624 Using->getDeclName(), Using,
3625 Target->getUnderlyingDecl()),
3626 NominatedBaseClassShadowDecl(
3627 dyn_cast<ConstructorUsingShadowDecl>(
Target)),
3628 ConstructedBaseClassShadowDecl(NominatedBaseClassShadowDecl),
3629 IsVirtual(TargetInVirtualBase) {
3633 if (NominatedBaseClassShadowDecl &&
3634 NominatedBaseClassShadowDecl->constructsVirtualBase()) {
3635 ConstructedBaseClassShadowDecl =
3636 NominatedBaseClassShadowDecl->ConstructedBaseClassShadowDecl;
3644 void anchor()
override;
3678 return NominatedBaseClassShadowDecl;
3684 return ConstructedBaseClassShadowDecl;
3694 return cast<CXXRecordDecl>((ConstructedBaseClassShadowDecl
3695 ? ConstructedBaseClassShadowDecl
3727 :
BaseUsingDecl(UsingEnum, DC, NL, DN), UsingLocation(UL), EnumLocation(EL),
3730 void anchor()
override;
3748 return ETL.getQualifierLoc();
3798 private llvm::TrailingObjects<UsingPackDecl, NamedDecl *> {
3804 unsigned NumExpansions;
3809 InstantiatedFrom ? InstantiatedFrom->getLocation()
3811 InstantiatedFrom ? InstantiatedFrom->getDeclName()
3813 InstantiatedFrom(InstantiatedFrom), NumExpansions(UsingDecls.size()) {
3814 std::uninitialized_copy(UsingDecls.begin(), UsingDecls.end(),
3815 getTrailingObjects<NamedDecl *>());
3818 void anchor()
override;
3833 return llvm::ArrayRef(getTrailingObjects<NamedDecl *>(), NumExpansions);
3841 unsigned NumExpansions);
3844 return InstantiatedFrom->getSourceRange();
3866 public Mergeable<UnresolvedUsingValueDecl> {
3887 UsingLocation(UsingLoc), EllipsisLoc(EllipsisLoc),
3888 QualifierLoc(QualifierLoc), DNLoc(NameInfo.
getInfo()) {}
3890 void anchor()
override;
3963 public Mergeable<UnresolvedUsingTypenameDecl> {
3981 :
TypeDecl(UnresolvedUsingTypename, DC, TargetNameLoc, TargetName,
3983 TypenameLocation(TypenameLoc), EllipsisLoc(EllipsisLoc),
3984 QualifierLoc(QualifierLoc) {}
3986 void anchor()
override;
4048 void anchor()
override;
4063 llvm::PointerIntPair<Expr *, 1, bool> AssertExprAndFailed;
4070 :
Decl(StaticAssert, DC, StaticAssertLoc),
4071 AssertExprAndFailed(AssertExpr, Failed), Message(Message),
4072 RParenLoc(RParenLoc) {}
4074 virtual void anchor();
4091 bool isFailed()
const {
return AssertExprAndFailed.getInt(); }
4118 Expr *Binding =
nullptr;
4123 void anchor()
override;
4150 this->Binding = Binding;
4170 private llvm::TrailingObjects<DecompositionDecl, BindingDecl *> {
4172 unsigned NumBindings;
4178 :
VarDecl(Decomposition,
C, DC, StartLoc, LSquareLoc,
nullptr,
T, TInfo,
4182 getTrailingObjects<BindingDecl *>());
4184 B->setDecomposedDecl(
this);
4187 void anchor()
override;
4200 unsigned NumBindings);
4203 return llvm::ArrayRef(getTrailingObjects<BindingDecl *>(), NumBindings);
4246 GetterId(Getter), SetterId(Setter) {}
4248 void anchor()
override;
4293 public llvm::FoldingSetNode {
4305 void anchor()
override;
4331 ID.AddInteger(
P.Part1);
4332 ID.AddInteger(
P.Part2);
4333 ID.AddInteger(
P.Part3);
4334 ID.AddInteger(
P.getPart4And5AsUint64());
4349 public Mergeable<UnnamedGlobalConstantDecl>,
4350 public llvm::FoldingSetNode {
4355 void anchor()
override;
4393const StreamingDiagnostic &
operator<<(
const StreamingDiagnostic &DB,
enum clang::sema::@1655::IndirectLocalPathEntry::EntryKind Kind
const LambdaCapture * Capture
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.
Defines the clang::TypeLoc interface and its subclasses.
C Language Family Type Representation.
const 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.
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.