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"
86class AccessSpecDecl :
public Decl {
92 :
Decl(AccessSpec, DC, ASLoc), ColonLoc(ColonLoc) {
98 virtual void anchor();
120 return new (
C, DC) AccessSpecDecl(AS, DC, ASLoc, ColonLoc);
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) {}
199 return BaseTypeInfo->getTypeLoc().getBeginLoc();
217 InheritConstructors = Inherit;
250 return BaseTypeInfo->getType().getUnqualifiedType();
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;
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 {
383 using Capture = LambdaCapture;
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;
416 unsigned ManglingNumber : 31;
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;
496 void addedMember(
Decl *D);
498 void markedVirtualFunctionPure();
502 FriendDecl *getFirstFriend()
const;
507 bool hasSubobjectAtOffsetZeroOfEmptyBaseType(
ASTContext &Ctx,
512 SourceLocation StartLoc, SourceLocation IdLoc,
531 return cast_or_null<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;
1248 (data().HasTrivialSpecialMembers & SMF_DefaultConstructor);
1254 return (data().DeclaredNonTrivialSpecialMembers & SMF_DefaultConstructor) ||
1256 !(data().HasTrivialSpecialMembers & SMF_DefaultConstructor));
1262 return data().HasConstexprNonCopyMoveConstructor ||
1270 return data().DefaultedDefaultConstructorIsConstexpr &&
1277 return data().HasConstexprDefaultConstructor ||
1285 return data().HasTrivialSpecialMembers & SMF_CopyConstructor;
1289 return data().HasTrivialSpecialMembersForCall & SMF_CopyConstructor;
1295 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyConstructor ||
1300 return (data().DeclaredNonTrivialSpecialMembersForCall &
1301 SMF_CopyConstructor) ||
1309 (data().HasTrivialSpecialMembers & SMF_MoveConstructor);
1314 (data().HasTrivialSpecialMembersForCall & SMF_MoveConstructor);
1320 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveConstructor) ||
1322 !(data().HasTrivialSpecialMembers & SMF_MoveConstructor));
1326 return (data().DeclaredNonTrivialSpecialMembersForCall &
1327 SMF_MoveConstructor) ||
1329 !(data().HasTrivialSpecialMembersForCall & SMF_MoveConstructor));
1335 return data().HasTrivialSpecialMembers & SMF_CopyAssignment;
1341 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyAssignment ||
1349 (data().HasTrivialSpecialMembers & SMF_MoveAssignment);
1355 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveAssignment) ||
1357 !(data().HasTrivialSpecialMembers & SMF_MoveAssignment));
1363 return data().DefaultedDestructorIsConstexpr &&
1373 return data().HasTrivialSpecialMembers & SMF_Destructor;
1377 return data().HasTrivialSpecialMembersForCall & SMF_Destructor;
1383 return !(data().HasTrivialSpecialMembers & SMF_Destructor);
1387 return !(data().HasTrivialSpecialMembersForCall & SMF_Destructor);
1391 data().HasTrivialSpecialMembersForCall =
1392 (SMF_CopyConstructor | SMF_MoveConstructor | SMF_Destructor);
1398 return !data().HasUninitializedFields ||
1399 !(data().HasDefaultedDefaultConstructor ||
1409 return data().HasIrrelevantDestructor;
1415 return data().HasNonLiteralTypeFieldsOrBases;
1421 return data().HasInheritedConstructor;
1427 return data().HasInheritedAssignment;
1465 return isLiteral() && data().StructuralIfLiteral;
1541 ->getTemplateInstantiationPattern());
1562 return RD->isLocalClass();
1679 bool LookupInDependent =
false)
const;
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;
1923 return K >= firstCXXRecord && K <= lastCXXRecord;
1931 llvm::PointerIntPair<Expr *, 2, ExplicitSpecKind> ExplicitSpec{
1945 ExplicitSpec.getPointer();
1961 !ExplicitSpec.getPointer();
1986 void anchor()
override;
2006 :
FunctionDecl(CXXDeductionGuide,
C, DC, StartLoc, NameInfo, T, TInfo,
2008 TrailingRequiresClause),
2009 Ctor(Ctor), ExplicitSpec(ES),
2010 SourceDeductionGuide(GeneratedFrom, SourceKind) {
2016 CXXConstructorDecl *Ctor;
2017 ExplicitSpecifier ExplicitSpec;
2021 llvm::PointerIntPair<
const CXXDeductionGuideDecl *, 2,
2023 SourceDeductionGuide;
2024 void setExplicitSpecifier(ExplicitSpecifier ES) { ExplicitSpec = ES; }
2030 static CXXDeductionGuideDecl *
2062 return SourceDeductionGuide.getPointer();
2066 SourceDeductionGuide.setPointer(DG);
2070 return SourceDeductionGuide.getInt();
2074 SourceDeductionGuide.setInt(SK);
2106 :
Decl(RequiresExprBody, DC, StartLoc),
DeclContext(RequiresExprBody) {}
2123 return static_cast<DeclContext *
>(
const_cast<RequiresExprBodyDecl *
>(D));
2127 return static_cast<RequiresExprBodyDecl *
>(
const_cast<DeclContext *
>(DC));
2136 void anchor()
override;
2146 isInline, ConstexprKind, TrailingRequiresClause) {
2154 const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
2157 const AssociatedConstraint &TrailingRequiresClause = {});
2183 return OOK == OO_New || OOK == OO_Array_New || OOK == OO_Delete ||
2184 OOK == OO_Array_Delete;
2209 bool IsAppleKext)
const {
2255 llvm::TinyPtrVector<const CXXMethodDecl *>::const_iterator>;
2333 bool MayBeBase =
false);
2337 bool MayBeBase =
false)
const {
2345 bool MayBeBase =
false);
2348 bool MayBeBase =
false)
const {
2356 return K >= firstCXXMethod && K <= lastCXXMethod;
2379 llvm::PointerUnion<TypeSourceInfo *, FieldDecl *, IndirectFieldDecl *>
2402 LLVM_PREFERRED_TYPE(
bool)
2403 unsigned IsDelegating : 1;
2407 LLVM_PREFERRED_TYPE(
bool)
2408 unsigned IsVirtual : 1;
2412 LLVM_PREFERRED_TYPE(
bool)
2413 unsigned IsWritten : 1;
2417 unsigned SourceOrder : 13;
2470 return Init->getStmtClass() == Stmt::CXXDefaultInitExprClass;
2488 return MemberOrEllipsisLocation;
2536 return MemberOrEllipsisLocation;
2552 return IsWritten ?
static_cast<int>(SourceOrder) : -1;
2563 assert(!IsWritten &&
2564 "setSourceOrder() used on implicit initializer");
2565 assert(SourceOrder == 0 &&
2566 "calling twice setSourceOrder() on the same initializer");
2568 "setSourceOrder() used to make an initializer implicit");
2570 SourceOrder =
static_cast<unsigned>(Pos);
2589 : Shadow(Shadow), BaseCtor(BaseCtor) {}
2591 explicit operator bool()
const {
return Shadow; }
2607class CXXConstructorDecl final
2609 private llvm::TrailingObjects<CXXConstructorDecl, InheritedConstructor,
2610 ExplicitSpecifier> {
2627 void anchor()
override;
2629 size_t numTrailingObjects(OverloadToken<InheritedConstructor>)
const {
2635 return *getTrailingObjects<ExplicitSpecifier>();
2642 enum TrailingAllocKind {
2643 TAKInheritsConstructor = 1,
2644 TAKHasTailExplicit = 1 << 1,
2647 uint64_t getTrailingAllocKind()
const {
2650 Kind |= TAKInheritsConstructor;
2652 Kind |= TAKHasTailExplicit;
2662 uint64_t AllocKind);
2663 static CXXConstructorDecl *
2674 "cannot set this explicit specifier. no trail-allocated space for "
2708 const auto *ConstThis =
this;
2727 std::reverse_iterator<init_const_iterator>;
2755 numCtorInitializers &&
"NumCtorInitializers overflow!");
2759 CtorInitializers = Initializers;
2795 unsigned TypeQuals = 0;
2809 unsigned TypeQuals = 0;
2881 Expr *OperatorDeleteThisArg =
nullptr;
2888 :
CXXMethodDecl(CXXDestructor,
C, RD, StartLoc, NameInfo, T, TInfo,
2894 void anchor()
override;
2897 static CXXDestructorDecl *
2899 const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
2900 bool UsesFPIntrin,
bool isInline,
bool isImplicitlyDeclared,
2902 const AssociatedConstraint &TrailingRequiresClause = {});
2952 :
CXXMethodDecl(CXXConversion,
C, RD, StartLoc, NameInfo, T, TInfo,
2954 EndLocation, TrailingRequiresClause),
2956 void anchor()
override;
2964 static CXXConversionDecl *
3018 virtual void anchor();
3080 return static_cast<DeclContext *
>(
const_cast<LinkageSpecDecl*
>(D));
3084 return static_cast<LinkageSpecDecl *
>(
const_cast<DeclContext*
>(DC));
3122 NamespaceLoc(NamespcLoc), QualifierLoc(QualifierLoc),
3123 NominatedNamespace(Nominated), CommonAncestor(CommonAncestor) {}
3133 void anchor()
override;
3148 return QualifierLoc.getNestedNameSpecifier();
3153 return NominatedNamespace;
3226 redeclarable_base(
C), NamespaceLoc(NamespaceLoc), IdentLoc(IdentLoc),
3227 QualifierLoc(QualifierLoc), Namespace(Namespace) {}
3229 void anchor()
override;
3269 return QualifierLoc.getNestedNameSpecifier();
3274 if (
auto *AD = dyn_cast<NamespaceAliasDecl>(Namespace))
3281 return const_cast<NamespaceAliasDecl *
>(
this)->
getNamespace();
3308class LifetimeExtendedTemporaryDecl final
3310 public Mergeable<LifetimeExtendedTemporaryDecl> {
3314 Stmt *ExprWithTemporary =
nullptr;
3319 unsigned ManglingNumber;
3321 mutable APValue *Value =
nullptr;
3323 LLVM_DECLARE_VIRTUAL_ANCHOR_FUNCTION();
3325 LifetimeExtendedTemporaryDecl(
Expr *Temp,
ValueDecl *EDecl,
unsigned Mangling)
3328 ExprWithTemporary(Temp), ExtendingDecl(EDecl),
3329 ManglingNumber(Mangling) {}
3332 :
Decl(
Decl::LifetimeExtendedTemporary, EmptyShell{}) {}
3336 unsigned Mangling) {
3338 LifetimeExtendedTemporaryDecl(Temp, EDec, Mangling);
3342 return new (
C, ID) LifetimeExtendedTemporaryDecl(
EmptyShell{});
3378 return K == Decl::LifetimeExtendedTemporary;
3411 void anchor()
override;
3470 assert(ND &&
"Target decl is null!");
3486 return dyn_cast_or_null<UsingShadowDecl>(UsingOrNextShadow);
3491 return K == Decl::UsingShadow || K == Decl::ConstructorUsingShadow;
3504 llvm::PointerIntPair<UsingShadowDecl *, 1, bool> FirstUsingShadow;
3511 void anchor()
override;
3555 return x.Current == y.Current;
3558 return x.Current != y.Current;
3608 UsingLocation(UL), QualifierLoc(QualifierLoc),
3613 void anchor()
override;
3631 return QualifierLoc.getNestedNameSpecifier();
3651 bool HasTypenameKeyword);
3683 ConstructorUsingShadowDecl *NominatedBaseClassShadowDecl =
nullptr;
3689 ConstructorUsingShadowDecl *ConstructedBaseClassShadowDecl =
nullptr;
3694 LLVM_PREFERRED_TYPE(
bool)
3695 unsigned IsVirtual : 1;
3699 bool TargetInVirtualBase)
3701 Using->getDeclName(), Using,
3702 Target->getUnderlyingDecl()),
3703 NominatedBaseClassShadowDecl(
3704 dyn_cast<ConstructorUsingShadowDecl>(
Target)),
3705 ConstructedBaseClassShadowDecl(NominatedBaseClassShadowDecl),
3706 IsVirtual(TargetInVirtualBase) {
3710 if (NominatedBaseClassShadowDecl &&
3711 NominatedBaseClassShadowDecl->constructsVirtualBase()) {
3712 ConstructedBaseClassShadowDecl =
3713 NominatedBaseClassShadowDecl->ConstructedBaseClassShadowDecl;
3721 void anchor()
override;
3755 return NominatedBaseClassShadowDecl;
3761 return ConstructedBaseClassShadowDecl;
3772 ? ConstructedBaseClassShadowDecl
3804 :
BaseUsingDecl(UsingEnum, DC, NL, DN), UsingLocation(UL), EnumLocation(EL),
3805 EnumType(EnumType){}
3807 void anchor()
override;
3828 return EnumType->getTypeLoc();
3837 return EnumType->getType()->castAs<clang::EnumType>()->getDecl();
3873class UsingPackDecl final
3875 private llvm::TrailingObjects<UsingPackDecl, NamedDecl *> {
3881 unsigned NumExpansions;
3886 InstantiatedFrom ? InstantiatedFrom->getLocation()
3888 InstantiatedFrom ? InstantiatedFrom->getDeclName()
3890 InstantiatedFrom(InstantiatedFrom), NumExpansions(UsingDecls.size()) {
3891 llvm::uninitialized_copy(UsingDecls, getTrailingObjects());
3894 void anchor()
override;
3909 return getTrailingObjects(NumExpansions);
3917 unsigned NumExpansions);
3920 return InstantiatedFrom->getSourceRange();
3942 public Mergeable<UnresolvedUsingValueDecl> {
3963 UsingLocation(UsingLoc), EllipsisLoc(EllipsisLoc),
3964 QualifierLoc(QualifierLoc), DNLoc(NameInfo.
getInfo()) {}
3966 void anchor()
override;
3987 return QualifierLoc.getNestedNameSpecifier();
3996 return EllipsisLoc.isValid();
4037class UnresolvedUsingTypenameDecl
4039 public Mergeable<UnresolvedUsingTypenameDecl> {
4057 :
TypeDecl(UnresolvedUsingTypename, DC, TargetNameLoc, TargetName,
4059 TypenameLocation(TypenameLoc), EllipsisLoc(EllipsisLoc),
4060 QualifierLoc(QualifierLoc) {}
4062 void anchor()
override;
4077 return QualifierLoc.getNestedNameSpecifier();
4086 return EllipsisLoc.isValid();
4124 void anchor()
override;
4138class StaticAssertDecl :
public Decl {
4139 llvm::PointerIntPair<Expr *, 1, bool> AssertExprAndFailed;
4146 :
Decl(StaticAssert, DC, StaticAssertLoc),
4147 AssertExprAndFailed(AssertExpr, Failed), Message(Message),
4148 RParenLoc(RParenLoc) {}
4150 virtual void anchor();
4167 bool isFailed()
const {
return AssertExprAndFailed.getInt(); }
4194 Expr *Binding =
nullptr;
4198 :
ValueDecl(Decl::Binding, DC, IdLoc, Id, T) {}
4200 void anchor()
override;
4227 this->Binding = Binding;
4249class DecompositionDecl final
4251 private llvm::TrailingObjects<DecompositionDecl, BindingDecl *> {
4253 unsigned NumBindings;
4259 :
VarDecl(Decomposition,
C, DC, StartLoc, LSquareLoc,
nullptr, T, TInfo,
4262 llvm::uninitialized_copy(
Bindings, getTrailingObjects());
4264 B->setDecomposedDecl(
this);
4265 if (B->isParameterPack() && B->getBinding()) {
4267 NestedBD->setDecomposedDecl(
this);
4273 void anchor()
override;
4286 unsigned NumBindings);
4290 return getTrailingObjects(NumBindings);
4304 PackBindings =
Bindings.front()->getBindingPackDecls();
4308 return llvm::concat<BindingDecl *const>(std::move(BeforePackBindings),
4309 std::move(PackBindings),
4353 GetterId(Getter), SetterId(Setter) {}
4355 void anchor()
override;
4400 public llvm::FoldingSetNode {
4412 void anchor()
override;
4438 ID.AddInteger(P.
Part1);
4439 ID.AddInteger(P.
Part2);
4440 ID.AddInteger(P.
Part3);
4456 public Mergeable<UnnamedGlobalConstantDecl>,
4457 public llvm::FoldingSetNode {
4462 void anchor()
override;
4469 static UnnamedGlobalConstantDecl *CreateDeserialized(
ASTContext &
C,
4500const StreamingDiagnostic &
operator<<(
const StreamingDiagnostic &DB,
4501 AccessSpecifier AS);
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.
Defines an enumeration for C++ overloaded operators.
llvm::SmallVector< std::pair< const MemRegion *, SVal >, 4 > Bindings
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.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
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 ...
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++()
UsingShadowDecl * reference
std::forward_iterator_tag iterator_category
shadow_iterator(UsingShadowDecl *C)
friend bool operator==(shadow_iterator x, shadow_iterator y)
UsingShadowDecl * value_type
shadow_iterator operator++(int)
UsingShadowDecl * pointer
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
friend class ASTDeclReader
shadow_iterator shadow_end() const
static bool classofKind(Kind K)
BaseUsingDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
friend class ASTDeclWriter
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.
friend class ASTDeclReader
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.
std::reverse_iterator< init_const_iterator > init_const_reverse_iterator
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
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.
CXXCtorInitializer ** init_iterator
Iterates through the member/base initializer list.
friend class ASTDeclReader
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.
friend class ASTDeclWriter
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()
friend class ASTDeclReader
QualType getConversionType() const
Returns the type that this conversion function is converting to.
void setExplicitSpecifier(ExplicitSpecifier ES)
static CXXConversionDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
friend class ASTDeclWriter
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.
CXXCtorInitializer(ASTContext &Context, TypeSourceInfo *TInfo, bool IsVirtual, SourceLocation L, Expr *Init, SourceLocation R, SourceLocation EllipsisLoc)
Creates a new base-class initializer.
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...
friend class ASTDeclReader
const CXXDeductionGuideDecl * getSourceDeductionGuide() const
Get the deduction guide from which this deduction guide was generated, if it was generated as part of...
ExplicitSpecifier getExplicitSpecifier()
friend class ASTDeclWriter
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.
void setGlobalOperatorArrayDelete(FunctionDecl *OD)
static CXXDestructorDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const CXXDestructorDecl * getCanonicalDecl() const
CXXDestructorDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
friend class ASTDeclReader
const FunctionDecl * getOperatorGlobalDelete() const
const FunctionDecl * getGlobalArrayOperatorDelete() const
friend class ASTDeclWriter
static bool classofKind(Kind K)
const FunctionDecl * getOperatorDelete() const
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...
void setOperatorArrayDelete(FunctionDecl *OD)
Expr * getOperatorDeleteThisArg() const
const FunctionDecl * getArrayOperatorDelete() const
static bool classof(const Decl *D)
void setOperatorGlobalDelete(FunctionDecl *OD)
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.
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
llvm::iterator_range< llvm::TinyPtrVector< const CXXMethodDecl * >::const_iterator > overridden_method_range
An iterator over the friend declarations of a class.
Represents a C++ struct/union/class.
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...
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.
friend class ASTRecordWriter
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 isPFPType() const
Returns whether the pointer fields in this class should have pointer field protection (PFP) by defaul...
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.
friend class ODRDiagsEmitter
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.
CXXBaseSpecifier * base_class_iterator
Iterator that traverses the base classes of a class.
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< base_class_const_iterator > base_class_const_range
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.
friend class ASTDeclMerger
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.
llvm::function_ref< bool(const CXXRecordDecl *BaseDefinition)> ForallBasesCallback
Function type used by forallBases() as a callback.
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
friend class ASTDeclReader
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.
friend class ASTNodeImporter
bool isTriviallyCopyConstructible() const
Determine whether this class is considered trivially copyable per.
bool hasTrivialCopyConstructorForCall() const
bool isCapturelessLambda() const
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
const CXXBaseSpecifier * base_class_const_iterator
Iterator that traverses the base classes of a class.
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.
llvm::iterator_range< specific_decl_iterator< CXXConstructorDecl > > ctor_range
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 LambdaCapture * capture_const_iterator
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...
friend class ASTDeclWriter
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
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...
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.
bool hasUserDeclaredMoveOperation() const
Whether this class has a user-declared move constructor or assignment operator.
llvm::iterator_range< specific_decl_iterator< CXXMethodDecl > > method_range
UnresolvedSetIterator conversion_iterator
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...
friend class ASTDeclReader
static bool classofKind(Kind K)
UsingDecl * getIntroducer() const
Override the UsingShadowDecl's getIntroducer, returning the UsingDecl that introduced this.
friend class ASTDeclWriter
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
virtual Decl * getPreviousDeclImpl()
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
Kind
Lists the kind of concrete classes of Decl.
unsigned getIdentifierNamespace() const
virtual Decl * getNextRedeclarationImpl()
Returns the next redeclaration or itself if this is the only decl.
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()
virtual Decl * getMostRecentDeclImpl()
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...
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.
DeclaratorDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T, TypeSourceInfo *TInfo, SourceLocation StartL)
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
friend class ASTDeclReader
static bool classofKind(Kind K)
static DecompositionDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned NumBindings)
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.
FunctionDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass S, bool UsesFPIntrin, bool isInlineSpecified, ConstexprSpecKind ConstexprKind, const AssociatedConstraint &TrailingRequiresClause)
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.
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
const ValueDecl * getExtendingDecl() const
unsigned getManglingNumber() const
APValue * getValue() const
friend class MaterializeTemporaryExpr
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)
friend class ASTDeclReader
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)
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)
friend class ASTDeclReader
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.
static bool classof(const Decl *D)
IdentifierInfo * getGetterId() const
friend class ASTDeclReader
IdentifierInfo * getSetterId() const
static MSPropertyDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
Provides information a specialization of a member of a class template, which may be a member function...
UsingDecl * getFirstDecl()
This represents a decl that may have a name.
NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
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...
friend class ASTDeclReader
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...
The collection of all-type qualifiers we support.
RecordDecl(Kind DK, TagKind TK, const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, RecordDecl *PrevDecl)
Provides common interface for the Decls that can be redeclared.
NamespaceAliasDecl * getFirstDecl()
UsingShadowDecl * getNextRedeclaration() const
Redeclarable(const ASTContext &Ctx)
NamespaceAliasDecl * getPreviousDecl()
redecl_iterator redecls_end() const
llvm::iterator_range< redecl_iterator > redecl_range
NamespaceAliasDecl * getMostRecentDecl()
redecl_iterator redecls_begin() const
redecl_range redecls() const
static DeclContext * castToDeclContext(const RequiresExprBodyDecl *D)
friend class ASTDeclReader
static RequiresExprBodyDecl * castFromDeclContext(const DeclContext *DC)
static bool classofKind(Kind K)
static RequiresExprBodyDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classof(const Decl *D)
friend class ASTDeclWriter
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.
const Expr * getMessage() const
friend class ASTDeclReader
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.
TypeDecl(Kind DK, DeclContext *DC, SourceLocation L, const IdentifierInfo *Id, SourceLocation StartL=SourceLocation())
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.
A container of type source information.
The base class of the type hierarchy.
const T * castAs() const
Member-template castAs<specific type>.
const APValue & getValue() const
static bool classofKind(Kind K)
static bool classof(const Decl *D)
friend class ASTDeclReader
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.
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)
friend class ASTDeclReader
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').
friend class ASTDeclReader
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.
friend class ASTDeclWriter
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.
friend class ASTDeclReader
void setUsingLoc(SourceLocation L)
Set the source location of the 'using' keyword.
static UsingDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const UsingDecl * getCanonicalDecl() const
friend class ASTDeclWriter
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)
friend class ASTDeclReader
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.
friend class ASTDeclReader
EnumDecl * getEnumDecl() const
friend class ASTDeclWriter
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)
friend class ASTDeclReader
static bool classofKind(Kind K)
ArrayRef< NamedDecl * > expansions() const
Get the set of using declarations that this pack expanded into.
friend class ASTDeclWriter
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 * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
UsingShadowDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
UsingShadowDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
redeclarable_base::redecl_range redecl_range
friend class ASTDeclReader
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.
friend class ASTDeclWriter
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 ...
ValueDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T)
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.
VarDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass SC)
The JSON file list parser is used to communicate input to InstallAPI.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
bool isa(CodeGen::Address addr)
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',...
LazyOffsetPtr< CXXCtorInitializer *, uint64_t, &ExternalASTSource::GetExternalCXXCtorInitializers > LazyCXXCtorInitializersPtr
A lazy pointer to a set of CXXCtorInitializers.
LazyOffsetPtr< CXXBaseSpecifier, uint64_t, &ExternalASTSource::GetExternalCXXBaseSpecifiers > LazyCXXBaseSpecifiersPtr
A lazy pointer to a set of CXXBaseSpecifiers.
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
LazyOffsetPtr< Decl, GlobalDeclID, &ExternalASTSource::GetExternalDecl > LazyDeclPtr
A lazy pointer to a declaration.
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
StorageClass
Storage classes.
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.
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.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)
Insertion operator for diagnostics.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
CallingConv
CallingConv - Specifies the calling convention that a function uses.
U cast(CodeGen::Address addr)
@ 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.