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,
585 return data().Polymorphic || data().NumVBases != 0;
603 return data().IsParsingBaseSpecifiers;
616 llvm::iterator_range<base_class_const_iterator>;
658 llvm::iterator_range<specific_decl_iterator<CXXMethodDecl>>;
678 llvm::iterator_range<specific_decl_iterator<CXXConstructorDecl>>;
692 class friend_iterator;
702 return data().FirstFriend.isValid();
709 (data().DeclaredSpecialMembers & SMF_CopyConstructor)) &&
710 "this property has not yet been computed by Sema");
711 return data().DefaultedCopyConstructorIsDeleted;
718 (data().DeclaredSpecialMembers & SMF_MoveConstructor)) &&
719 "this property has not yet been computed by Sema");
720 return data().DefaultedMoveConstructorIsDeleted;
726 (data().DeclaredSpecialMembers & SMF_Destructor)) &&
727 "this property has not yet been computed by Sema");
728 return data().DefaultedDestructorIsDeleted;
735 !data().DefaultedCopyConstructorIsDeleted;
742 !data().DefaultedMoveConstructorIsDeleted;
749 !data().DefaultedCopyAssignmentIsDeleted;
756 !data().DefaultedMoveAssignmentIsDeleted;
763 !data().DefaultedDestructorIsDeleted;
768 return (data().DeclaredSpecialMembers & SMF_DefaultConstructor) ||
777 return (!data().UserDeclaredConstructor &&
778 !(data().DeclaredSpecialMembers & SMF_DefaultConstructor) &&
783 (data().HasInheritedDefaultConstructor &&
784 !(data().DeclaredSpecialMembers & SMF_DefaultConstructor));
791 return data().UserDeclaredConstructor;
797 return data().UserProvidedDefaultConstructor;
804 return data().UserDeclaredSpecialMembers & SMF_CopyConstructor;
810 return !(data().DeclaredSpecialMembers & SMF_CopyConstructor);
822 if (data().UserDeclaredSpecialMembers &
823 (SMF_MoveConstructor | SMF_MoveAssignment))
825 return data().NeedOverloadResolutionForCopyConstructor;
831 return data().ImplicitCopyConstructorCanHaveConstParamForNonVBase &&
833 data().ImplicitCopyConstructorCanHaveConstParamForVBase);
839 return data().HasDeclaredCopyConstructorWithConstParam ||
850 return data().UserDeclaredSpecialMembers &
851 (SMF_MoveConstructor | SMF_MoveAssignment);
857 return data().UserDeclaredSpecialMembers & SMF_MoveConstructor;
862 return (data().DeclaredSpecialMembers & SMF_MoveConstructor) ||
869 assert((data().DefaultedCopyConstructorIsDeleted ||
871 "Copy constructor should not be deleted");
872 data().DefaultedCopyConstructorIsDeleted =
true;
878 assert((data().DefaultedMoveConstructorIsDeleted ||
880 "move constructor should not be deleted");
881 data().DefaultedMoveConstructorIsDeleted =
true;
887 assert((data().DefaultedDestructorIsDeleted ||
889 "destructor should not be deleted");
890 data().DefaultedDestructorIsDeleted =
true;
896 return !(data().DeclaredSpecialMembers & SMF_MoveConstructor) &&
906 return data().NeedOverloadResolutionForMoveConstructor;
914 return data().UserDeclaredSpecialMembers & SMF_CopyAssignment;
920 assert((data().DefaultedCopyAssignmentIsDeleted ||
922 "copy assignment should not be deleted");
923 data().DefaultedCopyAssignmentIsDeleted =
true;
929 return !(data().DeclaredSpecialMembers & SMF_CopyAssignment);
941 if (data().UserDeclaredSpecialMembers &
942 (SMF_MoveConstructor | SMF_MoveAssignment))
944 return data().NeedOverloadResolutionForCopyAssignment;
950 return data().ImplicitCopyAssignmentHasConstParam;
957 return data().HasDeclaredCopyAssignmentWithConstParam ||
965 return data().UserDeclaredSpecialMembers & SMF_MoveAssignment;
970 return (data().DeclaredSpecialMembers & SMF_MoveAssignment) ||
977 assert((data().DefaultedMoveAssignmentIsDeleted ||
979 "move assignment should not be deleted");
980 data().DefaultedMoveAssignmentIsDeleted =
true;
987 return !(data().DeclaredSpecialMembers & SMF_MoveAssignment) &&
998 return data().NeedOverloadResolutionForMoveAssignment;
1005 return data().UserDeclaredSpecialMembers & SMF_Destructor;
1011 return !(data().DeclaredSpecialMembers & SMF_Destructor);
1017 return data().NeedOverloadResolutionForDestructor;
1023 auto *DD = DefinitionData;
1024 return DD && DD->IsLambda;
1106 LambdaDefinitionData &LambdaData = getLambdaData();
1107 return LambdaData.Captures.empty() ? nullptr : LambdaData.Captures.front();
1139 llvm::iterator_range<conversion_iterator>
1163 data().HasUninitializedReferenceMember;
1174 bool isPOD()
const {
return data().PlainOldData; }
1199 return data().HasPrivateFields;
1203 return data().HasProtectedFields;
1209 return D.HasPublicFields || D.HasProtectedFields || D.HasPrivateFields;
1242 (data().HasTrivialSpecialMembers & SMF_DefaultConstructor);
1248 return (data().DeclaredNonTrivialSpecialMembers & SMF_DefaultConstructor) ||
1250 !(data().HasTrivialSpecialMembers & SMF_DefaultConstructor));
1256 return data().HasConstexprNonCopyMoveConstructor ||
1264 return data().DefaultedDefaultConstructorIsConstexpr &&
1271 return data().HasConstexprDefaultConstructor ||
1279 return data().HasTrivialSpecialMembers & SMF_CopyConstructor;
1283 return data().HasTrivialSpecialMembersForCall & SMF_CopyConstructor;
1289 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyConstructor ||
1294 return (data().DeclaredNonTrivialSpecialMembersForCall &
1295 SMF_CopyConstructor) ||
1303 (data().HasTrivialSpecialMembers & SMF_MoveConstructor);
1308 (data().HasTrivialSpecialMembersForCall & SMF_MoveConstructor);
1314 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveConstructor) ||
1316 !(data().HasTrivialSpecialMembers & SMF_MoveConstructor));
1320 return (data().DeclaredNonTrivialSpecialMembersForCall &
1321 SMF_MoveConstructor) ||
1323 !(data().HasTrivialSpecialMembersForCall & SMF_MoveConstructor));
1329 return data().HasTrivialSpecialMembers & SMF_CopyAssignment;
1335 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyAssignment ||
1343 (data().HasTrivialSpecialMembers & SMF_MoveAssignment);
1349 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveAssignment) ||
1351 !(data().HasTrivialSpecialMembers & SMF_MoveAssignment));
1357 return data().DefaultedDestructorIsConstexpr &&
1367 return data().HasTrivialSpecialMembers & SMF_Destructor;
1371 return data().HasTrivialSpecialMembersForCall & SMF_Destructor;
1377 return !(data().HasTrivialSpecialMembers & SMF_Destructor);
1381 return !(data().HasTrivialSpecialMembersForCall & SMF_Destructor);
1385 data().HasTrivialSpecialMembersForCall =
1386 (SMF_CopyConstructor | SMF_MoveConstructor | SMF_Destructor);
1392 return !data().HasUninitializedFields ||
1393 !(data().HasDefaultedDefaultConstructor ||
1403 return data().HasIrrelevantDestructor;
1409 return data().HasNonLiteralTypeFieldsOrBases;
1415 return data().HasInheritedConstructor;
1421 return data().HasInheritedAssignment;
1459 return isLiteral() && data().StructuralIfLiteral;
1549 return RD->isLocalClass();
1666 bool LookupInDependent =
false)
const;
1711 std::vector<const NamedDecl *>
1713 llvm::function_ref<
bool(
const NamedDecl *ND)> Filter);
1724 assert(DeclAccess !=
AS_none);
1726 return (PathAccess > DeclAccess ? PathAccess : DeclAccess);
1767 assert(
isLambda() &&
"Not a lambda closure type!");
1768 return getLambdaData().ManglingNumber;
1774 assert(
isLambda() &&
"Not a lambda closure type!");
1775 return getLambdaData().HasKnownInternalLinkage;
1792 assert(
isLambda() &&
"Not a lambda closure type!");
1793 return getLambdaData().IndexInContext;
1858 return getLambdaData().DependencyKind;
1862 return getLambdaData().MethodTyInfo;
1866 assert(DefinitionData && DefinitionData->IsLambda &&
1867 "setting lambda property of non-lambda class");
1868 auto &DL =
static_cast<LambdaDefinitionData &
>(*DefinitionData);
1869 DL.MethodTyInfo = TS;
1873 assert(DefinitionData && DefinitionData->IsLambda &&
1874 "setting lambda property of non-lambda class");
1875 auto &DL =
static_cast<LambdaDefinitionData &
>(*DefinitionData);
1876 DL.IsGenericLambda = IsGeneric;
1885 return K >= firstCXXRecord && K <= lastCXXRecord;
1893 llvm::PointerIntPair<Expr *, 2, ExplicitSpecKind> ExplicitSpec{
1907 ExplicitSpec.getPointer();
1923 !ExplicitSpec.getPointer();
1948 void anchor()
override;
1956 :
FunctionDecl(CXXDeductionGuide,
C, DC, StartLoc, NameInfo, T, TInfo,
1958 Ctor(Ctor), ExplicitSpec(ES) {
2025 :
Decl(RequiresExprBody, DC, StartLoc),
DeclContext(RequiresExprBody) {}
2054 void anchor()
override;
2062 Expr *TrailingRequiresClause =
nullptr)
2064 isInline, ConstexprKind, TrailingRequiresClause) {
2075 Expr *TrailingRequiresClause =
nullptr);
2101 return OOK == OO_New || OOK == OO_Array_New || OOK == OO_Delete ||
2102 OOK == OO_Array_Delete;
2127 bool IsAppleKext)
const {
2157 return cast<CXXMethodDecl>(
2173 llvm::TinyPtrVector<const CXXMethodDecl *>::const_iterator>;
2251 bool MayBeBase =
false);
2255 bool MayBeBase =
false)
const {
2263 bool MayBeBase =
false);
2266 bool MayBeBase =
false)
const {
2274 return K >= firstCXXMethod && K <= lastCXXMethod;
2297 llvm::PointerUnion<TypeSourceInfo *, FieldDecl *, IndirectFieldDecl *>
2320 LLVM_PREFERRED_TYPE(
bool)
2321 unsigned IsDelegating : 1;
2325 LLVM_PREFERRED_TYPE(
bool)
2326 unsigned IsVirtual : 1;
2330 LLVM_PREFERRED_TYPE(
bool)
2331 unsigned IsWritten : 1;
2335 unsigned SourceOrder : 13;
2388 return Init->getStmtClass() == Stmt::CXXDefaultInitExprClass;
2406 return MemberOrEllipsisLocation;
2454 return MemberOrEllipsisLocation;
2470 return IsWritten ?
static_cast<int>(SourceOrder) : -1;
2481 assert(!IsWritten &&
2482 "setSourceOrder() used on implicit initializer");
2483 assert(SourceOrder == 0 &&
2484 "calling twice setSourceOrder() on the same initializer");
2486 "setSourceOrder() used to make an initializer implicit");
2488 SourceOrder =
static_cast<unsigned>(Pos);
2507 : Shadow(Shadow), BaseCtor(BaseCtor) {}
2509 explicit operator bool()
const {
return Shadow; }
2527 private llvm::TrailingObjects<CXXConstructorDecl, InheritedConstructor,
2528 ExplicitSpecifier> {
2543 Expr *TrailingRequiresClause);
2545 void anchor()
override;
2547 size_t numTrailingObjects(OverloadToken<InheritedConstructor>)
const {
2550 size_t numTrailingObjects(OverloadToken<ExplicitSpecifier>)
const {
2556 return *getTrailingObjects<ExplicitSpecifier>();
2563 enum TrailingAllocKind {
2564 TAKInheritsConstructor = 1,
2565 TAKHasTailExplicit = 1 << 1,
2568 uint64_t getTrailingAllocKind()
const {
2569 return numTrailingObjects(OverloadToken<InheritedConstructor>()) |
2570 (numTrailingObjects(OverloadToken<ExplicitSpecifier>()) << 1);
2579 uint64_t AllocKind);
2586 Expr *TrailingRequiresClause =
nullptr);
2591 "cannot set this explicit specifier. no trail-allocated space for "
2625 const auto *ConstThis =
this;
2644 std::reverse_iterator<init_const_iterator>;
2672 numCtorInitializers &&
"NumCtorInitializers overflow!");
2676 CtorInitializers = Initializers;
2712 unsigned TypeQuals = 0;
2726 unsigned TypeQuals = 0;
2799 Expr *OperatorDeleteThisArg =
nullptr;
2805 Expr *TrailingRequiresClause =
nullptr)
2806 :
CXXMethodDecl(CXXDestructor,
C, RD, StartLoc, NameInfo, T, TInfo,
2812 void anchor()
override;
2818 bool UsesFPIntrin,
bool isInline,
bool isImplicitlyDeclared,
2820 Expr *TrailingRequiresClause =
nullptr);
2861 Expr *TrailingRequiresClause =
nullptr)
2862 :
CXXMethodDecl(CXXConversion,
C, RD, StartLoc, NameInfo, T, TInfo,
2864 EndLocation, TrailingRequiresClause),
2866 void anchor()
override;
2879 Expr *TrailingRequiresClause =
nullptr);
2928 virtual void anchor();
3031 :
NamedDecl(UsingDirective, DC, IdentLoc, getName()), UsingLoc(UsingLoc),
3032 NamespaceLoc(NamespcLoc), QualifierLoc(QualifierLoc),
3033 NominatedNamespace(Nominated), CommonAncestor(CommonAncestor) {}
3043 void anchor()
override;
3063 return NominatedNamespace;
3136 NamespaceLoc(NamespaceLoc), IdentLoc(IdentLoc),
3137 QualifierLoc(QualifierLoc), Namespace(Namespace) {}
3139 void anchor()
override;
3186 if (
auto *AD = dyn_cast<NamespaceAliasDecl>(Namespace))
3187 return AD->getNamespace();
3189 return cast<NamespaceDecl>(Namespace);
3222 public Mergeable<LifetimeExtendedTemporaryDecl> {
3226 Stmt *ExprWithTemporary =
nullptr;
3231 unsigned ManglingNumber;
3235 virtual void anchor();
3240 ExprWithTemporary(Temp), ExtendingDecl(EDecl),
3241 ManglingNumber(Mangling) {}
3244 :
Decl(
Decl::LifetimeExtendedTemporary, EmptyShell{}) {}
3248 unsigned Mangling) {
3290 return K == Decl::LifetimeExtendedTemporary;
3323 void anchor()
override;
3335 UsingShadowDecl *getMostRecentDeclImpl()
override {
3382 assert(ND &&
"Target decl is null!");
3398 return dyn_cast_or_null<UsingShadowDecl>(UsingOrNextShadow);
3403 return K == Decl::UsingShadow || K == Decl::ConstructorUsingShadow;
3416 llvm::PointerIntPair<UsingShadowDecl *, 1, bool> FirstUsingShadow;
3423 void anchor()
override;
3456 Current = Current->getNextUsingShadowDecl();
3467 return x.Current == y.Current;
3470 return x.Current != y.Current;
3520 UsingLocation(UL), QualifierLoc(QualifierLoc),
3525 void anchor()
override;
3563 bool HasTypenameKeyword);
3606 LLVM_PREFERRED_TYPE(
bool)
3607 unsigned IsVirtual : 1;
3611 bool TargetInVirtualBase)
3613 Using->getDeclName(), Using,
3614 Target->getUnderlyingDecl()),
3615 NominatedBaseClassShadowDecl(
3616 dyn_cast<ConstructorUsingShadowDecl>(
Target)),
3617 ConstructedBaseClassShadowDecl(NominatedBaseClassShadowDecl),
3618 IsVirtual(TargetInVirtualBase) {
3622 if (NominatedBaseClassShadowDecl &&
3623 NominatedBaseClassShadowDecl->constructsVirtualBase()) {
3624 ConstructedBaseClassShadowDecl =
3625 NominatedBaseClassShadowDecl->ConstructedBaseClassShadowDecl;
3633 void anchor()
override;
3667 return NominatedBaseClassShadowDecl;
3673 return ConstructedBaseClassShadowDecl;
3683 return cast<CXXRecordDecl>((ConstructedBaseClassShadowDecl
3684 ? ConstructedBaseClassShadowDecl
3716 :
BaseUsingDecl(UsingEnum, DC, NL, DN), UsingLocation(UL), EnumLocation(EL),
3719 void anchor()
override;
3737 return ETL.getQualifierLoc();
3787 private llvm::TrailingObjects<UsingPackDecl, NamedDecl *> {
3793 unsigned NumExpansions;
3798 InstantiatedFrom ? InstantiatedFrom->getLocation()
3800 InstantiatedFrom ? InstantiatedFrom->getDeclName()
3802 InstantiatedFrom(InstantiatedFrom), NumExpansions(UsingDecls.size()) {
3803 std::uninitialized_copy(UsingDecls.begin(), UsingDecls.end(),
3804 getTrailingObjects<NamedDecl *>());
3807 void anchor()
override;
3822 return llvm::ArrayRef(getTrailingObjects<NamedDecl *>(), NumExpansions);
3830 unsigned NumExpansions);
3833 return InstantiatedFrom->getSourceRange();
3855 public Mergeable<UnresolvedUsingValueDecl> {
3876 UsingLocation(UsingLoc), EllipsisLoc(EllipsisLoc),
3877 QualifierLoc(QualifierLoc), DNLoc(NameInfo.
getInfo()) {}
3879 void anchor()
override;
3952 public Mergeable<UnresolvedUsingTypenameDecl> {
3970 :
TypeDecl(UnresolvedUsingTypename, DC, TargetNameLoc, TargetName,
3972 TypenameLocation(TypenameLoc), EllipsisLoc(EllipsisLoc),
3973 QualifierLoc(QualifierLoc) {}
3975 void anchor()
override;
4037 void anchor()
override;
4052 llvm::PointerIntPair<Expr *, 1, bool> AssertExprAndFailed;
4059 :
Decl(StaticAssert, DC, StaticAssertLoc),
4060 AssertExprAndFailed(AssertExpr, Failed), Message(Message),
4061 RParenLoc(RParenLoc) {}
4063 virtual void anchor();
4080 bool isFailed()
const {
return AssertExprAndFailed.getInt(); }
4107 Expr *Binding =
nullptr;
4112 void anchor()
override;
4139 this->Binding = Binding;
4159 private llvm::TrailingObjects<DecompositionDecl, BindingDecl *> {
4161 unsigned NumBindings;
4167 :
VarDecl(Decomposition,
C, DC, StartLoc, LSquareLoc,
nullptr, T, TInfo,
4171 getTrailingObjects<BindingDecl *>());
4173 B->setDecomposedDecl(
this);
4176 void anchor()
override;
4189 unsigned NumBindings);
4192 return llvm::ArrayRef(getTrailingObjects<BindingDecl *>(), NumBindings);
4235 GetterId(Getter), SetterId(Setter) {}
4237 void anchor()
override;
4282 public llvm::FoldingSetNode {
4294 void anchor()
override;
4320 ID.AddInteger(
P.Part1);
4321 ID.AddInteger(
P.Part2);
4322 ID.AddInteger(
P.Part3);
4323 ID.AddInteger(
P.getPart4And5AsUint64());
4338 public Mergeable<UnnamedGlobalConstantDecl>,
4339 public llvm::FoldingSetNode {
4344 void anchor()
override;
4382const StreamingDiagnostic &
operator<<(
const StreamingDiagnostic &DB,
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 ':'.
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 AccessSpecDecl * CreateDeserialized(ASTContext &C, unsigned ID)
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.
static BindingDecl * CreateDeserialized(ASTContext &C, unsigned ID)
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 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)
bool isDefaultConstructor() const
Whether this constructor is a default constructor (C++ [class.ctor]p5), which can be used to default-...
bool isDelegatingConstructor() const
Determine whether this constructor is a delegating constructor.
bool isSpecializationCopyingObject() const
Determine whether this is a member template specialization that would copy the object to itself.
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
bool isMoveConstructor() const
Determine whether this constructor is a move constructor (C++11 [class.copy]p3), which can be used to...
init_const_reverse_iterator init_rbegin() const
void setNumCtorInitializers(unsigned numCtorInitializers)
void setExplicitSpecifier(ExplicitSpecifier ES)
init_const_range inits() const
bool isCopyOrMoveConstructor() const
Determine whether this a copy or move constructor.
init_const_reverse_iterator init_rend() const
bool isInheritingConstructor() const
Determine whether this is an implicit constructor synthesized to model a call to a constructor inheri...
init_reverse_iterator init_rend()
llvm::iterator_range< init_iterator > init_range
CXXCtorInitializer *const * init_const_iterator
Iterates through the member/base initializer list.
const ExplicitSpecifier getExplicitSpecifier() const
unsigned getNumCtorInitializers() const
Determine the number of arguments used to initialize the member or base.
llvm::iterator_range< init_const_iterator > init_const_range
bool isConvertingConstructor(bool AllowExplicit) const
Whether this constructor is a converting constructor (C++ [class.conv.ctor]), which can be used for u...
const CXXConstructorDecl * getCanonicalDecl() const
static bool classof(const Decl *D)
void setCtorInitializers(CXXCtorInitializer **Initializers)
bool isCopyConstructor() const
Whether this constructor is a copy constructor (C++ [class.copy]p2, which can be used to copy the cla...
static CXXConstructorDecl * CreateDeserialized(ASTContext &C, unsigned ID, uint64_t AllocKind)
Represents a C++ conversion function within a class.
bool isLambdaToBlockPointerConversion() const
Determine whether this conversion function is a conversion from a lambda closure type to a block poin...
bool isExplicit() const
Return true if the declaration is already resolved to be explicit.
static bool classof(const Decl *D)
static bool classofKind(Kind K)
ExplicitSpecifier getExplicitSpecifier()
QualType getConversionType() const
Returns the type that this conversion function is converting to.
void setExplicitSpecifier(ExplicitSpecifier ES)
const CXXConversionDecl * getCanonicalDecl() const
static CXXConversionDecl * CreateDeserialized(ASTContext &C, unsigned ID)
CXXConversionDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
const ExplicitSpecifier getExplicitSpecifier() const
Represents a C++ base or member initializer.
FieldDecl * getMember() const
If this is a member initializer, returns the declaration of the non-static data member being initiali...
bool isDelegatingInitializer() const
Determine whether this initializer is creating a delegating constructor.
bool isWritten() const
Determine whether this initializer is explicitly written in the source code.
Expr * getInit() const
Get the initializer.
SourceLocation getRParenLoc() const
SourceLocation getEllipsisLoc() const
SourceLocation getLParenLoc() const
SourceRange getSourceRange() const LLVM_READONLY
Determine the source range covering the entire initializer.
int getSourceOrder() const
Return the source position of the initializer, counting from 0.
SourceLocation getSourceLocation() const
Determine the source location of the initializer.
bool isAnyMemberInitializer() const
bool isPackExpansion() const
Determine whether this initializer is a pack expansion.
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
bool isMemberInitializer() const
Determine whether this initializer is initializing a non-static data member.
bool isBaseInitializer() const
Determine whether this initializer is initializing a base class.
void setSourceOrder(int Pos)
Set the source order of this initializer.
bool isIndirectMemberInitializer() const
int64_t getID(const ASTContext &Context) const
bool isInClassMemberInitializer() const
Determine whether this initializer is an implicit initializer generated for a field with an initializ...
const Type * getBaseClass() const
If this is a base class initializer, returns the type of the base class.
SourceLocation getMemberLocation() const
FieldDecl * getAnyMember() const
IndirectFieldDecl * getIndirectMember() const
TypeLoc getBaseClassLoc() const
If this is a base class initializer, returns the type of the base class with location information.
bool isBaseVirtual() const
Returns whether the base is virtual or not.
Represents a C++ deduction guide declaration.
void setDeductionCandidateKind(DeductionCandidate K)
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...
ExplicitSpecifier getExplicitSpecifier()
static CXXDeductionGuideDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static bool classofKind(Kind K)
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)
Represents a C++ destructor within a class.
const FunctionDecl * getOperatorDelete() const
const CXXDestructorDecl * getCanonicalDecl() const
CXXDestructorDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
static bool classofKind(Kind K)
void setOperatorDelete(FunctionDecl *OD, Expr *ThisArg)
static CXXDestructorDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Expr * getOperatorDeleteThisArg() const
static bool classof(const Decl *D)
A mapping from each virtual member function to its set of final overriders.
A set of all the primary bases for a class.
Represents a static or instance method of a struct/union/class.
bool isExplicitObjectMemberFunction() const
[C++2b][dcl.fct]/p7 An explicit object member function is a non-static member function with an explic...
static bool classofKind(Kind K)
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, Expr *TrailingRequiresClause=nullptr)
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
static CXXMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool isUsualDeallocationFunction(SmallVectorImpl< const FunctionDecl * > &PreventedBy) const
Determine whether this is a usual deallocation function (C++ [basic.stc.dynamic.deallocation]p2),...
unsigned getNumExplicitParams() const
CXXMethodDecl * getMostRecentDecl()
overridden_method_range overridden_methods() const
unsigned size_overridden_methods() const
const CXXMethodDecl *const * method_iterator
QualType getFunctionObjectParameterReferenceType() const
Return the type of the object pointed by this.
RefQualifierKind getRefQualifier() const
Retrieve the ref-qualifier associated with this method.
method_iterator begin_overridden_methods() const
const CXXRecordDecl * getParent() const
Return the parent of this method declaration, which is the class in which this method is defined.
QualType getThisType() const
Return the type of the this pointer.
bool isMoveAssignmentOperator() const
Determine whether this is a move assignment operator.
Qualifiers getMethodQualifiers() const
CXXRecordDecl * getParent()
Return the parent of this method declaration, which is the class in which this method is defined.
QualType getFunctionObjectParameterType() const
const CXXMethodDecl * getCorrespondingMethodDeclaredInClass(const CXXRecordDecl *RD, bool MayBeBase=false) const
CXXMethodDecl * getDevirtualizedMethod(const Expr *Base, bool IsAppleKext)
If it's possible to devirtualize a call to this method, return the called function.
static bool isStaticOverloadedOperator(OverloadedOperatorKind OOK)
Returns true if the given operator is implicitly static in a record context.
CXXMethodDecl * getCorrespondingMethodInClass(const CXXRecordDecl *RD, bool MayBeBase=false)
Find the method in RD that corresponds to this one.
llvm::iterator_range< llvm::TinyPtrVector< const CXXMethodDecl * >::const_iterator > overridden_method_range
static bool classof(const Decl *D)
const CXXMethodDecl * getCanonicalDecl() const
bool isCopyAssignmentOperator() const
Determine whether this is a copy-assignment operator, regardless of whether it was declared implicitl...
method_iterator end_overridden_methods() const
CXXMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool isLambdaStaticInvoker() const
Determine whether this is a lambda closure type's static member function that is used for the result ...
const CXXMethodDecl * getCorrespondingMethodInClass(const CXXRecordDecl *RD, bool MayBeBase=false) const
An iterator over the friend declarations of a class.
Represents a C++ struct/union/class.
ctor_iterator ctor_end() const
bool hasCopyConstructorWithConstParam() const
Determine whether this class has a copy constructor with a parameter type which is a reference to a c...
bool hasConstexprDefaultConstructor() const
Determine whether this class has a constexpr default constructor.
bool hasMoveConstructor() const
Determine whether this class has a move constructor.
bool hasDefaultConstructor() const
Determine whether this class has any default constructors.
friend_range friends() const
friend_iterator friend_begin() const
bool hasMutableFields() const
Determine whether this class, or any of its class subobjects, contains a mutable field.
Decl * getLambdaContextDecl() const
Retrieve the declaration that provides additional context for a lambda, when the normal declaration c...
ctor_iterator ctor_begin() const
bool mayBeAbstract() const
Determine whether this class may end up being abstract, even though it is not yet known to be abstrac...
bool hasTrivialMoveAssignment() const
Determine whether this class has a trivial move assignment operator (C++11 [class....
void setLambdaTypeInfo(TypeSourceInfo *TS)
bool isTriviallyCopyable() const
Determine whether this class is considered trivially copyable per (C++11 [class]p6).
bool hasNonTrivialCopyAssignment() const
Determine whether this class has a non-trivial copy assignment operator (C++ [class....
TemplateParameterList * getGenericLambdaTemplateParameterList() const
Retrieve the generic lambda's template parameter list.
bool isEffectivelyFinal() const
Determine whether it's impossible for a class to be derived from this class.
bool hasSimpleMoveConstructor() const
true if we know for sure that this class has a single, accessible, unambiguous move constructor that ...
bool isAggregate() const
Determine whether this class is an aggregate (C++ [dcl.init.aggr]), which is a class with no user-dec...
void getIndirectPrimaryBases(CXXIndirectPrimaryBaseSet &Bases) const
Get the indirect primary bases for this class.
bool hasTrivialDefaultConstructor() const
Determine whether this class has a trivial default constructor (C++11 [class.ctor]p5).
void setBases(CXXBaseSpecifier const *const *Bases, unsigned NumBases)
Sets the base classes of this struct or class.
bool isGenericLambda() const
Determine whether this class describes a generic lambda function object (i.e.
base_class_iterator bases_end()
llvm::iterator_range< friend_iterator > friend_range
CXXRecordDecl * getMostRecentDecl()
bool hasPrivateFields() const
bool hasTrivialDestructor() const
Determine whether this class has a trivial destructor (C++ [class.dtor]p3)
bool hasUserDeclaredDestructor() const
Determine whether this class has a user-declared destructor.
unsigned getLambdaDependencyKind() const
void setLambdaIsGeneric(bool IsGeneric)
specific_decl_iterator< CXXConstructorDecl > ctor_iterator
Iterator access to constructor members.
bool implicitCopyConstructorHasConstParam() const
Determine whether an implicit copy constructor for this type would have a parameter with a const-qual...
bool defaultedDestructorIsDeleted() const
true if a defaulted destructor for this class would be deleted.
const FunctionDecl * isLocalClass() const
If the class is a local class [class.local], returns the enclosing function declaration.
bool hasInheritedAssignment() const
Determine whether this class has a using-declaration that names a base class assignment operator.
bool hasUninitializedReferenceMember() const
Whether this class or any of its subobjects has any members of reference type which would make value-...
bool allowConstDefaultInit() const
Determine whether declaring a const variable with this type is ok per core issue 253.
CXXRecordDecl * getInstantiatedFromMemberClass() const
If this record is an instantiation of a member class, retrieves the member class from which it was in...
bool hasTrivialDestructorForCall() const
bool defaultedMoveConstructorIsDeleted() const
true if a defaulted move constructor for this class would be deleted.
void completeDefinition() override
Indicates that the definition of this class is now complete.
base_class_const_iterator bases_end() const
bool isLiteral() const
Determine whether this class is a literal type.
bool hasUserDeclaredMoveAssignment() const
Determine whether this class has had a move assignment declared by the user.
CXXRecordDecl * getTemplateInstantiationPattern()
bool defaultedDestructorIsConstexpr() const
Determine whether a defaulted default constructor for this class would be constexpr.
bool mayBeNonDynamicClass() const
bool isStandardLayout() const
Determine whether this class is standard-layout per C++ [class]p7.
void setCaptures(ASTContext &Context, ArrayRef< LambdaCapture > Captures)
Set the captures for this lambda closure type.
void pushFriendDecl(FriendDecl *FD)
unsigned getDeviceLambdaManglingNumber() const
Retrieve the device side mangling number.
llvm::iterator_range< capture_const_iterator > capture_const_range
bool hasKnownLambdaInternalLinkage() const
The lambda is known to has internal linkage no matter whether it has name mangling number.
specific_decl_iterator< CXXMethodDecl > method_iterator
Iterator access to method members.
bool hasProtectedFields() const
bool hasAnyDependentBases() const
Determine whether this class has any dependent base classes which are not the current instantiation.
unsigned getLambdaIndexInContext() const
Retrieve the index of this lambda within the context declaration returned by getLambdaContextDecl().
void setTrivialForCallFlags(CXXMethodDecl *MD)
static CXXRecordDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
const CXXRecordDecl * getPreviousDecl() const
bool isLambda() const
Determine whether this class describes a lambda function object.
bool hasTrivialMoveConstructor() const
Determine whether this class has a trivial move constructor (C++11 [class.copy]p12)
bool needsImplicitDefaultConstructor() const
Determine if we need to declare a default constructor for this class.
void viewInheritance(ASTContext &Context) const
Renders and displays an inheritance diagram for this C++ class and all of its base classes (transitiv...
bool needsImplicitMoveConstructor() const
Determine whether this class should get an implicit move constructor or if any existing special membe...
bool hasUserDeclaredCopyAssignment() const
Determine whether this class has a user-declared copy assignment operator.
capture_const_iterator captures_end() const
bool isProvablyNotDerivedFrom(const CXXRecordDecl *Base) const
Determine whether this class is provably not derived from the type Base.
void addedSelectedDestructor(CXXDestructorDecl *DD)
Notify the class that this destructor is now selected.
unsigned getLambdaManglingNumber() const
If this is the closure type of a lambda expression, retrieve the number to be used for name mangling ...
bool isNeverDependentLambda() const
bool hasFriends() const
Determines whether this record has any friends.
method_range methods() const
static bool classof(const Decl *D)
bool hasNonTrivialDestructor() const
Determine whether this class has a non-trivial destructor (C++ [class.dtor]p3)
CXXRecordDecl * getDefinition() const
bool needsOverloadResolutionForCopyAssignment() const
Determine whether we need to eagerly declare a defaulted copy assignment operator for this class.
static AccessSpecifier MergeAccess(AccessSpecifier PathAccess, AccessSpecifier DeclAccess)
Calculates the access of a decl that is reached along a path.
bool isParsingBaseSpecifiers() const
void getCaptureFields(llvm::DenseMap< const ValueDecl *, FieldDecl * > &Captures, FieldDecl *&ThisCapture) const
For a closure type, retrieve the mapping from captured variables and this to the non-static data memb...
bool hasConstexprNonCopyMoveConstructor() const
Determine whether this class has at least one constexpr constructor other than the copy or move const...
static CXXRecordDecl * CreateLambda(const ASTContext &C, DeclContext *DC, TypeSourceInfo *Info, SourceLocation Loc, unsigned DependencyKind, bool IsGeneric, LambdaCaptureDefault CaptureDefault)
llvm::iterator_range< conversion_iterator > getVisibleConversionFunctions() const
Get all conversion functions visible in current class, including conversion function templates.
bool defaultedDefaultConstructorIsConstexpr() const
Determine whether a defaulted default constructor for this class would be constexpr.
bool hasTrivialCopyConstructor() const
Determine whether this class has a trivial copy constructor (C++ [class.copy]p6, C++11 [class....
void setImplicitMoveAssignmentIsDeleted()
Set that we attempted to declare an implicit move assignment operator, but overload resolution failed...
bool hasConstexprDestructor() const
Determine whether this class has a constexpr destructor.
bool isPolymorphic() const
Whether this class is polymorphic (C++ [class.virtual]), which means that the class contains or inher...
unsigned getNumBases() const
Retrieves the number of base classes of this class.
bool hasNonLiteralTypeFieldsOrBases() const
Determine whether this class has a non-literal or/ volatile type non-static data member or base class...
base_class_const_range bases() const
bool defaultedCopyConstructorIsDeleted() const
true if a defaulted copy constructor for this class would be deleted.
CXXRecordDecl * getMostRecentNonInjectedDecl()
bool isStructural() const
Determine whether this is a structural type.
bool hasMoveAssignment() const
Determine whether this class has a move assignment operator.
bool isTriviallyCopyConstructible() const
Determine whether this class is considered trivially copyable per.
bool hasTrivialCopyConstructorForCall() const
bool isCapturelessLambda() const
llvm::iterator_range< specific_decl_iterator< CXXMethodDecl > > method_range
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated.
bool hasInitMethod() const
bool lookupInBases(BaseMatchesCallback BaseMatches, CXXBasePaths &Paths, bool LookupInDependent=false) const
Look for entities within the base classes of this C++ class, transitively searching all base class su...
method_iterator method_begin() const
Method begin iterator.
bool lambdaIsDefaultConstructibleAndAssignable() const
Determine whether this lambda should have an implicit default constructor and copy and move assignmen...
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine whether this particular class is a specialization or instantiation of a class template or m...
base_class_iterator bases_begin()
FunctionTemplateDecl * getDependentLambdaCallOperator() const
Retrieve the dependent lambda call operator of the closure type if this is a templated closure type.
bool hasTrivialCopyAssignment() const
Determine whether this class has a trivial copy assignment operator (C++ [class.copy]p11,...
void addedEligibleSpecialMemberFunction(const CXXMethodDecl *MD, unsigned SMKind)
Notify the class that an eligible SMF has been added.
conversion_iterator conversion_end() const
base_class_range vbases()
bool hasUserProvidedDefaultConstructor() const
Whether this class has a user-provided default constructor per C++11.
base_class_iterator vbases_begin()
capture_const_range captures() const
void setImplicitMoveConstructorIsDeleted()
Set that we attempted to declare an implicit move constructor, but overload resolution failed so we d...
void finishedDefaultedOrDeletedMember(CXXMethodDecl *MD)
Indicates that the declaration of a defaulted or deleted special member function is now complete.
bool isAbstract() const
Determine whether this class has a pure virtual function.
base_class_const_iterator bases_begin() const
TypeSourceInfo * getLambdaTypeInfo() const
bool hasVariantMembers() const
Determine whether this class has any variant members.
void setImplicitCopyConstructorIsDeleted()
Set that we attempted to declare an implicit copy constructor, but overload resolution failed so we d...
CXXRecordDecl(Kind K, TagKind TK, const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl)
bool isDynamicClass() const
bool isCLike() const
True if this class is C-like, without C++-specific features, e.g.
void setInstantiationOfMemberClass(CXXRecordDecl *RD, TemplateSpecializationKind TSK)
Specify that this record is an instantiation of the member class RD.
bool hasInClassInitializer() const
Whether this class has any in-class initializers for non-static data members (including those in anon...
void markEmpty()
Marks this record as empty.
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.
bool isDependentLambda() const
Determine whether this lambda expression was known to be dependent at the time it was created,...
bool hasSimpleMoveAssignment() const
true if we know for sure that this class has a single, accessible, unambiguous move assignment operat...
bool hasNonTrivialMoveConstructor() const
Determine whether this class has a non-trivial move constructor (C++11 [class.copy]p12)
bool hasNonTrivialCopyConstructorForCall() const
bool hasDirectFields() const
Determine whether this class has direct non-static data members.
const CXXRecordDecl * getCanonicalDecl() const
MSInheritanceModel getMSInheritanceModel() const
Returns the inheritance model used for this record.
bool hasUserDeclaredCopyConstructor() const
Determine whether this class has a user-declared copy constructor.
bool isCXX11StandardLayout() const
Determine whether this class was standard-layout per C++11 [class]p7, specifically using the C++11 ru...
bool nullFieldOffsetIsZero() const
In the Microsoft C++ ABI, use zero for the field offset of a null data member pointer if we can guara...
bool hasUserDeclaredConstructor() const
Determine whether this class has any user-declared constructors.
base_class_const_iterator vbases_begin() const
llvm::iterator_range< base_class_iterator > base_class_range
unsigned getODRHash() const
LambdaNumbering getLambdaNumbering() const
llvm::iterator_range< specific_decl_iterator< CXXConstructorDecl > > ctor_range
bool hasDefinition() const
ArrayRef< NamedDecl * > getLambdaExplicitTemplateParameters() const
Retrieve the lambda template parameters that were specified explicitly.
void setImplicitCopyAssignmentIsDeleted()
Set that we attempted to declare an implicit copy assignment operator, but overload resolution failed...
bool needsImplicitDestructor() const
Determine whether this class needs an implicit destructor to be lazily declared.
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
bool isPOD() const
Whether this class is a POD-type (C++ [class]p4)
void getFinalOverriders(CXXFinalOverriderMap &FinaOverriders) const
Retrieve the final overriders for each virtual member function in the class hierarchy where this clas...
llvm::function_ref< bool(const CXXBaseSpecifier *Specifier, CXXBasePath &Path)> BaseMatchesCallback
Function type used by lookupInBases() to determine whether a specific base class subobject matches th...
void removeConversion(const NamedDecl *Old)
Removes a conversion function from this class.
const CXXRecordDecl * getMostRecentNonInjectedDecl() const
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()
void setInitMethod(bool Val)
bool isEmpty() const
Determine whether this is an empty class in the sense of (C++11 [meta.unary.prop]).
LambdaCaptureDefault getLambdaCaptureDefault() const
bool hasMemberName(DeclarationName N) const
Determine whether this class has a member with the given name, possibly in a non-dependent base class...
bool needsOverloadResolutionForMoveAssignment() const
Determine whether we need to eagerly declare a move assignment operator for this class.
CXXDestructorDecl * getDestructor() const
Returns the destructor decl for this class.
bool hasCopyAssignmentWithConstParam() const
Determine whether this class has a copy assignment operator with a parameter type which is a referenc...
bool hasNonTrivialMoveAssignment() const
Determine whether this class has a non-trivial move assignment operator (C++11 [class....
bool hasNonTrivialDestructorForCall() const
void setHasTrivialSpecialMemberForCall()
method_iterator method_end() const
Method past-the-end iterator.
static bool classofKind(Kind K)
capture_const_iterator captures_begin() const
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
llvm::iterator_range< base_class_const_iterator > base_class_const_range
bool hasUserDeclaredMoveOperation() const
Whether this class has a user-declared move constructor or assignment operator.
llvm::function_ref< bool(const CXXRecordDecl *BaseDefinition)> ForallBasesCallback
Function type used by forallBases() as a callback.
bool hasInheritedConstructor() const
Determine whether this class has a using-declaration that names a user-declared base class constructo...
static bool FindVirtualBaseClass(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, const CXXRecordDecl *BaseRecord)
Base-class lookup callback that determines whether the given base class specifier refers to a specifi...
CXXMethodDecl * getLambdaStaticInvoker() const
Retrieve the lambda static invoker, the address of which is returned by the conversion operator,...
bool hasNonTrivialDefaultConstructor() const
Determine whether this class has a non-trivial default constructor (C++11 [class.ctor]p5).
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
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
bool hasTrivialMoveConstructorForCall() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization,...
std::vector< const NamedDecl * > lookupDependentName(DeclarationName Name, llvm::function_ref< bool(const NamedDecl *ND)> Filter)
Performs an imprecise lookup of a dependent name in this class.
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
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.
CXXRecordDecl * getParent()
static bool classof(const Decl *D)
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
static bool classofKind(Kind K)
UsingDecl * getIntroducer() const
Override the UsingShadowDecl's getIntroducer, returning the UsingDecl that introduced this.
static ConstructorUsingShadowDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool constructsVirtualBase() const
Returns true if the constructed base class is a virtual base class subobject of this declaration's cl...
ConstructorUsingShadowDecl * getConstructedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the base class for which we don't have an explicit ini...
ConstructorUsingShadowDecl * getNominatedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the direct base class from which this using shadow dec...
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
FunctionDeclBitfields FunctionDeclBits
CXXConstructorDeclBitfields CXXConstructorDeclBits
decl_iterator decls_end() const
LinkageSpecDeclBitfields LinkageSpecDeclBits
decl_iterator decls_begin() const
Decl - This represents one declaration (or definition), e.g.
SourceLocation getEndLoc() const LLVM_READONLY
ASTContext & getASTContext() const LLVM_READONLY
Kind
Lists the kind of concrete classes of Decl.
unsigned getIdentifierNamespace() const
void setAccess(AccessSpecifier AS)
SourceLocation getLocation() const
IdentifierNamespace
IdentifierNamespace - The different namespaces in which declarations may appear.
@ IDNS_TagFriend
This declaration is a friend class.
@ IDNS_OrdinaryFriend
This declaration is a friend function.
@ IDNS_LocalExtern
This declaration is a function-local extern declaration of a variable or function.
void setImplicit(bool I=true)
void setLocation(SourceLocation L)
DeclContext * getDeclContext()
const LangOptions & getLangOpts() const LLVM_READONLY
Helper to get the language options from the ASTContext.
DeclarationNameLoc - Additional source/type location info for a declaration name.
The name of a declaration.
TemplateDecl * getCXXDeductionGuideTemplate() const
If this name is the name of a C++ deduction guide, return the template associated with that name.
static DeclarationName getUsingDirectiveName()
Returns the name for all C++ using-directives.
Represents a ValueDecl that came out of a declarator.
A decomposition declaration.
void printName(raw_ostream &OS, const PrintingPolicy &Policy) const override
Pretty-print the unqualified name of this declaration.
ArrayRef< BindingDecl * > bindings() const
static bool classof(const Decl *D)
static bool classofKind(Kind K)
static DecompositionDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned NumBindings)
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
Store information needed for an explicit specifier.
bool isExplicit() const
Determine whether this specifier is known to correspond to an explicit declaration.
ExplicitSpecKind getKind() const
bool isInvalid() const
Determine if the explicit specifier is invalid.
static ExplicitSpecifier Invalid()
static const ExplicitSpecifier getFromDecl(const FunctionDecl *Function)
const Expr * getExpr() const
ExplicitSpecifier()=default
void setKind(ExplicitSpecKind Kind)
static ExplicitSpecifier getFromDecl(FunctionDecl *Function)
bool isSpecified() const
Determine if the declaration had an explicit specifier of any kind.
bool isEquivalent(const ExplicitSpecifier Other) const
Check for equivalence of explicit specifiers.
ExplicitSpecifier(Expr *Expression, ExplicitSpecKind Kind)
This represents one expression.
Represents a member of a struct/union/class.
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Represents a function declaration or definition.
void setIsPureVirtual(bool P=true)
bool UsesFPIntrin() const
Determine whether the function was declared in source context that requires constrained FP intrinsics...
QualType getReturnType() const
FunctionDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
void setRangeEnd(SourceLocation E)
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
Represents a prototype with parameter type info, e.g.
Declaration of a template function.
FunctionType - C99 6.7.5.3 - Function Declarators.
One of these records is kept for each identifier that is lexed.
Represents a field injected from an anonymous union/struct into the parent scope.
FieldDecl * getAnonField() const
Description of a constructor that was inherited from a base class.
InheritedConstructor()=default
CXXConstructorDecl * getConstructor() const
InheritedConstructor(ConstructorUsingShadowDecl *Shadow, CXXConstructorDecl *BaseCtor)
ConstructorUsingShadowDecl * getShadowDecl() const
Describes the capture of a variable or of this, or of a C++1y init-capture.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
const ValueDecl * getExtendingDecl() const
unsigned getManglingNumber() const
APValue * getValue() const
static LifetimeExtendedTemporaryDecl * CreateDeserialized(ASTContext &C, unsigned ID)
APValue * getOrCreateValue(bool MayCreate) const
Get the storage for the constant value of a materialized temporary of static storage duration.
static bool classof(const Decl *D)
Stmt::child_range childrenExpr()
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Stmt::const_child_range childrenExpr() const
static LifetimeExtendedTemporaryDecl * Create(Expr *Temp, ValueDecl *EDec, unsigned Mangling)
Expr * getTemporaryExpr()
Retrieve the expression to which the temporary materialization conversion was applied.
const Expr * getTemporaryExpr() const
ValueDecl * getExtendingDecl()
static bool classofKind(Kind K)
Represents a linkage specification.
void setExternLoc(SourceLocation L)
void setLanguage(LinkageSpecLanguageIDs L)
Set the language specified by this linkage specification.
static bool classofKind(Kind K)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setRBraceLoc(SourceLocation L)
static LinkageSpecDecl * castFromDeclContext(const DeclContext *DC)
static LinkageSpecDecl * CreateDeserialized(ASTContext &C, unsigned ID)
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)
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
static bool classof(const Decl *D)
Parts getParts() const
Get the decomposed parts of this declaration.
static bool classofKind(Kind K)
static void Profile(llvm::FoldingSetNodeID &ID, Parts P)
void Profile(llvm::FoldingSetNodeID &ID)
APValue & getAsAPValue() const
Get the value of this MSGuidDecl as an APValue.
void printName(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const override
Print this UUID in a human-readable format.
An instance of this class represents the declaration of a property member.
static bool classof(const Decl *D)
IdentifierInfo * getGetterId() const
IdentifierInfo * getSetterId() const
static MSPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Provides information a specialization of a member of a class template, which may be a member function...
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
UsingDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
This represents a decl that may have a name.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
NamedDecl * getMostRecentDecl()
Represents a C++ namespace alias.
const NamespaceAliasDecl * getCanonicalDecl() const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of the namespace.
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...
static NamespaceAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
SourceLocation getAliasLoc() const
Returns the location of the alias name, i.e.
NamedDecl * 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
static bool classofKind(Kind K)
const NamespaceDecl * getNamespace() const
Represent a C++ namespace.
A C++ nested-name-specifier augmented with source location information.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
A (possibly-)qualified type.
void Profile(llvm::FoldingSetNodeID &ID) const
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
The collection of all-type qualifiers we support.
Represents a struct/union/class.
bool isInjectedClassName() const
Determines whether this declaration represents the injected class name.
Provides common interface for the Decls that can be redeclared.
NamespaceAliasDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
UsingShadowDecl * getNextRedeclaration() const
NamespaceAliasDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
redecl_iterator redecls_end() const
llvm::iterator_range< redecl_iterator > redecl_range
NamespaceAliasDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
redecl_iterator redecls_begin() const
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Represents the body of a requires-expression.
static RequiresExprBodyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static DeclContext * castToDeclContext(const RequiresExprBodyDecl *D)
static RequiresExprBodyDecl * castFromDeclContext(const DeclContext *DC)
static bool classofKind(Kind K)
static bool classof(const Decl *D)
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
Represents a C++11 static_assert declaration.
const Expr * getMessage() const
static bool classofKind(Kind K)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
const Expr * getAssertExpr() const
SourceLocation getRParenLoc() const
static StaticAssertDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static bool classof(const Decl *D)
Stmt - This represents one statement.
llvm::iterator_range< child_iterator > child_range
llvm::iterator_range< const_child_iterator > const_child_range
void startDefinition()
Starts the definition of this tag declaration.
TagDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Stores a list of template parameters for a TemplateDecl and its derived classes.
Represents a declaration of a type.
SourceLocation getBeginLoc() const LLVM_READONLY
Base wrapper for a particular "section" of type source info.
SourceLocation getBeginLoc() const
Get the begin source location.
A container of type source information.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
QualType getType() const
Return the type wrapped by this type source info.
The base class of the type hierarchy.
const T * castAs() const
Member-template castAs<specific type>.
const T * getAs() const
Member-template getAs<specific type>'.
TagDecl * getAsTagDecl() const
Retrieves the TagDecl that this type refers to, either because the type is a TagType or because it is...
An artificial decl, representing a global anonymous constant value which is uniquified by value withi...
const APValue & getValue() const
static bool classofKind(Kind K)
static bool classof(const Decl *D)
void printName(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const override
Print this in a human-readable format.
static void Profile(llvm::FoldingSetNodeID &ID, QualType Ty, const APValue &APVal)
void Profile(llvm::FoldingSetNodeID &ID)
The iterator over UnresolvedSets.
This node is generated when a using-declaration that was annotated with attribute((using_if_exists)) ...
static bool classof(const Decl *D)
static UnresolvedUsingIfExistsDecl * CreateDeserialized(ASTContext &Ctx, unsigned ID)
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.
static UnresolvedUsingTypenameDecl * CreateDeserialized(ASTContext &C, unsigned ID)
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
static bool classofKind(Kind K)
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
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
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').
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.
static bool classof(const Decl *D)
static UnresolvedUsingValueDecl * CreateDeserialized(ASTContext &C, unsigned ID)
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.
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.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
void setUsingLoc(SourceLocation L)
Set the source location of the 'using' keyword.
const UsingDecl * getCanonicalDecl() const
DeclarationNameInfo getNameInfo() const
static bool classof(const Decl *D)
static bool classofKind(Kind K)
static UsingDecl * CreateDeserialized(ASTContext &C, unsigned ID)
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
Represents C++ using-directive.
const NamedDecl * getNominatedNamespaceAsWritten() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
const DeclContext * getCommonAncestor() const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of the namespace.
static bool classofKind(Kind K)
static UsingDirectiveDecl * CreateDeserialized(ASTContext &C, unsigned ID)
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.
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.
NestedNameSpecifier * getQualifier() const
EnumDecl * getEnumDecl() const
static UsingEnumDecl * CreateDeserialized(ASTContext &C, unsigned ID)
const UsingEnumDecl * getCanonicalDecl() const
TypeSourceInfo * getEnumType() const
static bool classofKind(Kind K)
static bool classof(const Decl *D)
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.
const UsingPackDecl * getCanonicalDecl() const
UsingPackDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
NamedDecl * getInstantiatedFromUsingDecl() const
Get the using declaration from which this was instantiated.
static bool classof(const Decl *D)
static bool classofKind(Kind K)
static UsingPackDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned NumExpansions)
ArrayRef< NamedDecl * > expansions() const
Get the set of using declarations that this pack expanded into.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
UsingShadowDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
redeclarable_base::redecl_range redecl_range
static UsingShadowDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation Loc, DeclarationName Name, BaseUsingDecl *Introducer, NamedDecl *Target)
UsingShadowDecl * getNextUsingShadowDecl() const
The next using shadow declaration contained in the shadow decl chain of the using declaration which i...
void setTargetDecl(NamedDecl *ND)
Sets the underlying declaration which has been brought into the local scope.
static bool classofKind(Kind K)
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
static UsingShadowDecl * CreateDeserialized(ASTContext &C, unsigned ID)
redeclarable_base::redecl_iterator redecl_iterator
UsingShadowDecl(Kind K, ASTContext &C, DeclContext *DC, SourceLocation Loc, DeclarationName Name, BaseUsingDecl *Introducer, NamedDecl *Target)
static bool classof(const Decl *D)
friend class BaseUsingDecl
BaseUsingDecl * getIntroducer() const
Gets the (written or instantiated) using declaration that introduced this declaration.
const UsingShadowDecl * getCanonicalDecl() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
void setType(QualType newType)
Represents a variable declaration or definition.
The JSON file list parser is used to communicate input to InstallAPI.
@ Create
'copyin' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
ConstexprSpecKind
Define the kind of constexpr specifier.
LinkageSpecLanguageIDs
Represents the language in a linkage specification.
RefQualifierKind
The kind of C++11 ref-qualifier associated with a function type.
StorageClass
Storage classes.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
StorageDuration
The storage duration for an object (per C++ [basic.stc]).
MSVtorDispMode
In the Microsoft ABI, this controls the placement of virtual displacement members used to implement v...
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
LazyOffsetPtr< Decl, uint32_t, &ExternalASTSource::GetExternalDecl > LazyDeclPtr
A lazy pointer to a declaration.
DeductionCandidate
Only used by CXXDeductionGuideDecl.
MSInheritanceModel
Assigned inheritance model for a class in the MS C++ ABI.
ExplicitSpecKind
Define the meaning of possible values of the kind in ExplicitSpecifier.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
CallingConv
CallingConv - Specifies the calling convention that a function uses.
LazyOffsetPtr< CXXBaseSpecifier, uint64_t, &ExternalASTSource::GetExternalCXXBaseSpecifiers > LazyCXXBaseSpecifiersPtr
A lazy pointer to a set of CXXBaseSpecifiers.
@ Other
Other implicit parameter.
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
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.