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;
273 enum SpecialMemberFlags {
274 SMF_DefaultConstructor = 0x1,
275 SMF_CopyConstructor = 0x2,
276 SMF_MoveConstructor = 0x4,
277 SMF_CopyAssignment = 0x8,
278 SMF_MoveAssignment = 0x10,
279 SMF_Destructor = 0x20,
291 struct DefinitionData {
292 #define FIELD(Name, Width, Merge) \
293 unsigned Name : Width;
294 #include "CXXRecordDeclDefinitionBits.def"
297 LLVM_PREFERRED_TYPE(
bool)
298 unsigned IsLambda : 1;
301 LLVM_PREFERRED_TYPE(
bool)
302 unsigned IsParsingBaseSpecifiers : 1;
306 LLVM_PREFERRED_TYPE(
bool)
307 unsigned ComputedVisibleConversions : 1;
309 LLVM_PREFERRED_TYPE(
bool)
310 unsigned HasODRHash : 1;
313 unsigned ODRHash = 0;
316 unsigned NumBases = 0;
319 unsigned NumVBases = 0;
333 LazyASTUnresolvedSet Conversions;
340 LazyASTUnresolvedSet VisibleConversions;
343 CXXRecordDecl *Definition;
351 DefinitionData(CXXRecordDecl *
D);
354 CXXBaseSpecifier *getBases()
const {
355 if (!Bases.isOffset())
356 return Bases.get(
nullptr);
357 return getBasesSlowCase();
361 CXXBaseSpecifier *getVBases()
const {
362 if (!VBases.isOffset())
363 return VBases.get(
nullptr);
364 return getVBasesSlowCase();
367 ArrayRef<CXXBaseSpecifier> bases()
const {
371 ArrayRef<CXXBaseSpecifier> vbases()
const {
376 CXXBaseSpecifier *getBasesSlowCase()
const;
377 CXXBaseSpecifier *getVBasesSlowCase()
const;
380 struct DefinitionData *DefinitionData;
383 struct LambdaDefinitionData :
public DefinitionData {
395 unsigned DependencyKind : 2;
398 LLVM_PREFERRED_TYPE(
bool)
399 unsigned IsGenericLambda : 1;
403 unsigned CaptureDefault : 2;
406 unsigned NumCaptures : 15;
409 unsigned NumExplicitCaptures : 12;
412 LLVM_PREFERRED_TYPE(
bool)
413 unsigned HasKnownInternalLinkage : 1;
417 unsigned ManglingNumber : 31;
421 unsigned IndexInContext;
433 llvm::TinyPtrVector<Capture*> Captures;
436 TypeSourceInfo *MethodTyInfo;
438 LambdaDefinitionData(CXXRecordDecl *
D, TypeSourceInfo *Info,
unsigned DK,
440 : DefinitionData(
D), DependencyKind(DK), IsGenericLambda(IsGeneric),
441 CaptureDefault(CaptureDefault), NumCaptures(0),
442 NumExplicitCaptures(0), HasKnownInternalLinkage(0), ManglingNumber(0),
443 IndexInContext(0), MethodTyInfo(Info) {
449 PlainOldData =
false;
453 void AddCaptureList(ASTContext &Ctx, Capture *CaptureList);
456 struct DefinitionData *dataPtr()
const {
459 return DefinitionData;
462 struct DefinitionData &data()
const {
463 auto *DD = dataPtr();
464 assert(DD &&
"queried property of class with no definition");
468 struct LambdaDefinitionData &getLambdaData()
const {
471 auto *DD = DefinitionData;
472 assert(DD && DD->IsLambda &&
"queried lambda property of non-lambda class");
473 return static_cast<LambdaDefinitionData&
>(*DD);
485 llvm::PointerUnion<ClassTemplateDecl *, MemberSpecializationInfo *>
486 TemplateOrInstantiation;
490 void addedClassSubobject(CXXRecordDecl *
Base);
497 void addedMember(Decl *
D);
499 void markedVirtualFunctionPure();
503 FriendDecl *getFirstFriend()
const;
508 bool hasSubobjectAtOffsetZeroOfEmptyBaseType(ASTContext &Ctx,
509 const CXXRecordDecl *
X);
513 SourceLocation StartLoc, SourceLocation IdLoc,
514 IdentifierInfo *
Id, CXXRecordDecl *PrevDecl);
532 return cast_or_null<CXXRecordDecl>(
541 return cast<CXXRecordDecl>(
567 auto *DD = DefinitionData ? DefinitionData : dataPtr();
568 return DD ? DD->Definition :
nullptr;
577 bool DelayTypeCreation =
false);
580 unsigned DependencyKind,
bool IsGeneric,
586 return data().Polymorphic || data().NumVBases != 0;
604 return data().IsParsingBaseSpecifiers;
617 llvm::iterator_range<base_class_const_iterator>;
659 llvm::iterator_range<specific_decl_iterator<CXXMethodDecl>>;
679 llvm::iterator_range<specific_decl_iterator<CXXConstructorDecl>>;
693 class friend_iterator;
703 return data().FirstFriend.isValid();
710 (data().DeclaredSpecialMembers & SMF_CopyConstructor)) &&
711 "this property has not yet been computed by Sema");
712 return data().DefaultedCopyConstructorIsDeleted;
719 (data().DeclaredSpecialMembers & SMF_MoveConstructor)) &&
720 "this property has not yet been computed by Sema");
721 return data().DefaultedMoveConstructorIsDeleted;
727 (data().DeclaredSpecialMembers & SMF_Destructor)) &&
728 "this property has not yet been computed by Sema");
729 return data().DefaultedDestructorIsDeleted;
736 !data().DefaultedCopyConstructorIsDeleted;
743 !data().DefaultedMoveConstructorIsDeleted;
750 !data().DefaultedCopyAssignmentIsDeleted;
757 !data().DefaultedMoveAssignmentIsDeleted;
764 !data().DefaultedDestructorIsDeleted;
769 return (data().DeclaredSpecialMembers & SMF_DefaultConstructor) ||
778 return (!data().UserDeclaredConstructor &&
779 !(data().DeclaredSpecialMembers & SMF_DefaultConstructor) &&
784 (data().HasInheritedDefaultConstructor &&
785 !(data().DeclaredSpecialMembers & SMF_DefaultConstructor));
792 return data().UserDeclaredConstructor;
798 return data().UserProvidedDefaultConstructor;
805 return data().UserDeclaredSpecialMembers & SMF_CopyConstructor;
811 return !(data().DeclaredSpecialMembers & SMF_CopyConstructor);
823 if (data().UserDeclaredSpecialMembers &
824 (SMF_MoveConstructor | SMF_MoveAssignment))
826 return data().NeedOverloadResolutionForCopyConstructor;
832 return data().ImplicitCopyConstructorCanHaveConstParamForNonVBase &&
834 data().ImplicitCopyConstructorCanHaveConstParamForVBase);
840 return data().HasDeclaredCopyConstructorWithConstParam ||
851 return data().UserDeclaredSpecialMembers &
852 (SMF_MoveConstructor | SMF_MoveAssignment);
858 return data().UserDeclaredSpecialMembers & SMF_MoveConstructor;
863 return (data().DeclaredSpecialMembers & SMF_MoveConstructor) ||
870 assert((data().DefaultedCopyConstructorIsDeleted ||
872 "Copy constructor should not be deleted");
873 data().DefaultedCopyConstructorIsDeleted =
true;
879 assert((data().DefaultedMoveConstructorIsDeleted ||
881 "move constructor should not be deleted");
882 data().DefaultedMoveConstructorIsDeleted =
true;
888 assert((data().DefaultedDestructorIsDeleted ||
890 "destructor should not be deleted");
891 data().DefaultedDestructorIsDeleted =
true;
897 return !(data().DeclaredSpecialMembers & SMF_MoveConstructor) &&
907 return data().NeedOverloadResolutionForMoveConstructor;
915 return data().UserDeclaredSpecialMembers & SMF_CopyAssignment;
921 assert((data().DefaultedCopyAssignmentIsDeleted ||
923 "copy assignment should not be deleted");
924 data().DefaultedCopyAssignmentIsDeleted =
true;
930 return !(data().DeclaredSpecialMembers & SMF_CopyAssignment);
942 if (data().UserDeclaredSpecialMembers &
943 (SMF_MoveConstructor | SMF_MoveAssignment))
945 return data().NeedOverloadResolutionForCopyAssignment;
951 return data().ImplicitCopyAssignmentHasConstParam;
958 return data().HasDeclaredCopyAssignmentWithConstParam ||
966 return data().UserDeclaredSpecialMembers & SMF_MoveAssignment;
971 return (data().DeclaredSpecialMembers & SMF_MoveAssignment) ||
978 assert((data().DefaultedMoveAssignmentIsDeleted ||
980 "move assignment should not be deleted");
981 data().DefaultedMoveAssignmentIsDeleted =
true;
988 return !(data().DeclaredSpecialMembers & SMF_MoveAssignment) &&
999 return data().NeedOverloadResolutionForMoveAssignment;
1006 return data().UserDeclaredSpecialMembers & SMF_Destructor;
1012 return !(data().DeclaredSpecialMembers & SMF_Destructor);
1018 return data().NeedOverloadResolutionForDestructor;
1024 auto *DD = DefinitionData;
1025 return DD && DD->IsLambda;
1107 LambdaDefinitionData &LambdaData = getLambdaData();
1108 return LambdaData.Captures.empty() ? nullptr : LambdaData.Captures.front();
1140 llvm::iterator_range<conversion_iterator>
1164 data().HasUninitializedReferenceMember;
1175 bool isPOD()
const {
return data().PlainOldData; }
1196 return data().HasPrivateFields;
1200 return data().HasProtectedFields;
1206 return D.HasPublicFields ||
D.HasProtectedFields ||
D.HasPrivateFields;
1246 (data().HasTrivialSpecialMembers & SMF_DefaultConstructor);
1252 return (data().DeclaredNonTrivialSpecialMembers & SMF_DefaultConstructor) ||
1254 !(data().HasTrivialSpecialMembers & SMF_DefaultConstructor));
1260 return data().HasConstexprNonCopyMoveConstructor ||
1268 return data().DefaultedDefaultConstructorIsConstexpr &&
1275 return data().HasConstexprDefaultConstructor ||
1283 return data().HasTrivialSpecialMembers & SMF_CopyConstructor;
1287 return data().HasTrivialSpecialMembersForCall & SMF_CopyConstructor;
1293 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyConstructor ||
1298 return (data().DeclaredNonTrivialSpecialMembersForCall &
1299 SMF_CopyConstructor) ||
1307 (data().HasTrivialSpecialMembers & SMF_MoveConstructor);
1312 (data().HasTrivialSpecialMembersForCall & SMF_MoveConstructor);
1318 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveConstructor) ||
1320 !(data().HasTrivialSpecialMembers & SMF_MoveConstructor));
1324 return (data().DeclaredNonTrivialSpecialMembersForCall &
1325 SMF_MoveConstructor) ||
1327 !(data().HasTrivialSpecialMembersForCall & SMF_MoveConstructor));
1333 return data().HasTrivialSpecialMembers & SMF_CopyAssignment;
1339 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyAssignment ||
1347 (data().HasTrivialSpecialMembers & SMF_MoveAssignment);
1353 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveAssignment) ||
1355 !(data().HasTrivialSpecialMembers & SMF_MoveAssignment));
1361 return data().DefaultedDestructorIsConstexpr &&
1371 return data().HasTrivialSpecialMembers & SMF_Destructor;
1375 return data().HasTrivialSpecialMembersForCall & SMF_Destructor;
1381 return !(data().HasTrivialSpecialMembers & SMF_Destructor);
1385 return !(data().HasTrivialSpecialMembersForCall & SMF_Destructor);
1389 data().HasTrivialSpecialMembersForCall =
1390 (SMF_CopyConstructor | SMF_MoveConstructor | SMF_Destructor);
1396 return !data().HasUninitializedFields ||
1397 !(data().HasDefaultedDefaultConstructor ||
1407 return data().HasIrrelevantDestructor;
1413 return data().HasNonLiteralTypeFieldsOrBases;
1419 return data().HasInheritedConstructor;
1425 return data().HasInheritedAssignment;
1463 return isLiteral() && data().StructuralIfLiteral;
1553 return RD->isLocalClass();
1670 bool LookupInDependent =
false)
const;
1715 std::vector<const NamedDecl *>
1717 llvm::function_ref<
bool(
const NamedDecl *ND)> Filter);
1728 assert(DeclAccess !=
AS_none);
1730 return (PathAccess > DeclAccess ? PathAccess : DeclAccess);
1771 assert(
isLambda() &&
"Not a lambda closure type!");
1772 return getLambdaData().ManglingNumber;
1778 assert(
isLambda() &&
"Not a lambda closure type!");
1779 return getLambdaData().HasKnownInternalLinkage;
1796 assert(
isLambda() &&
"Not a lambda closure type!");
1797 return getLambdaData().IndexInContext;
1862 return getLambdaData().DependencyKind;
1866 return getLambdaData().MethodTyInfo;
1870 assert(DefinitionData && DefinitionData->IsLambda &&
1871 "setting lambda property of non-lambda class");
1872 auto &DL =
static_cast<LambdaDefinitionData &
>(*DefinitionData);
1873 DL.MethodTyInfo = TS;
1877 getLambdaData().DependencyKind =
Kind;
1881 assert(DefinitionData && DefinitionData->IsLambda &&
1882 "setting lambda property of non-lambda class");
1883 auto &DL =
static_cast<LambdaDefinitionData &
>(*DefinitionData);
1884 DL.IsGenericLambda = IsGeneric;
1893 return K >= firstCXXRecord && K <= lastCXXRecord;
1901 llvm::PointerIntPair<Expr *, 2, ExplicitSpecKind> ExplicitSpec{
1915 ExplicitSpec.getPointer();
1931 !ExplicitSpec.getPointer();
1956 void anchor()
override;
1964 :
FunctionDecl(CXXDeductionGuide,
C, DC, StartLoc, NameInfo,
T, TInfo,
1966 Ctor(Ctor), ExplicitSpec(ES) {
2034 :
Decl(RequiresExprBody, DC, StartLoc),
DeclContext(RequiresExprBody) {}
2064 void anchor()
override;
2072 Expr *TrailingRequiresClause =
nullptr)
2074 isInline, ConstexprKind, TrailingRequiresClause) {
2085 Expr *TrailingRequiresClause =
nullptr);
2111 return OOK == OO_New || OOK == OO_Array_New || OOK == OO_Delete ||
2112 OOK == OO_Array_Delete;
2137 bool IsAppleKext)
const {
2167 return cast<CXXMethodDecl>(
2183 llvm::TinyPtrVector<const CXXMethodDecl *>::const_iterator>;
2261 bool MayBeBase =
false);
2265 bool MayBeBase =
false)
const {
2273 bool MayBeBase =
false);
2276 bool MayBeBase =
false)
const {
2284 return K >= firstCXXMethod && K <= lastCXXMethod;
2307 llvm::PointerUnion<TypeSourceInfo *, FieldDecl *, IndirectFieldDecl *>
2330 LLVM_PREFERRED_TYPE(
bool)
2331 unsigned IsDelegating : 1;
2335 LLVM_PREFERRED_TYPE(
bool)
2336 unsigned IsVirtual : 1;
2340 LLVM_PREFERRED_TYPE(
bool)
2341 unsigned IsWritten : 1;
2345 unsigned SourceOrder : 13;
2398 return Init->getStmtClass() == Stmt::CXXDefaultInitExprClass;
2416 return MemberOrEllipsisLocation;
2464 return MemberOrEllipsisLocation;
2480 return IsWritten ?
static_cast<int>(SourceOrder) : -1;
2491 assert(!IsWritten &&
2492 "setSourceOrder() used on implicit initializer");
2493 assert(SourceOrder == 0 &&
2494 "calling twice setSourceOrder() on the same initializer");
2496 "setSourceOrder() used to make an initializer implicit");
2498 SourceOrder =
static_cast<unsigned>(Pos);
2517 : Shadow(Shadow), BaseCtor(BaseCtor) {}
2519 explicit operator bool()
const {
return Shadow; }
2537 private llvm::TrailingObjects<CXXConstructorDecl, InheritedConstructor,
2538 ExplicitSpecifier> {
2553 Expr *TrailingRequiresClause);
2555 void anchor()
override;
2557 size_t numTrailingObjects(OverloadToken<InheritedConstructor>)
const {
2560 size_t numTrailingObjects(OverloadToken<ExplicitSpecifier>)
const {
2566 return *getTrailingObjects<ExplicitSpecifier>();
2573 enum TrailingAllocKind {
2574 TAKInheritsConstructor = 1,
2575 TAKHasTailExplicit = 1 << 1,
2578 uint64_t getTrailingAllocKind()
const {
2579 return numTrailingObjects(OverloadToken<InheritedConstructor>()) |
2580 (numTrailingObjects(OverloadToken<ExplicitSpecifier>()) << 1);
2589 uint64_t AllocKind);
2596 Expr *TrailingRequiresClause =
nullptr);
2601 "cannot set this explicit specifier. no trail-allocated space for "
2635 const auto *ConstThis =
this;
2654 std::reverse_iterator<init_const_iterator>;
2682 numCtorInitializers &&
"NumCtorInitializers overflow!");
2686 CtorInitializers = Initializers;
2722 unsigned TypeQuals = 0;
2736 unsigned TypeQuals = 0;
2809 Expr *OperatorDeleteThisArg =
nullptr;
2815 Expr *TrailingRequiresClause =
nullptr)
2822 void anchor()
override;
2828 bool UsesFPIntrin,
bool isInline,
bool isImplicitlyDeclared,
2830 Expr *TrailingRequiresClause =
nullptr);
2871 Expr *TrailingRequiresClause =
nullptr)
2874 EndLocation, TrailingRequiresClause),
2876 void anchor()
override;
2889 Expr *TrailingRequiresClause =
nullptr);
2938 virtual void anchor();
3041 :
NamedDecl(UsingDirective, DC, IdentLoc, getName()), UsingLoc(UsingLoc),
3042 NamespaceLoc(NamespcLoc), QualifierLoc(QualifierLoc),
3043 NominatedNamespace(Nominated), CommonAncestor(CommonAncestor) {}
3053 void anchor()
override;
3073 return NominatedNamespace;
3146 NamespaceLoc(NamespaceLoc), IdentLoc(IdentLoc),
3147 QualifierLoc(QualifierLoc), Namespace(Namespace) {}
3149 void anchor()
override;
3196 if (
auto *AD = dyn_cast<NamespaceAliasDecl>(Namespace))
3197 return AD->getNamespace();
3199 return cast<NamespaceDecl>(Namespace);
3232 public Mergeable<LifetimeExtendedTemporaryDecl> {
3236 Stmt *ExprWithTemporary =
nullptr;
3241 unsigned ManglingNumber;
3245 virtual void anchor();
3250 ExprWithTemporary(Temp), ExtendingDecl(EDecl),
3251 ManglingNumber(Mangling) {}
3254 :
Decl(
Decl::LifetimeExtendedTemporary, EmptyShell{}) {}
3258 unsigned Mangling) {
3300 return K == Decl::LifetimeExtendedTemporary;
3333 void anchor()
override;
3345 UsingShadowDecl *getMostRecentDeclImpl()
override {
3392 assert(ND &&
"Target decl is null!");
3408 return dyn_cast_or_null<UsingShadowDecl>(UsingOrNextShadow);
3413 return K == Decl::UsingShadow || K == Decl::ConstructorUsingShadow;
3426 llvm::PointerIntPair<UsingShadowDecl *, 1, bool> FirstUsingShadow;
3433 void anchor()
override;
3466 Current = Current->getNextUsingShadowDecl();
3477 return x.Current == y.Current;
3480 return x.Current != y.Current;
3530 UsingLocation(UL), QualifierLoc(QualifierLoc),
3535 void anchor()
override;
3573 bool HasTypenameKeyword);
3616 LLVM_PREFERRED_TYPE(
bool)
3617 unsigned IsVirtual : 1;
3621 bool TargetInVirtualBase)
3623 Using->getDeclName(), Using,
3624 Target->getUnderlyingDecl()),
3625 NominatedBaseClassShadowDecl(
3626 dyn_cast<ConstructorUsingShadowDecl>(
Target)),
3627 ConstructedBaseClassShadowDecl(NominatedBaseClassShadowDecl),
3628 IsVirtual(TargetInVirtualBase) {
3632 if (NominatedBaseClassShadowDecl &&
3633 NominatedBaseClassShadowDecl->constructsVirtualBase()) {
3634 ConstructedBaseClassShadowDecl =
3635 NominatedBaseClassShadowDecl->ConstructedBaseClassShadowDecl;
3643 void anchor()
override;
3677 return NominatedBaseClassShadowDecl;
3683 return ConstructedBaseClassShadowDecl;
3693 return cast<CXXRecordDecl>((ConstructedBaseClassShadowDecl
3694 ? ConstructedBaseClassShadowDecl
3726 :
BaseUsingDecl(UsingEnum, DC, NL, DN), UsingLocation(UL), EnumLocation(EL),
3729 void anchor()
override;
3747 return ETL.getQualifierLoc();
3797 private llvm::TrailingObjects<UsingPackDecl, NamedDecl *> {
3803 unsigned NumExpansions;
3808 InstantiatedFrom ? InstantiatedFrom->getLocation()
3810 InstantiatedFrom ? InstantiatedFrom->getDeclName()
3812 InstantiatedFrom(InstantiatedFrom), NumExpansions(UsingDecls.size()) {
3813 std::uninitialized_copy(UsingDecls.begin(), UsingDecls.end(),
3814 getTrailingObjects<NamedDecl *>());
3817 void anchor()
override;
3832 return llvm::ArrayRef(getTrailingObjects<NamedDecl *>(), NumExpansions);
3840 unsigned NumExpansions);
3843 return InstantiatedFrom->getSourceRange();
3865 public Mergeable<UnresolvedUsingValueDecl> {
3886 UsingLocation(UsingLoc), EllipsisLoc(EllipsisLoc),
3887 QualifierLoc(QualifierLoc), DNLoc(NameInfo.
getInfo()) {}
3889 void anchor()
override;
3962 public Mergeable<UnresolvedUsingTypenameDecl> {
3980 :
TypeDecl(UnresolvedUsingTypename, DC, TargetNameLoc, TargetName,
3982 TypenameLocation(TypenameLoc), EllipsisLoc(EllipsisLoc),
3983 QualifierLoc(QualifierLoc) {}
3985 void anchor()
override;
4047 void anchor()
override;
4062 llvm::PointerIntPair<Expr *, 1, bool> AssertExprAndFailed;
4069 :
Decl(StaticAssert, DC, StaticAssertLoc),
4070 AssertExprAndFailed(AssertExpr, Failed), Message(Message),
4071 RParenLoc(RParenLoc) {}
4073 virtual void anchor();
4090 bool isFailed()
const {
return AssertExprAndFailed.getInt(); }
4117 Expr *Binding =
nullptr;
4122 void anchor()
override;
4149 this->Binding = Binding;
4169 private llvm::TrailingObjects<DecompositionDecl, BindingDecl *> {
4171 unsigned NumBindings;
4177 :
VarDecl(Decomposition,
C, DC, StartLoc, LSquareLoc,
nullptr,
T, TInfo,
4181 getTrailingObjects<BindingDecl *>());
4183 B->setDecomposedDecl(
this);
4186 void anchor()
override;
4199 unsigned NumBindings);
4202 return llvm::ArrayRef(getTrailingObjects<BindingDecl *>(), NumBindings);
4245 GetterId(Getter), SetterId(Setter) {}
4247 void anchor()
override;
4292 public llvm::FoldingSetNode {
4304 void anchor()
override;
4330 ID.AddInteger(
P.Part1);
4331 ID.AddInteger(
P.Part2);
4332 ID.AddInteger(
P.Part3);
4333 ID.AddInteger(
P.getPart4And5AsUint64());
4348 public Mergeable<UnnamedGlobalConstantDecl>,
4349 public llvm::FoldingSetNode {
4354 void anchor()
override;
4392const 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.
static bool classofKind(Kind K)
static CXXConstructorDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, uint64_t AllocKind)