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), HasPublicFields(
false),
53 HasMutableFields(
false), HasVariantMembers(
false), HasOnlyCMembers(
true),
54 HasInClassInitializer(
false), HasUninitializedReferenceMember(
false),
55 NeedOverloadResolutionForMoveConstructor(
false),
56 NeedOverloadResolutionForMoveAssignment(
false),
57 NeedOverloadResolutionForDestructor(
false),
58 DefaultedMoveConstructorIsDeleted(
false),
59 DefaultedMoveAssignmentIsDeleted(
false),
60 DefaultedDestructorIsDeleted(
false),
61 HasTrivialSpecialMembers(SMF_All),
62 DeclaredNonTrivialSpecialMembers(0),
63 HasIrrelevantDestructor(
true),
64 HasConstexprNonCopyMoveConstructor(
false),
65 DefaultedDefaultConstructorIsConstexpr(
true),
66 HasConstexprDefaultConstructor(
false),
67 HasNonLiteralTypeFieldsOrBases(
false), ComputedVisibleConversions(
false),
68 UserProvidedDefaultConstructor(
false), DeclaredSpecialMembers(0),
69 ImplicitCopyConstructorHasConstParam(
true),
70 ImplicitCopyAssignmentHasConstParam(
true),
71 HasDeclaredCopyConstructorWithConstParam(
false),
72 HasDeclaredCopyAssignmentWithConstParam(
false),
73 IsLambda(
false), IsParsingBaseSpecifiers(
false), NumBases(0), NumVBases(0),
75 Definition(D), FirstFriend() {
79 return Bases.get(Definition->getASTContext().getExternalSource());
83 return VBases.get(Definition->getASTContext().getExternalSource());
90 :
RecordDecl(K, TK, C, DC, StartLoc, IdLoc, Id, PrevDecl),
91 DefinitionData(PrevDecl ? PrevDecl->DefinitionData
93 TemplateOrInstantiation() {}
99 bool DelayTypeCreation) {
101 IdLoc, Id, PrevDecl);
105 if (!DelayTypeCreation)
113 bool Dependent,
bool IsGeneric,
120 new (
C)
struct LambdaDefinitionData(R, Info, Dependent, IsGeneric,
142 if (!data().Bases.isOffset() && data().NumBases > 0)
148 data().Aggregate =
false;
152 data().PlainOldData =
false;
156 llvm::SmallPtrSet<CanQualType, 8> SeenVBaseTypes;
162 data().NumBases = NumBases;
163 for (
unsigned i = 0; i < NumBases; ++i) {
164 data().getBases()[i] = *Bases[i];
176 if (!BaseClassDecl->
isEmpty()) {
186 data().IsStandardLayout =
false;
189 data().Empty =
false;
190 data().HasNoNonEmptyBases =
false;
197 data().Polymorphic =
true;
203 data().IsStandardLayout =
false;
207 data().HasNonLiteralTypeFieldsOrBases =
true;
210 for (
const auto &VBase : BaseClassDecl->
vbases()) {
213 VBases.push_back(&VBase);
220 if (
CXXRecordDecl *VBaseDecl = VBase.getType()->getAsCXXRecordDecl())
221 if (!VBaseDecl->hasCopyConstructorWithConstParam())
222 data().ImplicitCopyConstructorHasConstParam =
false;
229 VBases.push_back(Base);
234 data().Empty =
false;
240 data().HasTrivialSpecialMembers &= SMF_Destructor;
245 data().IsStandardLayout =
false;
250 data().DefaultedDefaultConstructorIsConstexpr =
false;
257 data().HasTrivialSpecialMembers &= ~SMF_DefaultConstructor;
265 data().HasTrivialSpecialMembers &= ~SMF_CopyConstructor;
271 data().HasTrivialSpecialMembers &= ~SMF_MoveConstructor;
279 data().HasTrivialSpecialMembers &= ~SMF_CopyAssignment;
285 data().HasTrivialSpecialMembers &= ~SMF_MoveAssignment;
292 data().DefaultedDefaultConstructorIsConstexpr =
false;
299 data().HasTrivialSpecialMembers &= ~SMF_Destructor;
302 data().HasIrrelevantDestructor =
false;
310 data().ImplicitCopyAssignmentHasConstParam =
false;
318 data().ImplicitCopyConstructorHasConstParam =
false;
330 data().HasMutableFields =
true;
333 data().HasUninitializedReferenceMember =
true;
335 addedClassSubobject(BaseClassDecl);
338 if (VBases.empty()) {
339 data().IsParsingBaseSpecifiers =
false;
345 data().NumVBases = VBases.size();
346 for (
int I = 0, E = VBases.size(); I != E; ++I) {
350 data().getVBases()[I] = *VBases[I];
353 data().IsParsingBaseSpecifiers =
false;
356 void CXXRecordDecl::addedClassSubobject(
CXXRecordDecl *Subobj) {
364 data().NeedOverloadResolutionForMoveConstructor =
true;
373 data().NeedOverloadResolutionForMoveAssignment =
true;
383 data().NeedOverloadResolutionForMoveConstructor =
true;
384 data().NeedOverloadResolutionForDestructor =
true;
418 void CXXRecordDecl::markedVirtualFunctionPure() {
421 data().Abstract =
true;
424 void CXXRecordDecl::addedMember(
Decl *D) {
426 !isa<FieldDecl>(D) &&
427 !isa<IndirectFieldDecl>(D) &&
428 (!isa<TagDecl>(D) || cast<TagDecl>(D)->getTagKind() ==
TTK_Class ||
430 data().HasOnlyCMembers =
false;
441 if (Method->isVirtual()) {
444 data().Aggregate =
false;
448 data().PlainOldData =
false;
452 data().Empty =
false;
457 data().Polymorphic =
true;
463 data().HasTrivialSpecialMembers &= SMF_Destructor;
468 data().IsStandardLayout =
false;
476 L->AddedCXXImplicitMember(data().Definition, D);
483 if (!Constructor->isImplicit()) {
485 data().UserDeclaredConstructor =
true;
491 data().PlainOldData =
false;
497 bool UserProvided = Constructor->isUserProvided();
499 if (Constructor->isDefaultConstructor()) {
500 SMKind |= SMF_DefaultConstructor;
503 data().UserProvidedDefaultConstructor =
true;
504 if (Constructor->isConstexpr())
505 data().HasConstexprDefaultConstructor =
true;
510 if (Constructor->isCopyConstructor(Quals)) {
511 SMKind |= SMF_CopyConstructor;
514 data().HasDeclaredCopyConstructorWithConstParam =
true;
515 }
else if (Constructor->isMoveConstructor())
516 SMKind |= SMF_MoveConstructor;
521 if (Constructor->isConstexpr() && !Constructor->isCopyOrMoveConstructor())
522 data().HasConstexprNonCopyMoveConstructor =
true;
531 ? UserProvided : !Constructor->isImplicit())
532 data().Aggregate =
false;
537 SMKind |= SMF_Destructor;
539 if (DD->isUserProvided())
540 data().HasIrrelevantDestructor =
false;
548 data().HasTrivialSpecialMembers &= ~SMF_Destructor;
553 if (Method->isCopyAssignmentOperator()) {
554 SMKind |= SMF_CopyAssignment;
559 data().HasDeclaredCopyAssignmentWithConstParam =
true;
562 if (Method->isMoveAssignmentOperator())
563 SMKind |= SMF_MoveAssignment;
575 if (Conversion->getPrimaryTemplate()) {
581 FunTmpl ? cast<NamedDecl>(FunTmpl) : cast<NamedDecl>(Conversion);
586 Conversions.
addDecl(Ctx, Primary, AS);
593 data().HasTrivialSpecialMembers &=
594 data().DeclaredSpecialMembers | ~SMKind;
596 if (!Method->isImplicit() && !Method->isUserProvided()) {
600 }
else if (Method->isTrivial())
601 data().HasTrivialSpecialMembers |= SMKind;
603 data().DeclaredNonTrivialSpecialMembers |= SMKind;
607 data().DeclaredSpecialMembers |= SMKind;
609 if (!Method->isImplicit()) {
610 data().UserDeclaredSpecialMembers |= SMKind;
623 data().PlainOldData =
false;
631 if (
FieldDecl *Field = dyn_cast<FieldDecl>(D)) {
636 if (Field->isUnnamedBitfield())
645 data().Aggregate =
false;
646 data().PlainOldData =
false;
654 case AS_private: data().HasPrivateFields =
true;
break;
655 case AS_protected: data().HasProtectedFields =
true;
break;
656 case AS_public: data().HasPublicFields =
true;
break;
657 case AS_none: llvm_unreachable(
"Invalid access specifier");
659 if ((data().HasPrivateFields + data().HasProtectedFields +
660 data().HasPublicFields) > 1)
661 data().IsStandardLayout =
false;
664 if (Field->isMutable())
665 data().HasMutableFields =
true;
670 if (
isUnion() && !Field->isAnonymousStructOrUnion())
671 data().HasVariantMembers =
true;
693 struct DefinitionData &Data = data();
694 Data.PlainOldData =
false;
695 Data.HasTrivialSpecialMembers = 0;
696 Data.HasIrrelevantDestructor =
false;
699 data().PlainOldData =
false;
702 if (!Field->hasInClassInitializer())
703 data().HasUninitializedReferenceMember =
true;
708 data().IsStandardLayout =
false;
713 data().HasNonLiteralTypeFieldsOrBases =
true;
715 if (Field->hasInClassInitializer() ||
716 (Field->isAnonymousStructOrUnion() &&
717 Field->getType()->getAsCXXRecordDecl()->hasInClassInitializer())) {
718 data().HasInClassInitializer =
true;
723 data().HasTrivialSpecialMembers &= ~SMF_DefaultConstructor;
731 data().Aggregate =
false;
735 data().PlainOldData =
false;
743 data().DefaultedMoveAssignmentIsDeleted =
true;
746 CXXRecordDecl* FieldRec = cast<CXXRecordDecl>(RecordTy->getDecl());
748 addedClassSubobject(FieldRec);
753 data().NeedOverloadResolutionForMoveConstructor =
true;
754 data().NeedOverloadResolutionForMoveAssignment =
true;
764 data().DefaultedMoveConstructorIsDeleted =
true;
766 data().DefaultedMoveAssignmentIsDeleted =
true;
768 data().DefaultedDestructorIsDeleted =
true;
777 data().HasTrivialSpecialMembers &= ~SMF_DefaultConstructor;
786 data().HasTrivialSpecialMembers &= ~SMF_CopyConstructor;
791 data().HasTrivialSpecialMembers &= ~SMF_MoveConstructor;
800 data().HasTrivialSpecialMembers &= ~SMF_CopyAssignment;
805 data().HasTrivialSpecialMembers &= ~SMF_MoveAssignment;
808 data().HasTrivialSpecialMembers &= ~SMF_Destructor;
810 data().HasIrrelevantDestructor =
false;
821 data().IsStandardLayout =
false;
838 if (data().IsStandardLayout && data().Empty) {
839 for (
const auto &BI :
bases()) {
841 data().IsStandardLayout =
false;
849 data().HasMutableFields =
true;
858 if (!Field->hasInClassInitializer() &&
862 data().DefaultedDefaultConstructorIsConstexpr =
false;
871 data().ImplicitCopyConstructorHasConstParam =
false;
880 data().ImplicitCopyAssignmentHasConstParam =
false;
883 !Field->hasInClassInitializer())
884 data().HasUninitializedReferenceMember =
true;
890 Field->isAnonymousStructOrUnion())
891 data().HasVariantMembers =
true;
896 (!Field->hasInClassInitializer() && !
isUnion()))
897 data().DefaultedDefaultConstructorIsConstexpr =
false;
905 data().DefaultedMoveAssignmentIsDeleted =
true;
916 if (!data().HasNoNonEmptyBases)
917 data().IsStandardLayout =
false;
921 if (!Field->isBitField() ||
922 (!Field->getBitWidth()->isTypeDependent() &&
923 !Field->getBitWidth()->isValueDependent() &&
924 Field->getBitWidthValue(Context) != 0))
925 data().Empty =
false;
931 if (Shadow->getDeclName().getNameKind()
934 data().Conversions.get(Ctx).addDecl(Ctx, Shadow, Shadow->getAccess());
946 if (Constructor->isDefaultConstructor()) {
947 SMKind |= SMF_DefaultConstructor;
948 if (Constructor->isConstexpr())
949 data().HasConstexprDefaultConstructor =
true;
951 if (Constructor->isCopyConstructor())
952 SMKind |= SMF_CopyConstructor;
953 else if (Constructor->isMoveConstructor())
954 SMKind |= SMF_MoveConstructor;
955 else if (Constructor->isConstexpr())
957 data().HasConstexprNonCopyMoveConstructor =
true;
958 }
else if (isa<CXXDestructorDecl>(D)) {
959 SMKind |= SMF_Destructor;
961 data().HasIrrelevantDestructor =
false;
963 SMKind |= SMF_CopyAssignment;
965 SMKind |= SMF_MoveAssignment;
970 data().HasTrivialSpecialMembers |= SMKind;
972 data().DeclaredNonTrivialSpecialMembers |= SMKind;
977 !TemplateOrInstantiation.isNull())
982 return isPOD() && data().HasOnlyCMembers;
987 return getLambdaData().IsGenericLambda;
996 assert(!Calls.
empty() &&
"Missing lambda call operator!");
997 assert(Calls.
size() == 1 &&
"More than one lambda call operator!");
1001 dyn_cast<FunctionTemplateDecl>(CallOp))
1002 return cast<CXXMethodDecl>(CallOpTmpl->getTemplatedDecl());
1004 return cast<CXXMethodDecl>(CallOp);
1012 if (Invoker.
empty())
return nullptr;
1013 assert(Invoker.
size() == 1 &&
"More than one static invoker operator!");
1016 dyn_cast<FunctionTemplateDecl>(InvokerFun))
1017 return cast<CXXMethodDecl>(InvokerTemplate->getTemplatedDecl());
1019 return cast<CXXMethodDecl>(InvokerFun);
1023 llvm::DenseMap<const VarDecl *, FieldDecl *> &Captures,
1026 ThisCapture =
nullptr;
1028 LambdaDefinitionData &Lambda = getLambdaData();
1030 for (
const LambdaCapture *C = Lambda.Captures, *CEnd = C + Lambda.NumCaptures;
1031 C != CEnd; ++C, ++Field) {
1032 if (C->capturesThis())
1033 ThisCapture = *Field;
1034 else if (C->capturesVariable())
1035 Captures[C->getCapturedVar()] = *Field;
1045 return Tmpl->getTemplateParameters();
1052 ->getConversionType();
1072 const llvm::SmallPtrSet<CanQualType, 8> &ParentHiddenTypes,
1075 llvm::SmallPtrSet<NamedDecl*, 8> &HiddenVBaseCs) {
1079 const llvm::SmallPtrSet<CanQualType, 8> *HiddenTypes = &ParentHiddenTypes;
1080 llvm::SmallPtrSet<CanQualType, 8> HiddenTypesBuffer;
1086 if (ConvI != ConvE) {
1087 HiddenTypesBuffer = ParentHiddenTypes;
1088 HiddenTypes = &HiddenTypesBuffer;
1092 bool Hidden = ParentHiddenTypes.count(ConvType);
1094 HiddenTypesBuffer.insert(ConvType);
1098 if (Hidden && InVirtual)
1099 HiddenVBaseCs.insert(cast<NamedDecl>(I.getDecl()->getCanonicalDecl()));
1107 VOutput.
addDecl(I.getDecl(), IAccess);
1109 Output.
addDecl(Context, I.getDecl(), IAccess);
1115 for (
const auto &I : Record->
bases()) {
1121 bool BaseInVirtual = InVirtual || I.isVirtual();
1125 *HiddenTypes, Output, VOutput, HiddenVBaseCs);
1143 llvm::SmallPtrSet<NamedDecl*, 8> HiddenVBaseCs;
1146 llvm::SmallPtrSet<CanQualType, 8> HiddenTypes;
1152 Output.
append(Context, ConvI, ConvE);
1153 for (; ConvI != ConvE; ++ConvI)
1157 for (
const auto &I : Record->
bases()) {
1162 I.isVirtual(), I.getAccessSpecifier(),
1163 HiddenTypes, Output, VBaseCs, HiddenVBaseCs);
1169 if (!HiddenVBaseCs.count(cast<NamedDecl>(I.getDecl()->getCanonicalDecl())))
1170 Output.
addDecl(Context, I.getDecl(), I.getAccess());
1176 llvm::iterator_range<CXXRecordDecl::conversion_iterator>
1183 Set = &data().Conversions.get(Ctx);
1185 Set = &data().VisibleConversions.get(Ctx);
1187 if (!data().ComputedVisibleConversions) {
1189 data().ComputedVisibleConversions =
true;
1192 return llvm::make_range(Set->
begin(), Set->
end());
1208 for (
unsigned I = 0, E = Convs.
size(); I != E; ++I) {
1209 if (Convs[I].getDecl() == ConvDecl) {
1211 assert(std::find(Convs.
begin(), Convs.
end(), ConvDecl) == Convs.
end()
1212 &&
"conversion was found multiple times in unresolved set");
1217 llvm_unreachable(
"conversion not found in set!");
1222 return cast<CXXRecordDecl>(MSInfo->getInstantiatedFrom());
1230 assert(TemplateOrInstantiation.isNull() &&
1231 "Previous template or instantiation?");
1232 assert(!isa<ClassTemplatePartialSpecializationDecl>(
this));
1233 TemplateOrInstantiation
1239 = dyn_cast<ClassTemplateSpecializationDecl>(
this))
1240 return Spec->getSpecializationKind();
1243 return MSInfo->getTemplateSpecializationKind();
1251 = dyn_cast<ClassTemplateSpecializationDecl>(
this)) {
1252 Spec->setSpecializationKind(TSK);
1257 MSInfo->setTemplateSpecializationKind(TSK);
1261 llvm_unreachable(
"Not a class template or member class specialization");
1267 if (
auto *TD = dyn_cast<ClassTemplateSpecializationDecl>(
this)) {
1268 auto From = TD->getInstantiatedFrom();
1270 while (
auto *NewCTD = CTD->getInstantiatedFromMemberTemplate()) {
1271 if (NewCTD->isMemberSpecialization())
1279 while (
auto *NewCTPSD = CTPSD->getInstantiatedFromMember()) {
1280 if (NewCTPSD->isMemberSpecialization())
1298 "couldn't find pattern for class template instantiation");
1321 if (Destructor->isNoReturn())
1326 if (
Base.getType()->getAsCXXRecordDecl()->isAnyDestructorNoReturn())
1330 for (
const auto *Field :
fields())
1332 Field->getType()->getBaseElementTypeUnsafe()->getAsCXXRecordDecl())
1333 if (RD->isAnyDestructorNoReturn())
1351 if (!FinalOverriders) {
1353 FinalOverriders = &MyFinalOverriders;
1357 for (CXXFinalOverriderMap::iterator M = FinalOverriders->begin(),
1358 MEnd = FinalOverriders->end();
1359 M != MEnd && !Done; ++M) {
1361 SOEnd = M->second.end();
1362 SO != SOEnd && !Done; ++SO) {
1363 assert(SO->second.size() > 0 &&
1364 "All virtual functions have overridding virtual functions");
1370 if (SO->second.front().Method->isPure()) {
1371 data().Abstract =
true;
1382 I.setAccess((*I)->getAccess());
1386 if (data().Abstract ||
isInvalidDecl() || !data().Polymorphic ||
1390 for (
const auto &B :
bases()) {
1392 = cast<CXXRecordDecl>(B.getType()->getAs<
RecordType>()->getDecl());
1400 void CXXMethodDecl::anchor() { }
1432 if (isa<CXXDestructorDecl>(
this)) {
1453 for (
const auto &I : RD->
bases()) {
1473 return new (
C, RD)
CXXMethodDecl(CXXMethod, C, RD, StartLoc, NameInfo,
1474 T, TInfo, SC, isInline, isConstexpr,
1518 if (
const FunctionDecl *FD = dyn_cast<FunctionDecl>(*I))
1519 if (FD->getNumParams() == 1)
1558 if (!isa<RValueReferenceType>(ParamType))
1571 "Can't add an overridden method to a class template!");
1572 assert(MD->
isVirtual() &&
"Method is not virtual!");
1578 if (isa<CXXConstructorDecl>(
this))
return nullptr;
1583 if (isa<CXXConstructorDecl>(
this))
return nullptr;
1588 if (isa<CXXConstructorDecl>(
this))
return 0;
1599 assert(
isInstance() &&
"No 'this' for static methods!");
1622 if (StaticInvoker ==
this)
return true;
1635 : Initializee(TInfo), MemberOrEllipsisLocation(EllipsisLoc), Init(Init),
1636 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(IsVirtual),
1637 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1646 : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
1647 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(
false),
1648 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1657 : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
1658 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(
false),
1659 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1667 : Initializee(TInfo), MemberOrEllipsisLocation(), Init(Init),
1668 LParenLoc(L), RParenLoc(R), IsDelegating(
true), IsVirtual(
false),
1669 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1673 CXXCtorInitializer::CXXCtorInitializer(
ASTContext &Context,
1679 unsigned NumIndices)
1680 : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
1681 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(
false),
1682 IsWritten(
false), SourceOrderOrNumArrayIndices(NumIndices)
1685 memcpy(MyIndices, Indices, NumIndices *
sizeof(
VarDecl *));
1694 unsigned NumIndices) {
1696 sizeof(
VarDecl *) * NumIndices,
1697 llvm::alignOf<CXXCtorInitializer>());
1699 Indices, NumIndices);
1711 return Initializee.get<
TypeSourceInfo*>()->getType().getTypePtr();
1724 return TSInfo->getTypeLoc().getLocalSourceRange().getBegin();
1733 return I->getSourceRange();
1740 void CXXConstructorDecl::anchor() { }
1746 nullptr,
false,
false,
false,
false);
1754 bool isExplicit,
bool isInline,
1755 bool isImplicitlyDeclared,
bool isConstexpr) {
1758 "Name must refer to a constructor");
1760 isExplicit, isInline,
1761 isImplicitlyDeclared, isConstexpr);
1772 return Construct->getConstructor();
1882 return cast<CXXConstructorDecl>(*It);
1888 assert(
getASTContext().overridden_methods_size(
this) == 0 &&
1889 "Base ctor already set.");
1893 void CXXDestructorDecl::anchor() { }
1899 QualType(),
nullptr,
false,
false);
1907 bool isInline,
bool isImplicitlyDeclared) {
1910 "Name must refer to a destructor");
1912 isInline, isImplicitlyDeclared);
1917 if (OD && !
First->OperatorDelete) {
1918 First->OperatorDelete = OD;
1920 L->ResolvedOperatorDelete(
First, OD);
1924 void CXXConversionDecl::anchor() { }
1930 nullptr,
false,
false,
false,
1939 bool isInline,
bool isExplicit,
1943 "Name must refer to a conversion function");
1945 isInline, isExplicit, isConstexpr,
1954 void LinkageSpecDecl::anchor() { }
1962 return new (
C, DC)
LinkageSpecDecl(DC, ExternLoc, LangLoc, Lang, HasBraces);
1971 void UsingDirectiveDecl::anchor() { }
1980 if (
NamespaceDecl *NS = dyn_cast_or_null<NamespaceDecl>(Used))
1981 Used = NS->getOriginalNamespace();
1983 IdentLoc, Used, CommonAncestor);
1996 dyn_cast_or_null<NamespaceAliasDecl>(NominatedNamespace))
1997 return NA->getNamespace();
1998 return cast_or_null<NamespaceDecl>(NominatedNamespace);
2005 redeclarable_base(C), LocStart(StartLoc), RBraceLoc(),
2006 AnonOrFirstNamespaceAndInline(nullptr, Inline) {
2007 setPreviousDecl(PrevDecl);
2017 return new (
C, DC)
NamespaceDecl(C, DC, Inline, StartLoc, IdLoc, Id,
2036 void NamespaceAliasDecl::anchor() { }
2056 if (
NamespaceDecl *NS = dyn_cast_or_null<NamespaceDecl>(Namespace))
2057 Namespace = NS->getOriginalNamespace();
2059 QualifierLoc, IdentLoc, Namespace);
2070 void UsingShadowDecl::anchor() { }
2081 dyn_cast<UsingShadowDecl>(Shadow->UsingOrNextShadow))
2082 Shadow = NextShadow;
2083 return cast<UsingDecl>(Shadow->UsingOrNextShadow);
2086 void UsingDecl::anchor() { }
2090 "declaration already in set");
2093 if (FirstUsingShadow.getPointer())
2094 S->UsingOrNextShadow = FirstUsingShadow.getPointer();
2095 FirstUsingShadow.setPointer(S);
2100 "declaration not in set");
2105 if (FirstUsingShadow.getPointer() ==
S) {
2106 FirstUsingShadow.setPointer(
2107 dyn_cast<UsingShadowDecl>(S->UsingOrNextShadow));
2108 S->UsingOrNextShadow =
this;
2113 while (Prev->UsingOrNextShadow != S)
2114 Prev = cast<UsingShadowDecl>(Prev->UsingOrNextShadow);
2115 Prev->UsingOrNextShadow = S->UsingOrNextShadow;
2116 S->UsingOrNextShadow =
this;
2123 return new (
C, DC)
UsingDecl(DC, UL, QualifierLoc, NameInfo, HasTypename);
2138 void UnresolvedUsingValueDecl::anchor() { }
2146 QualifierLoc, NameInfo);
2163 void UnresolvedUsingTypenameDecl::anchor() { }
2173 DC, UsingLoc, TypenameLoc, QualifierLoc, TargetNameLoc,
2184 void StaticAssertDecl::anchor() { }
2208 return new (
C, DC)
MSPropertyDecl(DC, L, N, T, TInfo, StartL, Getter, Setter);
2221 llvm_unreachable(
"Invalid access specifier!");
2229 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)
void setImplicit(bool I=true)
bool isCXX98PODType(ASTContext &Context) const
unsigned overridden_methods_size(const CXXMethodDecl *Method) const
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)
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 isUserProvided() const
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...
bool IsBeingDefined
IsBeingDefined - True if this is currently being defined.
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...
void setInheritedConstructor(const CXXConstructorDecl *BaseCtor)
Set the constructor that this inheriting constructor is based on.
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
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...
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
bool hasDefinition() const
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
IdentifierInfo * getAsIdentifierInfo() const
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
SourceLocation getRParenLoc() const
NamespaceDecl - Represent a C++ namespace.
Represents a call to a C++ constructor.
virtual void completeDefinition()
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
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...
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...
AccessSpecifier getAccess() const
field_iterator field_begin() const
bool isCLike() const
True if this class is C-like, without C++-specific features, e.g. it contains only public fields...
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.
Expr * IgnoreImplicit() LLVM_READONLY
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)
bool MayHaveOutOfDateDef
Indicates whether it is possible for declarations of this kind to have an out-of-date definition...
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. Returns null if this cl...
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.
ASTMutationListener * getASTMutationListener() const
bool hasBody(const FunctionDecl *&Definition) const
Returns true if the function has a body (definition). The function body might be in any of the (re-)d...
bool isFunctionTemplateSpecialization() const
Determine whether this function is a function template specialization.
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...
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
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. This is either a single result (with no stable stora...
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
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
Retrieves the "canonical" declaration of the given declaration.
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
bool forallBases(ForallBasesCallback *BaseMatches, void *UserData, bool AllowShortCircuit=true) const
Determines if the given callback holds for all the direct or indirect base classes of this type...
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
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
Retrieves the "canonical" declaration of the given declaration.
const Type * getBaseClass() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
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)
Represents a linkage specification.
StringRef getLambdaStaticInvokerName()
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
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
A placeholder type used to construct an empty shell of a decl-derived type that will be filled in lat...
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
getObjCLifetime - 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. function call operator ...
overridden_cxx_method_iterator overridden_methods_end(const CXXMethodDecl *Method) const
static StaticAssertDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StaticAssertLoc, Expr *AssertExpr, StringLiteral *Message, SourceLocation RParenLoc, bool Failed)
ID
Defines the set of possible language-specific address spaces.
StorageClass getStorageClass() const
Returns the storage class as written in the source. For the computed linkage of symbol, see getLinkage.
const CXXMethodDecl *const * method_iterator
QualType getPointeeType() const
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++0x [class.copy]p3), which can be used to...
bool isDeleted() const
Whether this function has been deleted.
unsigned getTypeQualifiers() const
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
overridden_cxx_method_iterator overridden_methods_begin(const CXXMethodDecl *Method) const
DeclContext * getDeclContext()
bool hasDefaultArg() const
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)
StorageClass
Storage classes.
bool isDependentType() const
bool isCopyConstructor() const
CXXMethodDecl * getLambdaCallOperator() const
Retrieve the lambda call operator of the closure type if this is a closure type.
DeclarationName getDeclName() const
Represents a C++ conversion function within a class.
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.
FunctionDecl * getAsFunction() LLVM_READONLY
Returns the function itself, or the templated function if this is a function template.
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. The SourceManager can decode this to get at the full include stack...
void setOperatorDelete(FunctionDecl *OD)
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
unsigned getNumParams() const
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
method_iterator begin_overridden_methods() const
FieldDecl * getAnyMember() const
static CXXConstructorDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isExplicit, bool isInline, bool isImplicitlyDeclared, bool isConstexpr)
OverloadedOperatorKind getCXXOverloadedOperator() const
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.
ASTContext & getASTContext() const LLVM_READONLY
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
void addDecl(NamedDecl *D)
static MSPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool hasVolatileMember() const
T * get(ExternalASTSource *Source) const
Retrieve the pointer to the AST node that this lazy pointer.
lookup_result lookup(DeclarationName Name) const
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
static bool SawBase(const CXXRecordDecl *, void *)
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...
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)
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').
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
CXXDestructorDecl * getDestructor() const
Returns the destructor decl for this class.
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
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.
bool isInvalidDecl() const
void removeConversion(const NamedDecl *Old)
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).
static UnresolvedUsingTypenameDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, SourceLocation TypenameLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TargetNameLoc, DeclarationName TargetName)
A mapping from each virtual member function to its set of final overriders.
bool hasTrivialMoveConstructor() const
Determine whether this class has a trivial move constructor (C++11 [class.copy]p12) ...
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...
bool isLambda() const
Determine whether this class describes a lambda function object.
bool isRValueReferenceType() const
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)
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
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 ...
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...
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so...
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...
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
Represents a base class of a C++ class.
bool isAnyMemberInitializer() const
const CXXConstructorDecl * getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
QualType getPointeeType() const
TemplateParameterList * getGenericLambdaTemplateParameterList() const
Retrieve the generic lambda's template parameter list. Returns null if the class does not represent a...
bool isDefaultConstructor() const
bool isObjCGCStrong() const
isObjCGCStrong 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).
static CXXConstructorDecl * CreateDeserialized(ASTContext &C, unsigned ID)
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.
Kind
Lists the kind of concrete classes of Decl.
static Qualifiers fromCVRMask(unsigned CVR)
bool isStandardLayout() const
Determine whether this class has standard layout per (C++ [class]p7)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
conversion_iterator conversion_begin() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
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.
A trivial tuple used to represent a source range.
SourceLocation getLocation() const
Represents a C++ namespace alias.
void addOverriddenMethod(const CXXMethodDecl *Method, const CXXMethodDecl *Overridden)
Note that the given C++ Method overrides the given Overridden method.
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)
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
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.
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