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;
412 void CXXRecordDecl::markedVirtualFunctionPure() {
415 data().Abstract =
true;
418 void CXXRecordDecl::addedMember(
Decl *D) {
420 !isa<FieldDecl>(D) &&
421 !isa<IndirectFieldDecl>(D) &&
422 (!isa<TagDecl>(D) || cast<TagDecl>(D)->getTagKind() ==
TTK_Class ||
424 data().HasOnlyCMembers =
false;
435 if (Method->isVirtual()) {
438 data().Aggregate =
false;
442 data().PlainOldData =
false;
446 data().Empty =
false;
451 data().Polymorphic =
true;
457 data().HasTrivialSpecialMembers &= SMF_Destructor;
462 data().IsStandardLayout =
false;
470 L->AddedCXXImplicitMember(data().Definition, D);
477 if (!Constructor->isImplicit()) {
479 data().UserDeclaredConstructor =
true;
485 data().PlainOldData =
false;
491 bool UserProvided = Constructor->isUserProvided();
493 if (Constructor->isDefaultConstructor()) {
494 SMKind |= SMF_DefaultConstructor;
497 data().UserProvidedDefaultConstructor =
true;
498 if (Constructor->isConstexpr())
499 data().HasConstexprDefaultConstructor =
true;
504 if (Constructor->isCopyConstructor(Quals)) {
505 SMKind |= SMF_CopyConstructor;
508 data().HasDeclaredCopyConstructorWithConstParam =
true;
509 }
else if (Constructor->isMoveConstructor())
510 SMKind |= SMF_MoveConstructor;
515 if (Constructor->isConstexpr() && !Constructor->isCopyOrMoveConstructor())
516 data().HasConstexprNonCopyMoveConstructor =
true;
525 ? UserProvided : !Constructor->isImplicit())
526 data().Aggregate =
false;
531 SMKind |= SMF_Destructor;
533 if (DD->isUserProvided())
534 data().HasIrrelevantDestructor =
false;
542 data().HasTrivialSpecialMembers &= ~SMF_Destructor;
547 if (Method->isCopyAssignmentOperator()) {
548 SMKind |= SMF_CopyAssignment;
553 data().HasDeclaredCopyAssignmentWithConstParam =
true;
556 if (Method->isMoveAssignmentOperator())
557 SMKind |= SMF_MoveAssignment;
569 if (Conversion->getPrimaryTemplate()) {
575 FunTmpl ? cast<NamedDecl>(FunTmpl) : cast<NamedDecl>(Conversion);
580 Conversions.
addDecl(Ctx, Primary, AS);
587 data().HasTrivialSpecialMembers &=
588 data().DeclaredSpecialMembers | ~SMKind;
590 if (!Method->isImplicit() && !Method->isUserProvided()) {
594 }
else if (Method->isTrivial())
595 data().HasTrivialSpecialMembers |= SMKind;
597 data().DeclaredNonTrivialSpecialMembers |= SMKind;
601 data().DeclaredSpecialMembers |= SMKind;
603 if (!Method->isImplicit()) {
604 data().UserDeclaredSpecialMembers |= SMKind;
617 data().PlainOldData =
false;
625 if (
FieldDecl *Field = dyn_cast<FieldDecl>(D)) {
630 if (Field->isUnnamedBitfield())
639 data().Aggregate =
false;
640 data().PlainOldData =
false;
648 case AS_private: data().HasPrivateFields =
true;
break;
649 case AS_protected: data().HasProtectedFields =
true;
break;
650 case AS_public: data().HasPublicFields =
true;
break;
651 case AS_none: llvm_unreachable(
"Invalid access specifier");
653 if ((data().HasPrivateFields + data().HasProtectedFields +
654 data().HasPublicFields) > 1)
655 data().IsStandardLayout =
false;
658 if (Field->isMutable())
659 data().HasMutableFields =
true;
664 if (
isUnion() && !Field->isAnonymousStructOrUnion())
665 data().HasVariantMembers =
true;
687 struct DefinitionData &Data = data();
688 Data.PlainOldData =
false;
689 Data.HasTrivialSpecialMembers = 0;
690 Data.HasIrrelevantDestructor =
false;
693 data().PlainOldData =
false;
696 if (!Field->hasInClassInitializer())
697 data().HasUninitializedReferenceMember =
true;
702 data().IsStandardLayout =
false;
707 data().HasNonLiteralTypeFieldsOrBases =
true;
709 if (Field->hasInClassInitializer() ||
710 (Field->isAnonymousStructOrUnion() &&
711 Field->getType()->getAsCXXRecordDecl()->hasInClassInitializer())) {
712 data().HasInClassInitializer =
true;
717 data().HasTrivialSpecialMembers &= ~SMF_DefaultConstructor;
725 data().Aggregate =
false;
729 data().PlainOldData =
false;
737 data().DefaultedMoveAssignmentIsDeleted =
true;
740 CXXRecordDecl* FieldRec = cast<CXXRecordDecl>(RecordTy->getDecl());
742 addedClassSubobject(FieldRec);
747 data().NeedOverloadResolutionForMoveConstructor =
true;
748 data().NeedOverloadResolutionForMoveAssignment =
true;
758 data().DefaultedMoveConstructorIsDeleted =
true;
760 data().DefaultedMoveAssignmentIsDeleted =
true;
762 data().DefaultedDestructorIsDeleted =
true;
771 data().HasTrivialSpecialMembers &= ~SMF_DefaultConstructor;
780 data().HasTrivialSpecialMembers &= ~SMF_CopyConstructor;
785 data().HasTrivialSpecialMembers &= ~SMF_MoveConstructor;
794 data().HasTrivialSpecialMembers &= ~SMF_CopyAssignment;
799 data().HasTrivialSpecialMembers &= ~SMF_MoveAssignment;
802 data().HasTrivialSpecialMembers &= ~SMF_Destructor;
804 data().HasIrrelevantDestructor =
false;
815 data().IsStandardLayout =
false;
832 if (data().IsStandardLayout && data().Empty) {
833 for (
const auto &BI :
bases()) {
835 data().IsStandardLayout =
false;
843 data().HasMutableFields =
true;
852 if (!Field->hasInClassInitializer() &&
856 data().DefaultedDefaultConstructorIsConstexpr =
false;
865 data().ImplicitCopyConstructorHasConstParam =
false;
874 data().ImplicitCopyAssignmentHasConstParam =
false;
877 !Field->hasInClassInitializer())
878 data().HasUninitializedReferenceMember =
true;
884 Field->isAnonymousStructOrUnion())
885 data().HasVariantMembers =
true;
890 (!Field->hasInClassInitializer() && !
isUnion()))
891 data().DefaultedDefaultConstructorIsConstexpr =
false;
899 data().DefaultedMoveAssignmentIsDeleted =
true;
910 if (!data().HasNoNonEmptyBases)
911 data().IsStandardLayout =
false;
915 if (!Field->isBitField() ||
916 (!Field->getBitWidth()->isTypeDependent() &&
917 !Field->getBitWidth()->isValueDependent() &&
918 Field->getBitWidthValue(Context) != 0))
919 data().Empty =
false;
925 if (Shadow->getDeclName().getNameKind()
928 data().Conversions.get(Ctx).addDecl(Ctx, Shadow, Shadow->getAccess());
940 if (Constructor->isDefaultConstructor()) {
941 SMKind |= SMF_DefaultConstructor;
942 if (Constructor->isConstexpr())
943 data().HasConstexprDefaultConstructor =
true;
945 if (Constructor->isCopyConstructor())
946 SMKind |= SMF_CopyConstructor;
947 else if (Constructor->isMoveConstructor())
948 SMKind |= SMF_MoveConstructor;
949 else if (Constructor->isConstexpr())
951 data().HasConstexprNonCopyMoveConstructor =
true;
952 }
else if (isa<CXXDestructorDecl>(D)) {
953 SMKind |= SMF_Destructor;
955 data().HasIrrelevantDestructor =
false;
957 SMKind |= SMF_CopyAssignment;
959 SMKind |= SMF_MoveAssignment;
964 data().HasTrivialSpecialMembers |= SMKind;
966 data().DeclaredNonTrivialSpecialMembers |= SMKind;
971 !TemplateOrInstantiation.isNull())
976 return isPOD() && data().HasOnlyCMembers;
981 return getLambdaData().IsGenericLambda;
990 assert(!Calls.
empty() &&
"Missing lambda call operator!");
991 assert(Calls.
size() == 1 &&
"More than one lambda call operator!");
995 dyn_cast<FunctionTemplateDecl>(CallOp))
996 return cast<CXXMethodDecl>(CallOpTmpl->getTemplatedDecl());
998 return cast<CXXMethodDecl>(CallOp);
1006 if (Invoker.
empty())
return nullptr;
1007 assert(Invoker.
size() == 1 &&
"More than one static invoker operator!");
1010 dyn_cast<FunctionTemplateDecl>(InvokerFun))
1011 return cast<CXXMethodDecl>(InvokerTemplate->getTemplatedDecl());
1013 return cast<CXXMethodDecl>(InvokerFun);
1017 llvm::DenseMap<const VarDecl *, FieldDecl *> &Captures,
1020 ThisCapture =
nullptr;
1022 LambdaDefinitionData &Lambda = getLambdaData();
1024 for (
const LambdaCapture *C = Lambda.Captures, *CEnd = C + Lambda.NumCaptures;
1025 C != CEnd; ++C, ++Field) {
1026 if (C->capturesThis())
1027 ThisCapture = *Field;
1028 else if (C->capturesVariable())
1029 Captures[C->getCapturedVar()] = *Field;
1039 return Tmpl->getTemplateParameters();
1046 ->getConversionType();
1066 const llvm::SmallPtrSet<CanQualType, 8> &ParentHiddenTypes,
1069 llvm::SmallPtrSet<NamedDecl*, 8> &HiddenVBaseCs) {
1073 const llvm::SmallPtrSet<CanQualType, 8> *HiddenTypes = &ParentHiddenTypes;
1074 llvm::SmallPtrSet<CanQualType, 8> HiddenTypesBuffer;
1080 if (ConvI != ConvE) {
1081 HiddenTypesBuffer = ParentHiddenTypes;
1082 HiddenTypes = &HiddenTypesBuffer;
1086 bool Hidden = ParentHiddenTypes.count(ConvType);
1088 HiddenTypesBuffer.insert(ConvType);
1092 if (Hidden && InVirtual)
1093 HiddenVBaseCs.insert(cast<NamedDecl>(
I.getDecl()->getCanonicalDecl()));
1101 VOutput.
addDecl(
I.getDecl(), IAccess);
1103 Output.
addDecl(Context,
I.getDecl(), IAccess);
1109 for (
const auto &
I : Record->
bases()) {
1115 bool BaseInVirtual = InVirtual ||
I.isVirtual();
1119 *HiddenTypes, Output, VOutput, HiddenVBaseCs);
1137 llvm::SmallPtrSet<NamedDecl*, 8> HiddenVBaseCs;
1140 llvm::SmallPtrSet<CanQualType, 8> HiddenTypes;
1146 Output.
append(Context, ConvI, ConvE);
1147 for (; ConvI != ConvE; ++ConvI)
1151 for (
const auto &
I : Record->
bases()) {
1156 I.isVirtual(),
I.getAccessSpecifier(),
1157 HiddenTypes, Output, VBaseCs, HiddenVBaseCs);
1163 if (!HiddenVBaseCs.count(cast<NamedDecl>(
I.getDecl()->getCanonicalDecl())))
1164 Output.
addDecl(Context,
I.getDecl(),
I.getAccess());
1170 llvm::iterator_range<CXXRecordDecl::conversion_iterator>
1177 Set = &data().Conversions.get(Ctx);
1179 Set = &data().VisibleConversions.get(Ctx);
1181 if (!data().ComputedVisibleConversions) {
1183 data().ComputedVisibleConversions =
true;
1186 return llvm::make_range(Set->
begin(), Set->
end());
1202 for (
unsigned I = 0,
E = Convs.
size();
I !=
E; ++
I) {
1203 if (Convs[
I].getDecl() == ConvDecl) {
1205 assert(std::find(Convs.
begin(), Convs.
end(), ConvDecl) == Convs.
end()
1206 &&
"conversion was found multiple times in unresolved set");
1211 llvm_unreachable(
"conversion not found in set!");
1216 return cast<CXXRecordDecl>(MSInfo->getInstantiatedFrom());
1228 assert(TemplateOrInstantiation.isNull() &&
1229 "Previous template or instantiation?");
1230 assert(!isa<ClassTemplatePartialSpecializationDecl>(
this));
1231 TemplateOrInstantiation
1240 TemplateOrInstantiation = Template;
1245 = dyn_cast<ClassTemplateSpecializationDecl>(
this))
1246 return Spec->getSpecializationKind();
1249 return MSInfo->getTemplateSpecializationKind();
1257 = dyn_cast<ClassTemplateSpecializationDecl>(
this)) {
1258 Spec->setSpecializationKind(TSK);
1263 MSInfo->setTemplateSpecializationKind(TSK);
1267 llvm_unreachable(
"Not a class template or member class specialization");
1273 if (
auto *TD = dyn_cast<ClassTemplateSpecializationDecl>(
this)) {
1274 auto From = TD->getInstantiatedFrom();
1276 while (
auto *NewCTD = CTD->getInstantiatedFromMemberTemplate()) {
1277 if (NewCTD->isMemberSpecialization())
1285 while (
auto *NewCTPSD = CTPSD->getInstantiatedFromMember()) {
1286 if (NewCTPSD->isMemberSpecialization())
1304 "couldn't find pattern for class template instantiation");
1327 if (Destructor->isNoReturn())
1332 if (
Base.getType()->getAsCXXRecordDecl()->isAnyDestructorNoReturn())
1336 for (
const auto *Field :
fields())
1338 Field->getType()->getBaseElementTypeUnsafe()->getAsCXXRecordDecl())
1339 if (RD->isAnyDestructorNoReturn())
1357 if (!FinalOverriders) {
1359 FinalOverriders = &MyFinalOverriders;
1364 MEnd = FinalOverriders->end();
1365 M != MEnd && !Done; ++M) {
1367 SOEnd = M->second.end();
1368 SO != SOEnd && !Done; ++SO) {
1369 assert(SO->second.size() > 0 &&
1370 "All virtual functions have overridding virtual functions");
1376 if (SO->second.front().Method->isPure()) {
1377 data().Abstract =
true;
1388 I.setAccess((*I)->getAccess());
1392 if (data().Abstract ||
isInvalidDecl() || !data().Polymorphic ||
1396 for (
const auto &B :
bases()) {
1398 = cast<CXXRecordDecl>(B.getType()->getAs<
RecordType>()->getDecl());
1406 void CXXMethodDecl::anchor() { }
1438 if (isa<CXXDestructorDecl>(
this)) {
1459 for (
const auto &
I : RD->
bases()) {
1479 return new (
C, RD)
CXXMethodDecl(CXXMethod, C, RD, StartLoc, NameInfo,
1480 T, TInfo, SC, isInline, isConstexpr,
1525 if (FD->getNumParams() == 1)
1564 if (!isa<RValueReferenceType>(ParamType))
1577 "Can't add an overridden method to a class template!");
1578 assert(MD->
isVirtual() &&
"Method is not virtual!");
1584 if (isa<CXXConstructorDecl>(
this))
return nullptr;
1589 if (isa<CXXConstructorDecl>(
this))
return nullptr;
1594 if (isa<CXXConstructorDecl>(
this))
return 0;
1605 assert(
isInstance() &&
"No 'this' for static methods!");
1628 if (StaticInvoker ==
this)
return true;
1641 : Initializee(TInfo), MemberOrEllipsisLocation(EllipsisLoc), Init(Init),
1642 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(IsVirtual),
1643 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1652 : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
1653 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(
false),
1654 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1663 : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
1664 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(
false),
1665 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1673 : Initializee(TInfo), MemberOrEllipsisLocation(), Init(Init),
1674 LParenLoc(L), RParenLoc(R), IsDelegating(
true), IsVirtual(
false),
1675 IsWritten(
false), SourceOrderOrNumArrayIndices(0)
1679 CXXCtorInitializer::CXXCtorInitializer(
ASTContext &Context,
1685 unsigned NumIndices)
1686 : Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
1687 LParenLoc(L), RParenLoc(R), IsDelegating(
false), IsVirtual(
false),
1688 IsWritten(
false), SourceOrderOrNumArrayIndices(NumIndices)
1690 std::uninitialized_copy(Indices, Indices + NumIndices,
1691 getTrailingObjects<VarDecl *>());
1700 unsigned NumIndices) {
1701 void *Mem = Context.
Allocate(totalSizeToAlloc<VarDecl *>(NumIndices),
1702 llvm::alignOf<CXXCtorInitializer>());
1704 Indices, NumIndices);
1716 return Initializee.get<
TypeSourceInfo*>()->getType().getTypePtr();
1729 return TSInfo->getTypeLoc().getLocalSourceRange().getBegin();
1738 return I->getSourceRange();
1745 void CXXConstructorDecl::anchor() { }
1751 nullptr,
false,
false,
false,
false);
1759 bool isExplicit,
bool isInline,
1760 bool isImplicitlyDeclared,
bool isConstexpr) {
1763 "Name must refer to a constructor");
1765 isExplicit, isInline,
1766 isImplicitlyDeclared, isConstexpr);
1777 return Construct->getConstructor();
1887 return cast<CXXConstructorDecl>(*It);
1893 assert(
getASTContext().overridden_methods_size(
this) == 0 &&
1894 "Base ctor already set.");
1898 void CXXDestructorDecl::anchor() { }
1904 QualType(),
nullptr,
false,
false);
1912 bool isInline,
bool isImplicitlyDeclared) {
1915 "Name must refer to a destructor");
1917 isInline, isImplicitlyDeclared);
1922 if (OD && !
First->OperatorDelete) {
1923 First->OperatorDelete = OD;
1925 L->ResolvedOperatorDelete(
First, OD);
1929 void CXXConversionDecl::anchor() { }
1935 nullptr,
false,
false,
false,
1944 bool isInline,
bool isExplicit,
1948 "Name must refer to a conversion function");
1950 isInline, isExplicit, isConstexpr,
1959 void LinkageSpecDecl::anchor() { }
1967 return new (
C, DC)
LinkageSpecDecl(DC, ExternLoc, LangLoc, Lang, HasBraces);
1976 void UsingDirectiveDecl::anchor() { }
1985 if (
NamespaceDecl *NS = dyn_cast_or_null<NamespaceDecl>(Used))
1986 Used = NS->getOriginalNamespace();
1988 IdentLoc, Used, CommonAncestor);
2001 dyn_cast_or_null<NamespaceAliasDecl>(NominatedNamespace))
2002 return NA->getNamespace();
2003 return cast_or_null<NamespaceDecl>(NominatedNamespace);
2010 redeclarable_base(C), LocStart(StartLoc), RBraceLoc(),
2011 AnonOrFirstNamespaceAndInline(nullptr, Inline) {
2012 setPreviousDecl(PrevDecl);
2022 return new (
C, DC)
NamespaceDecl(C, DC, Inline, StartLoc, IdLoc, Id,
2035 return AnonOrFirstNamespaceAndInline.getPointer();
2042 return AnonOrFirstNamespaceAndInline.getPointer();
2057 void NamespaceAliasDecl::anchor() { }
2077 if (
NamespaceDecl *NS = dyn_cast_or_null<NamespaceDecl>(Namespace))
2078 Namespace = NS->getOriginalNamespace();
2080 QualifierLoc, IdentLoc, Namespace);
2091 void UsingShadowDecl::anchor() { }
2102 dyn_cast<UsingShadowDecl>(Shadow->UsingOrNextShadow))
2103 Shadow = NextShadow;
2104 return cast<UsingDecl>(Shadow->UsingOrNextShadow);
2107 void UsingDecl::anchor() { }
2111 "declaration already in set");
2114 if (FirstUsingShadow.getPointer())
2115 S->UsingOrNextShadow = FirstUsingShadow.getPointer();
2116 FirstUsingShadow.setPointer(S);
2121 "declaration not in set");
2126 if (FirstUsingShadow.getPointer() ==
S) {
2127 FirstUsingShadow.setPointer(
2128 dyn_cast<UsingShadowDecl>(S->UsingOrNextShadow));
2129 S->UsingOrNextShadow =
this;
2134 while (Prev->UsingOrNextShadow != S)
2135 Prev = cast<UsingShadowDecl>(Prev->UsingOrNextShadow);
2136 Prev->UsingOrNextShadow = S->UsingOrNextShadow;
2137 S->UsingOrNextShadow =
this;
2144 return new (
C, DC)
UsingDecl(DC, UL, QualifierLoc, NameInfo, HasTypename);
2159 void UnresolvedUsingValueDecl::anchor() { }
2167 QualifierLoc, NameInfo);
2184 void UnresolvedUsingTypenameDecl::anchor() { }
2194 DC, UsingLoc, TypenameLoc, QualifierLoc, TargetNameLoc,
2205 void StaticAssertDecl::anchor() { }
2229 return new (
C, DC)
MSPropertyDecl(DC, L, N, T, TInfo, StartL, Getter, Setter);
2242 llvm_unreachable(
"Invalid access specifier!");
2250 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)
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
bool isCXX98PODType(ASTContext &Context) const
Return true if this is a POD type according to the rules of the C++98 standard, regardless of the cur...
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.
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)
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 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...
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...
Decl - This represents one declaration (or definition), e.g.
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
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...
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
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.
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...
AccessSpecifier getAccess() const
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)
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.
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.
ASTMutationListener * getASTMutationListener() const
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.
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
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
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)
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
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
Retrieves the "canonical" declaration of the given declaration.
const Type * getBaseClass() const
If this is a base class initializer, returns the type of the base class.
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)
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
Represents a linkage specification.
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...
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
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.
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.
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.
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
overridden_cxx_method_iterator overridden_methods_begin(const CXXMethodDecl *Method) const
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
DeclContext * getDeclContext()
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
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.
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.
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
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
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
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.
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
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...
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
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)
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) ...
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
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.
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...
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.
bool isDefaultConstructor() const
Whether this constructor is a default constructor (C++ [class.ctor]p5), which can be used to default-...
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).
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.
StringLiteral - This represents a string literal expression, e.g.
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
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.
SourceLocation getLocation() const
NamedDecl - This represents a decl with a name.
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)
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...
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
getOverloadedOperator - Which C++ overloaded operator this function represents, if any...