23 #include "llvm/ADT/STLExtras.h"
24 #include "llvm/ADT/SmallPtrSet.h"
25 using namespace clang;
31 void AccessSpecDecl::anchor() { }
37 void LazyASTUnresolvedSet::getFromExternalSource(
ASTContext &
C)
const {
39 assert(Impl.Decls.isLazy() &&
"getFromExternalSource for non-lazy set");
40 assert(Source &&
"getFromExternalSource with no external source");
44 reinterpret_cast<uintptr_t>(
I.getDecl()) >> 2)));
45 Impl.Decls.setLazy(
false);
48 CXXRecordDecl::DefinitionData::DefinitionData(
CXXRecordDecl *D)
49 : UserDeclaredConstructor(
false), UserDeclaredSpecialMembers(0),
51 Abstract(
false), IsStandardLayout(
true), HasNoNonEmptyBases(
true),
52 HasPrivateFields(
false), HasProtectedFields(
false),
53 HasPublicFields(
false), HasMutableFields(
false), HasVariantMembers(
false),
54 HasOnlyCMembers(
true), HasInClassInitializer(
false),
55 HasUninitializedReferenceMember(
false), HasUninitializedFields(
false),
56 HasInheritedConstructor(
false), HasInheritedAssignment(
false),
57 NeedOverloadResolutionForMoveConstructor(
false),
58 NeedOverloadResolutionForMoveAssignment(
false),
59 NeedOverloadResolutionForDestructor(
false),
60 DefaultedMoveConstructorIsDeleted(
false),
61 DefaultedMoveAssignmentIsDeleted(
false),
62 DefaultedDestructorIsDeleted(
false), HasTrivialSpecialMembers(SMF_All),
63 DeclaredNonTrivialSpecialMembers(0), HasIrrelevantDestructor(
true),
64 HasConstexprNonCopyMoveConstructor(
false),
65 HasDefaultedDefaultConstructor(
false),
66 DefaultedDefaultConstructorIsConstexpr(
true),
67 HasConstexprDefaultConstructor(
false),
68 HasNonLiteralTypeFieldsOrBases(
false), ComputedVisibleConversions(
false),
69 UserProvidedDefaultConstructor(
false), DeclaredSpecialMembers(0),
70 ImplicitCopyConstructorHasConstParam(
true),
71 ImplicitCopyAssignmentHasConstParam(
true),
72 HasDeclaredCopyConstructorWithConstParam(
false),
73 HasDeclaredCopyAssignmentWithConstParam(
false), IsLambda(
false),
74 IsParsingBaseSpecifiers(
false), NumBases(0), NumVBases(0), Bases(),
75 VBases(), Definition(D), FirstFriend() {}
78 return Bases.get(
Definition->getASTContext().getExternalSource());
82 return VBases.get(
Definition->getASTContext().getExternalSource());
89 :
RecordDecl(K, TK, C, DC, StartLoc, IdLoc, Id, PrevDecl),
90 DefinitionData(PrevDecl ? PrevDecl->DefinitionData
92 TemplateOrInstantiation() {}
98 bool DelayTypeCreation) {
100 IdLoc, Id, PrevDecl);
104 if (!DelayTypeCreation)
112 bool Dependent,
bool IsGeneric,
119 new (
C)
struct LambdaDefinitionData(R, Info, Dependent, IsGeneric,
122 R->setImplicit(
true);
141 if (!data().Bases.isOffset() && data().NumBases > 0)
148 data().Aggregate =
false;
153 data().PlainOldData =
false;
157 llvm::SmallPtrSet<CanQualType, 8> SeenVBaseTypes;
163 data().NumBases = NumBases;
164 for (
unsigned i = 0; i < NumBases; ++i) {
165 data().getBases()[i] = *Bases[i];
175 if (!BaseClassDecl->
isEmpty()) {
185 data().IsStandardLayout =
false;
191 data().Empty =
false;
192 data().HasNoNonEmptyBases =
false;
198 data().Aggregate =
false;
204 data().Polymorphic =
true;
210 data().IsStandardLayout =
false;
214 data().HasNonLiteralTypeFieldsOrBases =
true;
217 for (
const auto &VBase : BaseClassDecl->
vbases()) {
220 VBases.push_back(&VBase);
227 if (
CXXRecordDecl *VBaseDecl = VBase.getType()->getAsCXXRecordDecl())
228 if (!VBaseDecl->hasCopyConstructorWithConstParam())
229 data().ImplicitCopyConstructorHasConstParam =
false;
233 data().Aggregate =
false;
240 VBases.push_back(Base);
245 data().Empty =
false;
249 data().Aggregate =
false;
255 data().HasTrivialSpecialMembers &= SMF_Destructor;
260 data().IsStandardLayout =
false;
265 data().DefaultedDefaultConstructorIsConstexpr =
false;
272 data().HasTrivialSpecialMembers &= ~SMF_DefaultConstructor;
280 data().HasTrivialSpecialMembers &= ~SMF_CopyConstructor;
286 data().HasTrivialSpecialMembers &= ~SMF_MoveConstructor;
294 data().HasTrivialSpecialMembers &= ~SMF_CopyAssignment;
300 data().HasTrivialSpecialMembers &= ~SMF_MoveAssignment;
307 data().DefaultedDefaultConstructorIsConstexpr =
false;
314 data().HasTrivialSpecialMembers &= ~SMF_Destructor;
317 data().HasIrrelevantDestructor =
false;
325 data().ImplicitCopyAssignmentHasConstParam =
false;
333 data().ImplicitCopyConstructorHasConstParam =
false;
345 data().HasMutableFields =
true;
348 data().HasUninitializedReferenceMember =
true;
351 data().HasUninitializedFields =
true;
353 addedClassSubobject(BaseClassDecl);
356 if (VBases.empty()) {
357 data().IsParsingBaseSpecifiers =
false;
363 data().NumVBases = VBases.size();
364 for (
int I = 0,
E = VBases.size();
I !=
E; ++
I) {
368 data().getVBases()[
I] = *VBases[
I];
371 data().IsParsingBaseSpecifiers =
false;
374 void CXXRecordDecl::addedClassSubobject(
CXXRecordDecl *Subobj) {
382 data().NeedOverloadResolutionForMoveConstructor =
true;
391 data().NeedOverloadResolutionForMoveAssignment =
true;
401 data().NeedOverloadResolutionForMoveConstructor =
true;
402 data().NeedOverloadResolutionForDestructor =
true;
430 void CXXRecordDecl::markedVirtualFunctionPure() {
433 data().Abstract =
true;
436 void CXXRecordDecl::addedMember(
Decl *D) {
437 if (!D->isImplicit() &&
438 !isa<FieldDecl>(D) &&
439 !isa<IndirectFieldDecl>(D) &&
440 (!isa<TagDecl>(D) || cast<TagDecl>(D)->getTagKind() ==
TTK_Class ||
442 data().HasOnlyCMembers =
false;
445 if (D->getFriendObjectKind() || D->isInvalidDecl())
453 Decl *DUnderlying = D;
454 if (
auto *ND = dyn_cast<NamedDecl>(DUnderlying)) {
455 DUnderlying = ND->getUnderlyingDecl();
457 dyn_cast<FunctionTemplateDecl>(DUnderlying))
458 DUnderlying = UnderlyingFunTmpl->getTemplatedDecl();
462 if (Method->isVirtual()) {
465 data().Aggregate =
false;
469 data().PlainOldData =
false;
473 data().Empty =
false;
478 data().Polymorphic =
true;
484 data().HasTrivialSpecialMembers &= SMF_Destructor;
489 data().IsStandardLayout =
false;
497 L->AddedCXXImplicitMember(data().Definition, D);
506 data().UserDeclaredConstructor =
true;
512 data().PlainOldData =
false;
516 SMKind |= SMF_DefaultConstructor;
519 data().UserProvidedDefaultConstructor =
true;
521 data().HasConstexprDefaultConstructor =
true;
523 data().HasDefaultedDefaultConstructor =
true;
529 SMKind |= SMF_CopyConstructor;
532 data().HasDeclaredCopyConstructorWithConstParam =
true;
534 SMKind |= SMF_MoveConstructor;
540 dyn_cast<CXXConstructorDecl>(DUnderlying)) {
548 data().HasConstexprNonCopyMoveConstructor =
true;
559 if (getASTContext().getLangOpts().CPlusPlus11
562 data().Aggregate =
false;
567 SMKind |= SMF_Destructor;
569 if (DD->isUserProvided())
570 data().HasIrrelevantDestructor =
false;
578 data().HasTrivialSpecialMembers &= ~SMF_Destructor;
583 if (Method->isCopyAssignmentOperator()) {
584 SMKind |= SMF_CopyAssignment;
589 data().HasDeclaredCopyAssignmentWithConstParam =
true;
592 if (Method->isMoveAssignmentOperator())
593 SMKind |= SMF_MoveAssignment;
605 if (Conversion->getPrimaryTemplate()) {
611 FunTmpl ? cast<NamedDecl>(FunTmpl) : cast<NamedDecl>(Conversion);
612 if (Primary->getPreviousDecl())
613 Conversions.
replace(cast<NamedDecl>(Primary->getPreviousDecl()),
616 Conversions.
addDecl(Ctx, Primary, AS);
623 data().HasTrivialSpecialMembers &=
624 data().DeclaredSpecialMembers | ~SMKind;
626 if (!Method->isImplicit() && !Method->isUserProvided()) {
630 }
else if (Method->isTrivial())
631 data().HasTrivialSpecialMembers |= SMKind;
633 data().DeclaredNonTrivialSpecialMembers |= SMKind;
637 data().DeclaredSpecialMembers |= SMKind;
639 if (!Method->isImplicit()) {
640 data().UserDeclaredSpecialMembers |= SMKind;
653 data().PlainOldData =
false;
661 if (
FieldDecl *Field = dyn_cast<FieldDecl>(D)) {
666 if (
Field->isUnnamedBitfield())
675 data().Aggregate =
false;
676 data().PlainOldData =
false;
683 switch (D->getAccess()) {
684 case AS_private: data().HasPrivateFields =
true;
break;
685 case AS_protected: data().HasProtectedFields =
true;
break;
686 case AS_public: data().HasPublicFields =
true;
break;
687 case AS_none: llvm_unreachable(
"Invalid access specifier");
689 if ((data().HasPrivateFields + data().HasProtectedFields +
690 data().HasPublicFields) > 1)
691 data().IsStandardLayout =
false;
694 if (
Field->isMutable())
695 data().HasMutableFields =
true;
701 data().HasVariantMembers =
true;
723 struct DefinitionData &Data = data();
724 Data.PlainOldData =
false;
725 Data.HasTrivialSpecialMembers = 0;
726 Data.HasIrrelevantDestructor =
false;
729 data().PlainOldData =
false;
732 if (!
Field->hasInClassInitializer())
733 data().HasUninitializedReferenceMember =
true;
738 data().IsStandardLayout =
false;
741 if (!
Field->hasInClassInitializer() && !
Field->isMutable()) {
743 if (FieldType->hasDefinition() && !FieldType->allowConstDefaultInit())
744 data().HasUninitializedFields =
true;
746 data().HasUninitializedFields =
true;
752 data().HasNonLiteralTypeFieldsOrBases =
true;
754 if (
Field->hasInClassInitializer() ||
755 (
Field->isAnonymousStructOrUnion() &&
756 Field->getType()->getAsCXXRecordDecl()->hasInClassInitializer())) {
757 data().HasInClassInitializer =
true;
762 data().HasTrivialSpecialMembers &= ~SMF_DefaultConstructor;
770 data().Aggregate =
false;
774 data().PlainOldData =
false;
782 data().DefaultedMoveAssignmentIsDeleted =
true;
785 CXXRecordDecl* FieldRec = cast<CXXRecordDecl>(RecordTy->getDecl());
787 addedClassSubobject(FieldRec);
792 data().NeedOverloadResolutionForMoveConstructor =
true;
793 data().NeedOverloadResolutionForMoveAssignment =
true;
803 data().DefaultedMoveConstructorIsDeleted =
true;
805 data().DefaultedMoveAssignmentIsDeleted =
true;
807 data().DefaultedDestructorIsDeleted =
true;
812 if (
Field->isAnonymousStructOrUnion()) {
813 data().NeedOverloadResolutionForMoveConstructor |=
814 FieldRec->data().NeedOverloadResolutionForMoveConstructor;
815 data().NeedOverloadResolutionForMoveAssignment |=
816 FieldRec->data().NeedOverloadResolutionForMoveAssignment;
817 data().NeedOverloadResolutionForDestructor |=
818 FieldRec->data().NeedOverloadResolutionForDestructor;
827 data().HasTrivialSpecialMembers &= ~SMF_DefaultConstructor;
836 data().HasTrivialSpecialMembers &= ~SMF_CopyConstructor;
841 data().HasTrivialSpecialMembers &= ~SMF_MoveConstructor;
850 data().HasTrivialSpecialMembers &= ~SMF_CopyAssignment;
855 data().HasTrivialSpecialMembers &= ~SMF_MoveAssignment;
858 data().HasTrivialSpecialMembers &= ~SMF_Destructor;
860 data().HasIrrelevantDestructor =
false;
871 data().IsStandardLayout =
false;
888 if (data().IsStandardLayout && data().Empty) {
889 for (
const auto &BI :
bases()) {
891 data().IsStandardLayout =
false;
899 data().HasMutableFields =
true;
908 if (!
Field->hasInClassInitializer() &&
912 data().DefaultedDefaultConstructorIsConstexpr =
false;
921 data().ImplicitCopyConstructorHasConstParam =
false;
930 data().ImplicitCopyAssignmentHasConstParam =
false;
933 !
Field->hasInClassInitializer())
934 data().HasUninitializedReferenceMember =
true;
940 Field->isAnonymousStructOrUnion())
941 data().HasVariantMembers =
true;
947 data().DefaultedDefaultConstructorIsConstexpr =
false;
955 data().DefaultedMoveAssignmentIsDeleted =
true;
966 if (!data().HasNoNonEmptyBases)
967 data().IsStandardLayout =
false;
973 if (!
Field->isBitField() ||
974 (!
Field->getBitWidth()->isTypeDependent() &&
975 !
Field->getBitWidth()->isValueDependent() &&
976 Field->getBitWidthValue(Context) != 0))
977 data().Empty =
false;
983 if (Shadow->getDeclName().getNameKind()
986 data().Conversions.get(Ctx).addDecl(Ctx, Shadow, Shadow->getAccess());
990 if (
UsingDecl *Using = dyn_cast<UsingDecl>(D)) {
991 if (Using->getDeclName().getNameKind() ==
993 data().HasInheritedConstructor =
true;
995 if (Using->getDeclName().getCXXOverloadedOperator() == OO_Equal)
996 data().HasInheritedAssignment =
true;
1004 unsigned SMKind = 0;
1007 if (Constructor->isDefaultConstructor()) {
1008 SMKind |= SMF_DefaultConstructor;
1009 if (Constructor->isConstexpr())
1010 data().HasConstexprDefaultConstructor =
true;
1012 if (Constructor->isCopyConstructor())
1013 SMKind |= SMF_CopyConstructor;
1014 else if (Constructor->isMoveConstructor())
1015 SMKind |= SMF_MoveConstructor;
1016 else if (Constructor->isConstexpr())
1018 data().HasConstexprNonCopyMoveConstructor =
true;
1019 }
else if (isa<CXXDestructorDecl>(D)) {
1020 SMKind |= SMF_Destructor;
1022 data().HasIrrelevantDestructor =
false;
1024 SMKind |= SMF_CopyAssignment;
1026 SMKind |= SMF_MoveAssignment;
1031 data().HasTrivialSpecialMembers |= SMKind;
1033 data().DeclaredNonTrivialSpecialMembers |= SMKind;
1038 !TemplateOrInstantiation.isNull())
1043 return isPOD() && data().HasOnlyCMembers;
1048 return getLambdaData().IsGenericLambda;
1054 getASTContext().DeclarationNames.getCXXOperatorName(OO_Call);
1057 assert(!Calls.
empty() &&
"Missing lambda call operator!");
1058 assert(Calls.
size() == 1 &&
"More than one lambda call operator!");
1062 dyn_cast<FunctionTemplateDecl>(CallOp))
1063 return cast<CXXMethodDecl>(CallOpTmpl->getTemplatedDecl());
1065 return cast<CXXMethodDecl>(CallOp);
1073 if (Invoker.
empty())
return nullptr;
1074 assert(Invoker.
size() == 1 &&
"More than one static invoker operator!");
1077 dyn_cast<FunctionTemplateDecl>(InvokerFun))
1078 return cast<CXXMethodDecl>(InvokerTemplate->getTemplatedDecl());
1080 return cast<CXXMethodDecl>(InvokerFun);
1084 llvm::DenseMap<const VarDecl *, FieldDecl *> &Captures,
1087 ThisCapture =
nullptr;
1089 LambdaDefinitionData &Lambda = getLambdaData();
1091 for (
const LambdaCapture *C = Lambda.Captures, *CEnd = C + Lambda.NumCaptures;
1092 C != CEnd; ++C, ++Field) {
1093 if (C->capturesThis())
1094 ThisCapture = *Field;
1095 else if (C->capturesVariable())
1096 Captures[C->getCapturedVar()] = *Field;
1106 return Tmpl->getTemplateParameters();
1113 ->getConversionType();
1133 const llvm::SmallPtrSet<CanQualType, 8> &ParentHiddenTypes,
1136 llvm::SmallPtrSet<NamedDecl*, 8> &HiddenVBaseCs) {
1140 const llvm::SmallPtrSet<CanQualType, 8> *HiddenTypes = &ParentHiddenTypes;
1141 llvm::SmallPtrSet<CanQualType, 8> HiddenTypesBuffer;
1147 if (ConvI != ConvE) {
1148 HiddenTypesBuffer = ParentHiddenTypes;
1149 HiddenTypes = &HiddenTypesBuffer;
1153 bool Hidden = ParentHiddenTypes.count(ConvType);
1155 HiddenTypesBuffer.insert(ConvType);
1159 if (Hidden && InVirtual)
1160 HiddenVBaseCs.insert(cast<NamedDecl>(
I.getDecl()->getCanonicalDecl()));
1168 VOutput.
addDecl(
I.getDecl(), IAccess);
1170 Output.
addDecl(Context,
I.getDecl(), IAccess);
1176 for (
const auto &
I : Record->
bases()) {
1182 bool BaseInVirtual = InVirtual ||
I.isVirtual();
1186 *HiddenTypes, Output, VOutput, HiddenVBaseCs);
1204 llvm::SmallPtrSet<NamedDecl*, 8> HiddenVBaseCs;
1207 llvm::SmallPtrSet<CanQualType, 8> HiddenTypes;
1213 Output.
append(Context, ConvI, ConvE);
1214 for (; ConvI != ConvE; ++ConvI)
1218 for (
const auto &
I : Record->
bases()) {
1223 I.isVirtual(),
I.getAccessSpecifier(),
1224 HiddenTypes, Output, VBaseCs, HiddenVBaseCs);
1230 if (!HiddenVBaseCs.count(cast<NamedDecl>(
I.getDecl()->getCanonicalDecl())))
1231 Output.
addDecl(Context,
I.getDecl(),
I.getAccess());
1237 llvm::iterator_range<CXXRecordDecl::conversion_iterator>
1244 Set = &data().Conversions.get(Ctx);
1246 Set = &data().VisibleConversions.get(Ctx);
1248 if (!data().ComputedVisibleConversions) {
1250 data().ComputedVisibleConversions =
true;
1253 return llvm::make_range(Set->
begin(), Set->
end());
1269 for (
unsigned I = 0,
E = Convs.
size();
I !=
E; ++
I) {
1270 if (Convs[
I].getDecl() == ConvDecl) {
1272 assert(std::find(Convs.
begin(), Convs.
end(), ConvDecl) == Convs.
end()
1273 &&
"conversion was found multiple times in unresolved set");
1278 llvm_unreachable(
"conversion not found in set!");
1283 return cast<CXXRecordDecl>(MSInfo->getInstantiatedFrom());
1295 assert(TemplateOrInstantiation.isNull() &&
1296 "Previous template or instantiation?");
1297 assert(!isa<ClassTemplatePartialSpecializationDecl>(
this));
1298 TemplateOrInstantiation
1307 TemplateOrInstantiation = Template;
1312 = dyn_cast<ClassTemplateSpecializationDecl>(
this))
1313 return Spec->getSpecializationKind();
1316 return MSInfo->getTemplateSpecializationKind();
1324 = dyn_cast<ClassTemplateSpecializationDecl>(
this)) {
1325 Spec->setSpecializationKind(TSK);
1330 MSInfo->setTemplateSpecializationKind(TSK);
1334 llvm_unreachable(
"Not a class template or member class specialization");
1340 if (
auto *TD = dyn_cast<ClassTemplateSpecializationDecl>(
this)) {
1341 auto From = TD->getInstantiatedFrom();
1343 while (
auto *NewCTD = CTD->getInstantiatedFromMemberTemplate()) {
1344 if (NewCTD->isMemberSpecialization())
1352 while (
auto *NewCTPSD = CTPSD->getInstantiatedFromMember()) {
1353 if (NewCTPSD->isMemberSpecialization())
1371 "couldn't find pattern for class template instantiation");
1394 if (Destructor->isNoReturn())
1399 if (
Base.getType()->getAsCXXRecordDecl()->isAnyDestructorNoReturn())
1403 for (
const auto *Field :
fields())
1405 Field->getType()->getBaseElementTypeUnsafe()->getAsCXXRecordDecl())
1406 if (RD->isAnyDestructorNoReturn())
1424 if (!FinalOverriders) {
1426 FinalOverriders = &MyFinalOverriders;
1431 MEnd = FinalOverriders->end();
1432 M != MEnd && !Done; ++M) {
1434 SOEnd = M->second.end();
1435 SO != SOEnd && !Done; ++SO) {
1436 assert(SO->second.size() > 0 &&
1437 "All virtual functions have overridding virtual functions");
1443 if (SO->second.front().Method->isPure()) {
1444 data().Abstract =
true;
1455 I.setAccess((*I)->getAccess());
1459 if (data().Abstract || isInvalidDecl() || !data().Polymorphic ||
1463 for (
const auto &B :
bases()) {
1465 = cast<CXXRecordDecl>(B.getType()->getAs<
RecordType>()->getDecl());
1473 void CXXMethodDecl::anchor() { }
1505 if (isa<CXXDestructorDecl>(
this)) {
1526 for (
const auto &
I : RD->
bases()) {
1546 return new (
C, RD)
CXXMethodDecl(CXXMethod, C, RD, StartLoc, NameInfo,
1547 T, TInfo, SC, isInline, isConstexpr,
1592 if (FD->getNumParams() == 1)
1631 if (!isa<RValueReferenceType>(ParamType))
1642 assert(MD->isCanonicalDecl() &&
"Method is not canonical!");
1644 "Can't add an overridden method to a class template!");
1645 assert(MD->
isVirtual() &&
"Method is not virtual!");
1647 getASTContext().addOverriddenMethod(
this, MD);
1651 if (isa<CXXConstructorDecl>(
this))
return nullptr;
1652 return getASTContext().overridden_methods_begin(
this);
1656 if (isa<CXXConstructorDecl>(
this))
return nullptr;
1657 return getASTContext().overridden_methods_end(
this);
1661 if (isa<CXXConstructorDecl>(
this))
return 0;
1662 return getASTContext().overridden_methods_size(
this);
1667 if (isa<CXXConstructorDecl>(
this))
1669 return getASTContext().overridden_methods(
this);
1679 assert(
isInstance() &&
"No 'this' for static methods!");
1702 if (StaticInvoker ==
this)
return true;
1715 : Initializee(TInfo), MemberOrEllipsisLocation(EllipsisLoc), Init(Init),
1716 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(IsVirtual),
1717 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1726 : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
1727 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(
false),
1728 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1737 : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
1738 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(
false),
1739 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1747 : Initializee(TInfo), MemberOrEllipsisLocation(), Init(Init),
1748 LParenLoc(L), RParenLoc(R), IsDelegating(
true), IsVirtual(
false),
1749 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1753 CXXCtorInitializer::CXXCtorInitializer(
ASTContext &Context,
1759 unsigned NumIndices)
1760 : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
1761 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(
false),
1762 IsWritten(
false), SourceOrderOrNumArrayIndices(NumIndices)
1764 std::uninitialized_copy(Indices, Indices + NumIndices,
1765 getTrailingObjects<VarDecl *>());
1774 unsigned NumIndices) {
1775 void *Mem = Context.
Allocate(totalSizeToAlloc<VarDecl *>(NumIndices),
1776 llvm::alignOf<CXXCtorInitializer>());
1778 Indices, NumIndices);
1790 return Initializee.get<
TypeSourceInfo*>()->getType().getTypePtr();
1803 return TSInfo->getTypeLoc().getLocalSourceRange().getBegin();
1812 return I->getSourceRange();
1819 void CXXConstructorDecl::anchor() { }
1824 unsigned Extra = additionalSizeToAlloc<InheritedConstructor>(Inherited);
1828 Result->IsInheritingConstructor = Inherited;
1837 bool isExplicit,
bool isInline,
1838 bool isImplicitlyDeclared,
bool isConstexpr,
1842 "Name must refer to a constructor");
1844 additionalSizeToAlloc<InheritedConstructor>(Inherited ? 1 : 0);
1846 C, RD, StartLoc, NameInfo, T, TInfo, isExplicit, isInline,
1847 isImplicitlyDeclared, isConstexpr, Inherited);
1851 return CtorInitializers.
get(getASTContext().getExternalSource());
1858 return Construct->getConstructor();
1962 void CXXDestructorDecl::anchor() { }
1968 QualType(),
nullptr,
false,
false);
1976 bool isInline,
bool isImplicitlyDeclared) {
1979 "Name must refer to a destructor");
1981 isInline, isImplicitlyDeclared);
1986 if (OD && !
First->OperatorDelete) {
1987 First->OperatorDelete = OD;
1988 if (
auto *L = getASTMutationListener())
1989 L->ResolvedOperatorDelete(
First, OD);
1993 void CXXConversionDecl::anchor() { }
1999 nullptr,
false,
false,
false,
2008 bool isInline,
bool isExplicit,
2012 "Name must refer to a conversion function");
2014 isInline, isExplicit, isConstexpr,
2023 void LinkageSpecDecl::anchor() { }
2031 return new (
C, DC)
LinkageSpecDecl(DC, ExternLoc, LangLoc, Lang, HasBraces);
2040 void UsingDirectiveDecl::anchor() { }
2049 if (
NamespaceDecl *NS = dyn_cast_or_null<NamespaceDecl>(Used))
2050 Used = NS->getOriginalNamespace();
2052 IdentLoc, Used, CommonAncestor);
2065 dyn_cast_or_null<NamespaceAliasDecl>(NominatedNamespace))
2066 return NA->getNamespace();
2067 return cast_or_null<NamespaceDecl>(NominatedNamespace);
2074 redeclarable_base(C), LocStart(StartLoc), RBraceLoc(),
2075 AnonOrFirstNamespaceAndInline(nullptr, Inline) {
2076 setPreviousDecl(PrevDecl);
2086 return new (
C, DC)
NamespaceDecl(C, DC, Inline, StartLoc, IdLoc, Id,
2099 return AnonOrFirstNamespaceAndInline.getPointer();
2106 return AnonOrFirstNamespaceAndInline.getPointer();
2121 void NamespaceAliasDecl::anchor() { }
2141 if (
NamespaceDecl *NS = dyn_cast_or_null<NamespaceDecl>(Namespace))
2142 Namespace = NS->getOriginalNamespace();
2144 QualifierLoc, IdentLoc, Namespace);
2155 void UsingShadowDecl::anchor() { }
2164 IdentifierNamespace = Target->getIdentifierNamespace();
2180 dyn_cast<UsingShadowDecl>(Shadow->UsingOrNextShadow))
2181 Shadow = NextShadow;
2182 return cast<UsingDecl>(Shadow->UsingOrNextShadow);
2185 void ConstructorUsingShadowDecl::anchor() { }
2204 void UsingDecl::anchor() { }
2208 "declaration already in set");
2211 if (FirstUsingShadow.getPointer())
2212 S->UsingOrNextShadow = FirstUsingShadow.getPointer();
2213 FirstUsingShadow.setPointer(S);
2218 "declaration not in set");
2223 if (FirstUsingShadow.getPointer() ==
S) {
2224 FirstUsingShadow.setPointer(
2225 dyn_cast<UsingShadowDecl>(S->UsingOrNextShadow));
2226 S->UsingOrNextShadow =
this;
2231 while (Prev->UsingOrNextShadow != S)
2232 Prev = cast<UsingShadowDecl>(Prev->UsingOrNextShadow);
2233 Prev->UsingOrNextShadow = S->UsingOrNextShadow;
2234 S->UsingOrNextShadow =
this;
2241 return new (
C, DC)
UsingDecl(DC, UL, QualifierLoc, NameInfo, HasTypename);
2256 void UnresolvedUsingValueDecl::anchor() { }
2264 QualifierLoc, NameInfo);
2281 void UnresolvedUsingTypenameDecl::anchor() { }
2291 DC, UsingLoc, TypenameLoc, QualifierLoc, TargetNameLoc,
2302 void StaticAssertDecl::anchor() { }
2326 return new (
C, DC)
MSPropertyDecl(DC, L, N, T, TInfo, StartL, Getter, Setter);
2339 llvm_unreachable(
"Invalid access specifier!");
2347 llvm_unreachable(
"Invalid access specifier!");
static NamespaceDecl * Create(ASTContext &C, DeclContext *DC, bool Inline, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, NamespaceDecl *PrevDecl)
Defines the clang::ASTContext interface.
static const char * getAccessName(AccessSpecifier AS)
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
static Qualifiers fromCVRUMask(unsigned CVRU)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
A (possibly-)qualified type.
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
virtual Decl * GetExternalDecl(uint32_t ID)
Resolve a declaration ID into a declaration, potentially building a new declaration.
bool replace(const NamedDecl *Old, NamedDecl *New, AccessSpecifier AS)
Replaces the given declaration with the new one, once.
QualType getConversionType() const
Returns the type that this conversion function is converting to.
bool hasTrivialDestructor() const
Determine whether this class has a trivial destructor (C++ [class.dtor]p3)
QualType getType() const
Retrieves the type of the base class.
static UnresolvedUsingValueDecl * CreateDeserialized(ASTContext &C, unsigned ID)
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
CanQual< T > getUnqualifiedType() const
Retrieve the unqualified form of this type.
bool allowConstDefaultInit() const
Determine whether declaring a const variable with this type is ok per core issue 253.
bool isUserProvided() const
True if this method is user-declared and was not deleted or defaulted on its first declaration...
bool hasDefaultArg() const
hasDefaultArg - Determines whether this parameter has a default argument, either parsed or not...
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
bool isOutOfLine() const override
Determine whether this is or was instantiated from an out-of-line definition of a member function...
static AccessSpecDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool isInClassMemberInitializer() const
Determine whether this initializer is an implicit initializer generated for a field with an initializ...
bool isSpecializationCopyingObject() const
Determine whether this is a member template specialization that would copy the object to itself...
void append(ASTContext &C, iterator I, iterator E)
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
bool isLiteralType(const ASTContext &Ctx) const
Return true if this is a literal type (C++11 [basic.types]p10)
Defines the C++ template declaration subclasses.
bool hasNonTrivialDestructor() const
Determine whether this class has a non-trivial destructor (C++ [class.dtor]p3)
unsigned getCVRQualifiers() const
Retrieve the const/volatile/restrict qualifiers.
llvm::iterator_range< conversion_iterator > getVisibleConversionFunctions()
Get all conversion functions visible in current class, including conversion function templates...
bool hasDefinition() const
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
IdentifierInfo * getAsIdentifierInfo() const
getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in this declaration name, or NULL if this declaration name isn't a simple identifier.
The base class of the type hierarchy.
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier.
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
unsigned getCVRQualifiers() const
Retrieve the set of CVR (const-volatile-restrict) qualifiers applied to this type.
MapType::iterator iterator
bool forallBases(ForallBasesCallback BaseMatches, bool AllowShortCircuit=true) const
Determines if the given callback holds for all the direct or indirect base classes of this type...
SourceLocation getRParenLoc() const
NamespaceDecl - Represent a C++ namespace.
Represents a call to a C++ constructor.
virtual void completeDefinition()
completeDefinition - Notes that the definition of this type is now complete.
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
A container of type source information.
bool isBlockPointerType() const
Describes the capture of a variable or of this, or of a C++1y init-capture.
Represents a C++ constructor within a class.
Expr * getInClassInitializer() const
getInClassInitializer - Get the C++11 in-class initializer for this member, or null if one has not be...
bool isCopyAssignmentOperator() const
Determine whether this is a copy-assignment operator, regardless of whether it was declared implicitl...
This file provides some common utility functions for processing Lambda related AST Constructs...
VarDecl - An instance of this class is created to represent a variable declaration or definition...
static CXXConversionDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, bool isExplicit, bool isConstexpr, SourceLocation EndLocation)
void finishedDefaultedOrDeletedMember(CXXMethodDecl *MD)
Indicates that the declaration of a defaulted or deleted special member function is now complete...
field_iterator field_begin() const
bool isCLike() const
True if this class is C-like, without C++-specific features, e.g.
static MSPropertyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T, TypeSourceInfo *TInfo, SourceLocation StartL, IdentifierInfo *Getter, IdentifierInfo *Setter)
The "__interface" keyword.
QualType getThisType(ASTContext &C) const
Returns the type of the this pointer.
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
Stores a list of template parameters for a TemplateDecl and its derived classes.
bool hasNonTrivialMoveAssignment() const
Determine whether this class has a non-trivial move assignment operator (C++11 [class.copy]p25)
ParmVarDecl - Represents a parameter to a function.
bool isObjCRetainableType() const
bool isMoveAssignmentOperator() const
Determine whether this is a move assignment operator.
Defines the clang::Expr interface and subclasses for C++ expressions.
bool hasMutableFields() const
Determine whether this class, or any of its class subobjects, contains a mutable field.
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated.
bool isBaseInitializer() const
Determine whether this initializer is initializing a base class.
bool isUsualDeallocationFunction() const
Determine whether this is a usual deallocation function (C++ [basic.stc.dynamic.deallocation]p2), which is an overloaded delete or delete[] operator with a particular signature.
bool hasTrivialCopyConstructor() const
Determine whether this class has a trivial copy constructor (C++ [class.copy]p6, C++11 [class...
void setTemplateSpecializationKind(TemplateSpecializationKind TSK)
Set the kind of specialization or template instantiation this is.
Base wrapper for a particular "section" of type source info.
RecordDecl - Represents a struct/union/class.
bool hasBody(const FunctionDecl *&Definition) const
Returns true if the function has a body (definition).
bool isFunctionTemplateSpecialization() const
Determine whether this function is a function template specialization.
Description of a constructor that was inherited from a base class.
DeclarationName getName() const
getName - Returns the embedded declaration name.
Represents a class template specialization, which refers to a class template with a given set of temp...
One of these records is kept for each identifier that is lexed.
bool isEmpty() const
Determine whether this is an empty class in the sense of (C++11 [meta.unary.prop]).
method_iterator end_overridden_methods() const
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
The results of name lookup within a DeclContext.
bool isDelegatingConstructor() const
Determine whether this constructor is a delegating constructor.
bool hasNonTrivialCopyConstructor() const
Determine whether this class has a non-trivial copy constructor (C++ [class.copy]p6, C++11 [class.copy]p12)
bool isAccessDeclaration() const
Return true if it is a C++03 access declaration (no 'using').
bool isReferenceType() const
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
CXXConstructorDecl * getTargetConstructor() const
When this constructor delegates to another, retrieve the target.
static CXXRecordDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
void Deallocate(void *Ptr) const
CXXMethodDecl * getCanonicalDecl() override
CXXRecordDecl * getDefinition() const
static CXXCtorInitializer * Create(ASTContext &Context, FieldDecl *Member, SourceLocation MemberLoc, SourceLocation L, Expr *Init, SourceLocation R, VarDecl **Indices, unsigned NumIndices)
Creates a new member initializer that optionally contains array indices used to describe an elementwi...
TagKind getTagKind() const
The iterator over UnresolvedSets.
Represents an access specifier followed by colon ':'.
void addShadowDecl(UsingShadowDecl *S)
static StaticAssertDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static CXXRecordDecl * CreateLambda(const ASTContext &C, DeclContext *DC, TypeSourceInfo *Info, SourceLocation Loc, bool DependentLambda, bool IsGeneric, LambdaCaptureDefault CaptureDefault)
bool isAnyDestructorNoReturn() const
Returns true if the class destructor, or any implicitly invoked destructors are marked noreturn...
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
static NamespaceDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Represents a C++ using-declaration.
NamespaceDecl * getNextRedeclaration() const
void completeDefinition() override
Indicates that the definition of this class is now complete.
void addDecl(ASTContext &C, NamedDecl *D, AccessSpecifier AS)
const LangOptions & getLangOpts() const
CXXMethodDecl(Kind DK, ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInline, bool isConstexpr, SourceLocation EndLocation)
const CXXRecordDecl * getParent() const
Returns the parent of this method declaration, which is the class in which this method is defined...
shadow_iterator shadow_begin() const
field_range fields() const
static UnresolvedUsingTypenameDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool hasCopyAssignmentWithConstParam() const
Determine whether this class has a copy assignment operator with a parameter type which is a referenc...
bool hasNonLiteralTypeFieldsOrBases() const
Determine whether this class has a non-literal or/ volatile type non-static data member or base class...
void setHasObjectMember(bool val)
A set of unresolved declarations.
RecordDecl * getDecl() const
FunctionDecl * getTemplateInstantiationPattern() const
Retrieve the function declaration from which this function could be instantiated, if it is an instant...
bool isVariadic() const
Whether this function is variadic.
CXXRecordDecl * getCanonicalDecl() override
const Type * getBaseClass() const
If this is a base class initializer, returns the type of the base class.
SourceRange getSourceRange() const override LLVM_READONLY
base_class_iterator bases_begin()
static UnresolvedUsingValueDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo)
static NamespaceAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation NamespaceLoc, SourceLocation AliasLoc, IdentifierInfo *Alias, NestedNameSpecifierLoc QualifierLoc, SourceLocation IdentLoc, NamedDecl *Namespace)
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
Represents a linkage specification.
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
StringRef getLambdaStaticInvokerName()
detail::InMemoryDirectory::const_iterator I
NamedDecl * getDecl() const
bool isLambdaToBlockPointerConversion() const
Determine whether this conversion function is a conversion from a lambda closure type to a block poin...
init_iterator init_begin()
Retrieve an iterator to the first initializer.
CXXMethodDecl * getCorrespondingMethodInClass(const CXXRecordDecl *RD, bool MayBeBase=false)
Find the method in RD that corresponds to this one.
shadow_iterator shadow_end() const
This object can be modified without requiring retains or releases.
bool isAbstract() const
Determine whether this class has a pure virtual function.
field_iterator field_end() const
CXXRecordDecl(Kind K, TagKind TK, const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl)
void setBases(CXXBaseSpecifier const *const *Bases, unsigned NumBases)
Sets the base classes of this struct or class.
TypeLoc getBaseClassLoc() const
If this is a base class initializer, returns the type of the base class with location information...
bool hasCopyConstructorWithConstParam() const
Determine whether this class has a copy constructor with a parameter type which is a reference to a c...
A little helper class used to produce diagnostics.
bool hasIrrelevantDestructor() const
Determine whether this class has a destructor which has no semantic effect.
CXXRecordDecl * getInstantiatedFromMemberClass() const
If this record is an instantiation of a member class, retrieves the member class from which it was in...
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
bool isParameterPack() const
Determine whether this parameter is actually a function parameter pack.
DeclarationNameTable DeclarationNames
bool isGenericLambda() const
Determine whether this class describes a generic lambda function object (i.e.
static StaticAssertDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StaticAssertLoc, Expr *AssertExpr, StringLiteral *Message, SourceLocation RParenLoc, bool Failed)
StorageClass getStorageClass() const
Returns the storage class as written in the source.
const CXXMethodDecl *const * method_iterator
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
static CXXDestructorDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, bool isImplicitlyDeclared)
static bool recursivelyOverrides(const CXXMethodDecl *DerivedMD, const CXXMethodDecl *BaseMD)
bool isMoveConstructor() const
Determine whether this constructor is a move constructor (C++11 [class.copy]p3), which can be used to...
bool isDeleted() const
Whether this function has been deleted.
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
unsigned getTypeQualifiers() const
Expr - This represents one expression.
static LinkageSpecDecl * CreateDeserialized(ASTContext &C, unsigned ID)
conversion_iterator conversion_end() const
Represents a C++ destructor within a class.
const ParmVarDecl * getParamDecl(unsigned i) const
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
Defines the clang::TypeLoc interface and its subclasses.
static CanQualType GetConversionType(ASTContext &Context, NamedDecl *Conv)
SourceLocation getMemberLocation() const
bool isExplicit() const
Determine whether this constructor was marked "explicit" or not.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
static NamespaceAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static CXXConstructorDecl * CreateDeserialized(ASTContext &C, unsigned ID, bool InheritsConstructor)
StorageClass
Storage classes.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isCopyConstructor() const
Whether this constructor is a copy constructor (C++ [class.copy]p2, which can be used to copy the cla...
CXXMethodDecl * getLambdaCallOperator() const
Retrieve the lambda call operator of the closure type if this is a closure type.
An lvalue reference type, per C++11 [dcl.ref].
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
void setDescribedClassTemplate(ClassTemplateDecl *Template)
Represents a C++ conversion function within a class.
The result type of a method or function.
static UsingDirectiveDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool isTemplateInstantiation(TemplateSpecializationKind Kind)
Determine whether this template specialization kind refers to an instantiation of an entity (as oppos...
bool hasNonTrivialCopyAssignment() const
Determine whether this class has a non-trivial copy assignment operator (C++ [class.copy]p11, C++11 [class.copy]p25)
bool hasUninitializedReferenceMember() const
Whether this class or any of its subobjects has any members of reference type which would make value-...
FunctionDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
static CXXRecordDecl * Create(const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl=nullptr, bool DelayTypeCreation=false)
DeclarationNameInfo getNameInfo() const
Abstract interface for external sources of AST nodes.
static UsingShadowDecl * CreateDeserialized(ASTContext &C, unsigned ID)
NamespaceDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
SourceRange getSourceRange() const LLVM_READONLY
Determine the source range covering the entire initializer.
static CXXDestructorDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Encodes a location in the source.
void setOperatorDelete(FunctionDecl *OD)
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
unsigned getNumParams() const
getNumParams - Return the number of parameters this function must have based on its FunctionType...
const TemplateArgument * iterator
method_iterator begin_overridden_methods() const
FieldDecl * getAnyMember() const
OverloadedOperatorKind getCXXOverloadedOperator() const
getCXXOverloadedOperator - If this name is the name of an overloadable operator in C++ (e...
bool hasSimpleMoveConstructor() const
true if we know for sure that this class has a single, accessible, unambiguous move constructor that ...
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
unsigned size_overridden_methods() const
Represents a dependent using declaration which was not marked with typename.
bool mayBeAbstract() const
Determine whether this class may end up being abstract, even though it is not yet known to be abstrac...
void removeShadowDecl(UsingShadowDecl *S)
Represents a static or instance method of a struct/union/class.
SourceLocation getSourceLocation() const
Determine the source location of the initializer.
void addOverriddenMethod(const CXXMethodDecl *MD)
bool isCopyOrMoveConstructor() const
Determine whether this a copy or move constructor.
bool hasInlineBody() const
bool isCXX98PODType(const ASTContext &Context) const
Return true if this is a POD type according to the rules of the C++98 standard, regardless of the cur...
ASTContext::overridden_method_range overridden_method_range
void addDecl(NamedDecl *D)
static MSPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static ConstructorUsingShadowDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool hasVolatileMember() const
static ConstructorUsingShadowDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation Loc, UsingDecl *Using, NamedDecl *Target, bool IsVirtual)
T * get(ExternalASTSource *Source) const
Retrieve the pointer to the AST node that this lazy pointer.
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
This template specialization was formed from a template-id but has not yet been declared, defined, or instantiated.
void getCaptureFields(llvm::DenseMap< const VarDecl *, FieldDecl * > &Captures, FieldDecl *&ThisCapture) const
For a closure type, retrieve the mapping from captured variables and this to the non-static data memb...
Represents a C++11 static_assert declaration.
bool hasObjectMember() const
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
CXXMethodDecl * getLambdaStaticInvoker() const
Retrieve the lambda static invoker, the address of which is returned by the conversion operator...
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
bool hasTrivialCopyAssignment() const
Determine whether this class has a trivial copy assignment operator (C++ [class.copy]p11, C++11 [class.copy]p25)
bool hasSimpleDestructor() const
true if we know for sure that this class has an accessible destructor that is not deleted...
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine whether this particular class is a specialization or instantiation of a class template or m...
TagTypeKind
The kind of a tag type.
FunctionTemplateDecl * getPrimaryTemplate() const
Retrieve the primary template that this function template specialization either specializes or was in...
static bool isStaticOverloadedOperator(OverloadedOperatorKind OOK)
Returns true if the given operator is implicitly static in a record context.
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
static LinkageSpecDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation ExternLoc, SourceLocation LangLoc, LanguageIDs Lang, bool HasBraces)
static CXXConversionDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setHasVolatileMember(bool val)
bool isAccessDeclaration() const
Return true if it is a C++03 access declaration (no 'using').
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
AccessSpecifier getAccessSpecifier() const
Returns the access specifier for this base specifier.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
CXXDestructorDecl * getDestructor() const
Returns the destructor decl for this class.
bool hasSimpleMoveAssignment() const
true if we know for sure that this class has a single, accessible, unambiguous move assignment operat...
bool hasVariantMembers() const
Determine whether this class has any variant members.
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
void removeConversion(const NamedDecl *Old)
Removes a conversion function from this class.
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
Represents a dependent using declaration which was marked with typename.
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
static UsingDirectiveDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, SourceLocation NamespaceLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation IdentLoc, NamedDecl *Nominated, DeclContext *CommonAncestor)
bool hasTrivialDefaultConstructor() const
Determine whether this class has a trivial default constructor (C++11 [class.ctor]p5).
DeclarationName - The name of a declaration.
static UnresolvedUsingTypenameDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, SourceLocation TypenameLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TargetNameLoc, DeclarationName TargetName)
U cast(CodeGen::Address addr)
A mapping from each virtual member function to its set of final overriders.
UsingShadowDecl(Kind K, ASTContext &C, DeclContext *DC, SourceLocation Loc, UsingDecl *Using, NamedDecl *Target)
bool hasTrivialMoveConstructor() const
Determine whether this class has a trivial move constructor (C++11 [class.copy]p12) ...
detail::InMemoryDirectory::const_iterator E
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
bool isLValueReferenceType() const
bool hasAnyDependentBases() const
Determine whether this class has any dependent base classes which are not the current instantiation...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
bool isLambda() const
Determine whether this class describes a lambda function object.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it).
bool isRValueReferenceType() const
unsigned MayHaveOutOfDateDef
Indicates whether it is possible for declarations of this kind to have an out-of-date definition...
static AccessSpecifier MergeAccess(AccessSpecifier PathAccess, AccessSpecifier DeclAccess)
Calculates the access of a decl that is reached along a path.
bool hasTrivialMoveAssignment() const
Determine whether this class has a trivial move assignment operator (C++11 [class.copy]p25)
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
const T * getAs() const
Member-template getAs<specific type>'.
UsingDecl * getUsingDecl() const
Gets the using declaration to which this declaration is tied.
Represents a C++ base or member initializer.
LanguageIDs
Represents the language in a linkage specification.
bool isConvertingConstructor(bool AllowExplicit) const
Whether this constructor is a converting constructor (C++ [class.conv.ctor]), which can be used for u...
An UnresolvedSet-like class which uses the ASTContext's allocator.
static CXXMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool isLambdaStaticInvoker() const
Determine whether this is a lambda closure type's static member function that is used for the result ...
Base for LValueReferenceType and RValueReferenceType.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
static CXXMethodDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInline, bool isConstexpr, SourceLocation EndLocation)
void setInstantiationOfMemberClass(CXXRecordDecl *RD, TemplateSpecializationKind TSK)
Specify that this record is an instantiation of the member class RD.
QualType getTagDeclType(const TagDecl *Decl) const
Return the unique reference to the type for the specified TagDecl (struct/union/class/enum) decl...
Represents a base class of a C++ class.
unsigned IsBeingDefined
IsBeingDefined - True if this is currently being defined.
bool isAnyMemberInitializer() const
QualType getPointeeType() const
TemplateParameterList * getGenericLambdaTemplateParameterList() const
Retrieve the generic lambda's template parameter list.
bool isDefaultConstructor() const
Whether this constructor is a default constructor (C++ [class.ctor]p5), which can be used to default-...
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
bool isObjCGCStrong() const
true when Type is objc's strong.
bool hasNonTrivialMoveConstructor() const
Determine whether this class has a non-trivial move constructor (C++11 [class.copy]p12) ...
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
Represents a C++ struct/union/class.
bool isTriviallyCopyable() const
Determine whether this class is considered trivially copyable per (C++11 [class]p6).
void * Allocate(size_t Size, unsigned Align=8) const
Provides information a specialization of a member of a class template, which may be a member function...
base_class_iterator bases_end()
static UsingDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool HasTypenameKeyword)
Declaration of a class template.
StringLiteral - This represents a string literal expression, e.g.
bool isStandardLayout() const
Determine whether this class has standard layout per (C++ [class]p7)
SourceRange getSourceRange() const override LLVM_READONLY
conversion_iterator conversion_begin() const
NamedDecl * getMostRecentDecl()
CXXCtorInitializer *const * init_const_iterator
Iterates through the member/base initializer list.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
An instance of this class represents the declaration of a property member.
A trivial tuple used to represent a source range.
NamedDecl - This represents a decl with a name.
Represents a C++ namespace alias.
static UsingDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static void CollectVisibleConversions(ASTContext &Context, CXXRecordDecl *Record, bool InVirtual, AccessSpecifier Access, const llvm::SmallPtrSet< CanQualType, 8 > &ParentHiddenTypes, ASTUnresolvedSet &Output, UnresolvedSetImpl &VOutput, llvm::SmallPtrSet< NamedDecl *, 8 > &HiddenVBaseCs)
Collect the visible conversions of a base class.
void getFinalOverriders(CXXFinalOverriderMap &FinaOverriders) const
Retrieve the final overriders for each virtual member function in the class hierarchy where this clas...
bool isConstQualified() const
Determine whether this type is const-qualified.
Represents C++ using-directive.
bool hasConstexprDefaultConstructor() const
Determine whether this class has a constexpr default constructor.
bool isPolymorphic() const
Whether this class is polymorphic (C++ [class.virtual]), which means that the class contains or inher...
static CXXConstructorDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isExplicit, bool isInline, bool isImplicitlyDeclared, bool isConstexpr, InheritedConstructor Inherited=InheritedConstructor())
bool isBeingDefined() const
isBeingDefined - Return true if this decl is currently being defined.
base_class_range vbases()
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
overridden_method_range overridden_methods() const
Declaration of a template function.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
DeclarationNameInfo getNameInfo() const
bool isPOD() const
Whether this class is a POD-type (C++ [class]p4)
OverloadedOperatorKind getOverloadedOperator() const
getOverloadedOperator - Which C++ overloaded operator this function represents, if any...