37 #include "llvm/ADT/SmallString.h"
38 #include "llvm/ADT/StringExtras.h"
39 #include "llvm/ADT/Triple.h"
40 #include "llvm/Support/Capacity.h"
41 #include "llvm/Support/MathExtras.h"
42 #include "llvm/Support/raw_ostream.h"
45 using namespace clang;
70 assert(std::is_sorted(RawComments.begin(), RawComments.end(),
84 if (
const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
89 if (
const VarDecl *VD = dyn_cast<VarDecl>(D)) {
90 if (VD->isStaticDataMember() &&
101 dyn_cast<ClassTemplateSpecializationDecl>(D)) {
108 if (
const EnumDecl *ED = dyn_cast<EnumDecl>(D)) {
112 if (
const TagDecl *TD = dyn_cast<TagDecl>(D)) {
115 if (TD->isEmbeddedInDeclarator() && !TD->isCompleteDefinition())
119 if (isa<ParmVarDecl>(D))
124 if (isa<TemplateTypeParmDecl>(D) ||
125 isa<NonTypeTemplateParmDecl>(D) ||
126 isa<TemplateTemplateParmDecl>(D))
132 if (RawComments.empty())
142 if (isa<ObjCMethodDecl>(D) || isa<ObjCContainerDecl>(D) ||
143 isa<ObjCPropertyDecl>(D) ||
144 isa<RedeclarableTemplateDecl>(D) ||
145 isa<ClassTemplateSpecializationDecl>(D))
150 if (isa<TypedefDecl>(D)) {
155 }
else if (
const TagDecl *TD = dyn_cast<TagDecl>(D)) {
162 TD->isCompleteDefinition())
184 bool Found = Compare(*MaybeBeforeDecl, &CommentAtDeclLoc);
185 if (!Found && RawComments.size() >= 2) {
187 Found = Compare(*MaybeBeforeDecl, &CommentAtDeclLoc);
191 Comment = MaybeBeforeDecl + 1;
192 assert(Comment == std::lower_bound(RawComments.begin(), RawComments.end(),
193 &CommentAtDeclLoc, Compare));
196 Comment = std::lower_bound(RawComments.begin(), RawComments.end(),
197 &CommentAtDeclLoc, Compare);
206 if (Comment != RawComments.end() &&
207 (*Comment)->isDocumentation() && (*Comment)->isTrailingComment() &&
208 (isa<FieldDecl>(D) || isa<EnumConstantDecl>(D) || isa<VarDecl>(D) ||
209 isa<ObjCMethodDecl>(D) || isa<ObjCPropertyDecl>(D))) {
210 std::pair<FileID, unsigned> CommentBeginDecomp
214 if (DeclLocDecomp.first == CommentBeginDecomp.first &&
217 CommentBeginDecomp.second)) {
224 if (Comment == RawComments.begin())
229 if (!(*Comment)->isDocumentation() || (*Comment)->isTrailingComment())
233 std::pair<FileID, unsigned> CommentEndDecomp
238 if (DeclLocDecomp.first != CommentEndDecomp.first)
242 bool Invalid =
false;
249 StringRef
Text(Buffer + CommentEndDecomp.second,
250 DeclLocDecomp.second - CommentEndDecomp.second);
254 if (Text.find_first_of(
";{}#@") != StringRef::npos)
264 const Decl *adjustDeclToTemplate(
const Decl *D) {
265 if (
const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
285 if (
const VarDecl *VD = dyn_cast<VarDecl>(D)) {
288 if (VD->isStaticDataMember())
302 dyn_cast<ClassTemplateSpecializationDecl>(CRD)) {
308 return PU.is<ClassTemplateDecl*>() ?
309 static_cast<const Decl*>(PU.get<ClassTemplateDecl *>()) :
310 static_cast<const Decl*>(
316 CRD->getMemberSpecializationInfo())
317 return Info->getInstantiatedFrom();
321 if (
const EnumDecl *ED = dyn_cast<EnumDecl>(D)) {
335 const Decl **OriginalDecl)
const {
336 D = adjustDeclToTemplate(D);
354 const Decl *OriginalDeclForRC =
nullptr;
367 OriginalDeclForRC =
I;
387 *OriginalDecl = OriginalDeclForRC;
407 if (
const ObjCImplDecl *IMD = dyn_cast<ObjCImplDecl>(DC)) {
416 Redeclared.push_back(RedeclaredMethod);
422 const Decl *D)
const {
426 ThisDeclInfo->
fill();
438 return RC ? RC->
parse(*
this,
nullptr, D) :
nullptr;
446 D = adjustDeclToTemplate(D);
453 if (Canonical != D) {
461 const Decl *OriginalDecl;
465 if (isa<ObjCMethodDecl>(D) || isa<FunctionDecl>(D)) {
475 for (
unsigned i = 0, e = Overridden.size(); i < e; i++)
482 QualType QT = TD->getUnderlyingType();
484 if (
const Decl *TD = TT->getDecl())
489 while (IC->getSuperClass()) {
490 IC = IC->getSuperClass();
500 else if (
const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D)) {
501 if (!(RD = RD->getDefinition()))
504 for (
const auto &
I : RD->bases()) {
505 if (
I.isVirtual() || (
I.getAccessSpecifier() !=
AS_public))
511 if (!(NonVirtualBase= NonVirtualBase->getDefinition()))
519 for (
const auto &
I : RD->vbases()) {
526 if (!(VirtualBase= VirtualBase->getDefinition()))
540 if (D != OriginalDecl)
556 ID.AddInteger(Params->
size());
558 PEnd = Params->
end();
562 ID.AddBoolean(TTP->isParameterPack());
568 ID.AddBoolean(NTTP->isParameterPack());
569 ID.AddPointer(NTTP->getType().getCanonicalType().getAsOpaquePtr());
570 if (NTTP->isExpandedParameterPack()) {
572 ID.AddInteger(NTTP->getNumExpansionTypes());
573 for (
unsigned I = 0, N = NTTP->getNumExpansionTypes();
I != N; ++
I) {
578 ID.AddBoolean(
false);
589 ASTContext::getCanonicalTemplateTemplateParmDecl(
592 llvm::FoldingSetNodeID
ID;
594 void *InsertPos =
nullptr;
595 CanonicalTemplateTemplateParm *Canonical
596 = CanonTemplateTemplateParms.FindNodeOrInsertPos(ID, InsertPos);
598 return Canonical->getParam();
603 CanonParams.reserve(Params->
size());
605 PEnd = Params->
end();
608 CanonParams.push_back(
616 = dyn_cast<NonTypeTemplateParmDecl>(*
P)) {
620 if (NTTP->isExpandedParameterPack()) {
623 for (
unsigned I = 0, N = NTTP->getNumExpansionTypes();
I != N; ++
I) {
625 ExpandedTInfos.push_back(
633 NTTP->getPosition(),
nullptr,
636 ExpandedTypes.data(),
637 ExpandedTypes.size(),
638 ExpandedTInfos.data());
644 NTTP->getPosition(),
nullptr,
646 NTTP->isParameterPack(),
649 CanonParams.push_back(Param);
652 CanonParams.push_back(getCanonicalTemplateTemplateParmDecl(
653 cast<TemplateTemplateParmDecl>(*
P)));
668 Canonical = CanonTemplateTemplateParms.FindNodeOrInsertPos(ID, InsertPos);
669 assert(!Canonical &&
"Shouldn't be in the map!");
673 Canonical =
new (*this) CanonicalTemplateTemplateParm(CanonTTP);
674 CanonTemplateTemplateParms.InsertNode(Canonical, InsertPos);
679 if (!LangOpts.CPlusPlus)
return nullptr;
694 llvm_unreachable(
"Invalid CXXABI type!");
699 if (LOpts.FakeAddressSpaceMap) {
702 static const unsigned FakeAddrSpaceMap[] = {
711 return &FakeAddrSpaceMap;
719 switch (LangOpts.getAddressSpaceMapMangling()) {
727 llvm_unreachable(
"getAddressSpaceMapMangling() doesn't cover anything.");
733 : FunctionProtoTypes(this_()), TemplateSpecializationTypes(this_()),
734 DependentTemplateSpecializationTypes(this_()),
735 SubstTemplateTemplateParmPacks(this_()),
736 GlobalNestedNameSpecifier(nullptr), Int128Decl(nullptr),
737 UInt128Decl(nullptr), Float128StubDecl(nullptr),
738 BuiltinVaListDecl(nullptr), BuiltinMSVaListDecl(nullptr),
739 ObjCIdDecl(nullptr), ObjCSelDecl(nullptr), ObjCClassDecl(nullptr),
740 ObjCProtocolClassDecl(nullptr), BOOLDecl(nullptr),
741 CFConstantStringTypeDecl(nullptr), ObjCInstanceTypeDecl(nullptr),
742 FILEDecl(nullptr), jmp_bufDecl(nullptr), sigjmp_bufDecl(nullptr),
743 ucontext_tDecl(nullptr), BlockDescriptorType(nullptr),
744 BlockDescriptorExtendedType(nullptr), cudaConfigureCallDecl(nullptr),
745 FirstLocalImport(), LastLocalImport(), ExternCContext(nullptr),
746 MakeIntegerSeqDecl(nullptr),
SourceMgr(SM), LangOpts(LOpts),
748 AddrSpaceMap(nullptr), Target(nullptr), AuxTarget(nullptr),
750 BuiltinInfo(builtins), DeclarationNames(*this), ExternalSource(nullptr),
751 Listener(nullptr), Comments(SM), CommentsLoaded(
false),
752 CommentCommandTraits(BumpAlloc, LOpts.CommentOpts), LastSDM(nullptr, 0) {
757 ReleaseParentMapEntries();
761 ReleaseDeclContextMaps();
764 for (
auto &Pair : Deallocations)
765 (Pair.first)(Pair.second);
771 I = ObjCLayouts.begin(),
E = ObjCLayouts.end();
I !=
E; )
777 I = ASTRecordLayouts.begin(),
E = ASTRecordLayouts.end();
I !=
E; ) {
784 AEnd = DeclAttrs.end();
786 A->second->~AttrVec();
788 for (std::pair<const MaterializeTemporaryExpr *, APValue *> &MTVPair :
789 MaterializedTemporaryValues)
790 MTVPair.second->~APValue();
792 llvm::DeleteContainerSeconds(MangleNumberingContexts);
795 void ASTContext::ReleaseParentMapEntries() {
796 if (!PointerParents)
return;
797 for (
const auto &Entry : *PointerParents) {
804 for (
const auto &Entry : *OtherParents) {
814 Deallocations.push_back({
Callback, Data});
823 llvm::errs() <<
"\n*** AST Context Stats:\n";
824 llvm::errs() <<
" " << Types.size() <<
" types total.\n";
826 unsigned counts[] = {
827 #define TYPE(Name, Parent) 0,
828 #define ABSTRACT_TYPE(Name, Parent)
829 #include "clang/AST/TypeNodes.def"
833 for (
unsigned i = 0, e = Types.size(); i != e; ++i) {
839 unsigned TotalBytes = 0;
840 #define TYPE(Name, Parent) \
842 llvm::errs() << " " << counts[Idx] << " " << #Name \
844 TotalBytes += counts[Idx] * sizeof(Name##Type); \
846 #define ABSTRACT_TYPE(Name, Parent)
847 #include "clang/AST/TypeNodes.def"
849 llvm::errs() <<
"Total bytes = " << TotalBytes <<
"\n";
854 <<
" implicit default constructors created\n";
857 <<
" implicit copy constructors created\n";
861 <<
" implicit move constructors created\n";
864 <<
" implicit copy assignment operators created\n";
868 <<
" implicit move assignment operators created\n";
871 <<
" implicit destructors created\n";
874 llvm::errs() <<
"\n";
878 BumpAlloc.PrintStats();
882 bool NotifyListeners) {
888 MergedDefModules[ND].push_back(M);
894 auto It = MergedDefModules.find(ND);
895 if (It == MergedDefModules.end())
898 auto &Merged = It->second;
901 if (!Found.insert(M).second)
903 Merged.erase(std::remove(Merged.begin(), Merged.end(),
nullptr), Merged.end());
910 return ExternCContext;
917 BuiltinTemplate->setImplicit();
918 TUDecl->
addDecl(BuiltinTemplate);
920 return BuiltinTemplate;
925 if (!MakeIntegerSeqDecl)
928 return MakeIntegerSeqDecl;
942 NewDecl->addAttr(TypeVisibilityAttr::CreateImplicit(
943 const_cast<ASTContext &>(*
this), TypeVisibilityAttr::Default));
948 StringRef
Name)
const {
970 assert(LangOpts.CPlusPlus &&
"should only be called for c++");
971 if (!Float128StubDecl)
974 return Float128StubDecl;
985 assert((!this->Target || this->Target == &Target) &&
986 "Incorrect target reinitialization");
989 this->Target = &Target;
990 this->AuxTarget = AuxTarget;
992 ABI.reset(createCXXABI(Target));
997 InitBuiltinType(
VoidTy, BuiltinType::Void);
1000 InitBuiltinType(
BoolTy, BuiltinType::Bool);
1002 if (LangOpts.CharIsSigned)
1003 InitBuiltinType(
CharTy, BuiltinType::Char_S);
1005 InitBuiltinType(
CharTy, BuiltinType::Char_U);
1008 InitBuiltinType(
ShortTy, BuiltinType::Short);
1009 InitBuiltinType(
IntTy, BuiltinType::Int);
1010 InitBuiltinType(
LongTy, BuiltinType::Long);
1011 InitBuiltinType(
LongLongTy, BuiltinType::LongLong);
1021 InitBuiltinType(
FloatTy, BuiltinType::Float);
1022 InitBuiltinType(
DoubleTy, BuiltinType::Double);
1023 InitBuiltinType(
LongDoubleTy, BuiltinType::LongDouble);
1026 InitBuiltinType(
Int128Ty, BuiltinType::Int128);
1031 InitBuiltinType(
WCharTy, BuiltinType::WChar_S);
1033 InitBuiltinType(
WCharTy, BuiltinType::WChar_U);
1034 if (LangOpts.CPlusPlus && LangOpts.WChar)
1038 WideCharTy = getFromTargetType(Target.getWCharType());
1041 WIntTy = getFromTargetType(Target.getWIntType());
1043 if (LangOpts.CPlusPlus)
1044 InitBuiltinType(
Char16Ty, BuiltinType::Char16);
1046 Char16Ty = getFromTargetType(Target.getChar16Type());
1048 if (LangOpts.CPlusPlus)
1049 InitBuiltinType(
Char32Ty, BuiltinType::Char32);
1051 Char32Ty = getFromTargetType(Target.getChar32Type());
1058 InitBuiltinType(
DependentTy, BuiltinType::Dependent);
1061 InitBuiltinType(
OverloadTy, BuiltinType::Overload);
1070 InitBuiltinType(
UnknownAnyTy, BuiltinType::UnknownAny);
1076 InitBuiltinType(
BuiltinFnTy, BuiltinType::BuiltinFn);
1079 if (LangOpts.OpenMP)
1092 if (LangOpts.OpenCL) {
1093 InitBuiltinType(
OCLImage1dTy, BuiltinType::OCLImage1d);
1096 InitBuiltinType(
OCLImage2dTy, BuiltinType::OCLImage2d);
1104 BuiltinType::OCLImage2dArrayMSAADepth);
1105 InitBuiltinType(
OCLImage3dTy, BuiltinType::OCLImage3d);
1107 InitBuiltinType(
OCLSamplerTy, BuiltinType::OCLSampler);
1108 InitBuiltinType(
OCLEventTy, BuiltinType::OCLEvent);
1110 InitBuiltinType(
OCLQueueTy, BuiltinType::OCLQueue);
1111 InitBuiltinType(
OCLNDRangeTy, BuiltinType::OCLNDRange);
1119 ObjCConstantStringType =
QualType();
1127 InitBuiltinType(
NullPtrTy, BuiltinType::NullPtr);
1130 InitBuiltinType(
HalfTy, BuiltinType::Half);
1153 if (Pos != DeclAttrs.end()) {
1154 Pos->second->~AttrVec();
1155 DeclAttrs.erase(Pos);
1170 TemplateOrInstantiation.find(Var);
1171 if (Pos == TemplateOrInstantiation.end())
1184 Tmpl, TSK, PointOfInstantiation));
1190 assert(!TemplateOrInstantiation[Inst] &&
1191 "Already noted what the variable was instantiated from");
1192 TemplateOrInstantiation[Inst] = TSI;
1197 assert(FD &&
"Specialization is 0");
1198 llvm::DenseMap<const FunctionDecl*, FunctionDecl *>::const_iterator Pos
1199 = ClassScopeSpecializationPattern.find(FD);
1200 if (Pos == ClassScopeSpecializationPattern.end())
1208 assert(FD &&
"Specialization is 0");
1209 assert(Pattern &&
"Class scope specialization pattern is 0");
1210 ClassScopeSpecializationPattern[FD] = Pattern;
1215 llvm::DenseMap<UsingDecl *, NamedDecl *>::const_iterator Pos
1216 = InstantiatedFromUsingDecl.find(UUD);
1217 if (Pos == InstantiatedFromUsingDecl.end())
1225 assert((isa<UsingDecl>(Pattern) ||
1226 isa<UnresolvedUsingValueDecl>(Pattern) ||
1227 isa<UnresolvedUsingTypenameDecl>(Pattern)) &&
1228 "pattern decl is not a using decl");
1229 assert(!InstantiatedFromUsingDecl[Inst] &&
"pattern already exists");
1230 InstantiatedFromUsingDecl[Inst] = Pattern;
1235 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>::const_iterator Pos
1236 = InstantiatedFromUsingShadowDecl.find(Inst);
1237 if (Pos == InstantiatedFromUsingShadowDecl.end())
1246 assert(!InstantiatedFromUsingShadowDecl[Inst] &&
"pattern already exists");
1247 InstantiatedFromUsingShadowDecl[Inst] = Pattern;
1252 = InstantiatedFromUnnamedFieldDecl.find(Field);
1253 if (Pos == InstantiatedFromUnnamedFieldDecl.end())
1261 assert(!Inst->
getDeclName() &&
"Instantiated field decl is not unnamed");
1262 assert(!Tmpl->
getDeclName() &&
"Template field decl is not unnamed");
1263 assert(!InstantiatedFromUnnamedFieldDecl[Inst] &&
1264 "Already noted what unnamed field was instantiated from");
1266 InstantiatedFromUnnamedFieldDecl[Inst] = Tmpl;
1271 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector>::const_iterator Pos
1273 if (Pos == OverriddenMethods.end())
1276 return Pos->second.begin();
1281 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector>::const_iterator Pos
1283 if (Pos == OverriddenMethods.end())
1286 return Pos->second.end();
1291 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector>::const_iterator Pos
1293 if (Pos == OverriddenMethods.end())
1296 return Pos->second.size();
1302 OverriddenMethods[Method].push_back(Overridden);
1310 if (
const CXXMethodDecl *CXXMethod = dyn_cast<CXXMethodDecl>(D)) {
1322 Overridden.append(OverDecls.begin(), OverDecls.end());
1326 assert(!Import->NextLocalImport &&
"Import declaration already in the chain");
1327 assert(!Import->
isFromASTFile() &&
"Non-local import declaration");
1328 if (!FirstLocalImport) {
1329 FirstLocalImport = Import;
1330 LastLocalImport = Import;
1334 LastLocalImport->NextLocalImport = Import;
1335 LastLocalImport = Import;
1346 assert(BT &&
"Not a floating point type!");
1348 default: llvm_unreachable(
"Not a floating point type!");
1359 bool UseAlignAttrOnly =
false;
1361 Align = AlignFromAttr;
1369 if (isa<FieldDecl>(D)) {
1370 UseAlignAttrOnly = D->
hasAttr<PackedAttr>() ||
1371 cast<FieldDecl>(D)->getParent()->hasAttr<PackedAttr>();
1373 UseAlignAttrOnly =
true;
1376 else if (isa<FieldDecl>(D))
1379 cast<FieldDecl>(D)->getParent()->hasAttr<PackedAttr>();
1383 if (UseAlignAttrOnly) {
1386 }
else if (
const ValueDecl *VD = dyn_cast<ValueDecl>(D)) {
1400 if (!ForAlignof && MinWidth) {
1401 if (isa<VariableArrayType>(arrayType))
1403 else if (isa<ConstantArrayType>(arrayType) &&
1404 MinWidth <= getTypeSize(cast<ConstantArrayType>(arrayType)))
1409 if (
const VarDecl *VD = dyn_cast<VarDecl>(D)) {
1410 if (VD->hasGlobalStorage() && !ForAlignof)
1420 if (
const FieldDecl *Field = dyn_cast<FieldDecl>(VD)) {
1434 uint64_t LowBitOfOffset = Offset & (~Offset + 1);
1435 if (LowBitOfOffset < FieldAlign)
1436 FieldAlign =
static_cast<unsigned>(LowBitOfOffset);
1439 Align = std::min(Align, FieldAlign);
1451 std::pair<CharUnits, CharUnits>
1465 return sizeAndAlign;
1470 std::pair<CharUnits, CharUnits>
1473 std::pair<CharUnits, CharUnits> EltInfo =
1475 uint64_t Size = CAT->
getSize().getZExtValue();
1476 assert((Size == 0 || static_cast<uint64_t>(EltInfo.first.getQuantity()) <=
1477 (uint64_t)(-1)/Size) &&
1478 "Overflow in array type char size evaluation");
1479 uint64_t Width = EltInfo.first.getQuantity() * Size;
1480 unsigned Align = EltInfo.second.getQuantity();
1483 Width = llvm::RoundUpToAlignment(Width, Align);
1488 std::pair<CharUnits, CharUnits>
1497 std::pair<CharUnits, CharUnits>
1512 if (I != MemoizedTypeInfo.end())
1517 MemoizedTypeInfo[T] = TI;
1527 TypeInfo ASTContext::getTypeInfoImpl(
const Type *T)
const {
1530 bool AlignIsRequired =
false;
1532 #define TYPE(Class, Base)
1533 #define ABSTRACT_TYPE(Class, Base)
1534 #define NON_CANONICAL_TYPE(Class, Base)
1535 #define DEPENDENT_TYPE(Class, Base) case Type::Class:
1536 #define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) \
1538 assert(!T->isDependentType() && "should not see dependent types here"); \
1539 return getTypeInfo(cast<Class##Type>(T)->desugar().getTypePtr());
1540 #include "clang/AST/TypeNodes.def"
1541 llvm_unreachable(
"Should not see dependent types");
1543 case Type::FunctionNoProto:
1544 case Type::FunctionProto:
1550 case Type::IncompleteArray:
1551 case Type::VariableArray:
1556 case Type::ConstantArray: {
1560 uint64_t Size = CAT->
getSize().getZExtValue();
1561 assert((Size == 0 || EltInfo.Width <= (uint64_t)(-1) / Size) &&
1562 "Overflow in array type bit size evaluation");
1563 Width = EltInfo.Width * Size;
1564 Align = EltInfo.Align;
1567 Width = llvm::RoundUpToAlignment(Width, Align);
1570 case Type::ExtVector:
1571 case Type::Vector: {
1578 if (Align & (Align-1)) {
1579 Align = llvm::NextPowerOf2(Align);
1580 Width = llvm::RoundUpToAlignment(Width, Align);
1584 if (TargetVectorAlign && TargetVectorAlign < Align)
1585 Align = TargetVectorAlign;
1590 switch (cast<BuiltinType>(T)->
getKind()) {
1591 default: llvm_unreachable(
"Unknown builtin type!");
1592 case BuiltinType::Void:
1598 case BuiltinType::Bool:
1602 case BuiltinType::Char_S:
1603 case BuiltinType::Char_U:
1604 case BuiltinType::UChar:
1605 case BuiltinType::SChar:
1609 case BuiltinType::WChar_S:
1610 case BuiltinType::WChar_U:
1614 case BuiltinType::Char16:
1618 case BuiltinType::Char32:
1622 case BuiltinType::UShort:
1623 case BuiltinType::Short:
1627 case BuiltinType::UInt:
1628 case BuiltinType::Int:
1632 case BuiltinType::ULong:
1633 case BuiltinType::Long:
1637 case BuiltinType::ULongLong:
1638 case BuiltinType::LongLong:
1642 case BuiltinType::Int128:
1643 case BuiltinType::UInt128:
1647 case BuiltinType::Half:
1651 case BuiltinType::Float:
1655 case BuiltinType::Double:
1659 case BuiltinType::LongDouble:
1663 case BuiltinType::NullPtr:
1667 case BuiltinType::ObjCId:
1668 case BuiltinType::ObjCClass:
1669 case BuiltinType::ObjCSel:
1673 case BuiltinType::OCLSampler:
1678 case BuiltinType::OCLEvent:
1679 case BuiltinType::OCLClkEvent:
1680 case BuiltinType::OCLQueue:
1681 case BuiltinType::OCLNDRange:
1682 case BuiltinType::OCLReserveID:
1683 case BuiltinType::OCLImage1d:
1684 case BuiltinType::OCLImage1dArray:
1685 case BuiltinType::OCLImage1dBuffer:
1686 case BuiltinType::OCLImage2d:
1687 case BuiltinType::OCLImage2dArray:
1688 case BuiltinType::OCLImage2dDepth:
1689 case BuiltinType::OCLImage2dArrayDepth:
1690 case BuiltinType::OCLImage2dMSAA:
1691 case BuiltinType::OCLImage2dArrayMSAA:
1692 case BuiltinType::OCLImage2dMSAADepth:
1693 case BuiltinType::OCLImage2dArrayMSAADepth:
1694 case BuiltinType::OCLImage3d:
1701 case Type::ObjCObjectPointer:
1705 case Type::BlockPointer: {
1707 cast<BlockPointerType>(T)->getPointeeType());
1712 case Type::LValueReference:
1713 case Type::RValueReference: {
1717 cast<ReferenceType>(T)->getPointeeType());
1722 case Type::Pointer: {
1728 case Type::MemberPointer: {
1730 std::tie(Width, Align) = ABI->getMemberPointerWidthAndAlign(MPT);
1733 case Type::Complex: {
1737 Width = EltInfo.
Width * 2;
1738 Align = EltInfo.
Align;
1741 case Type::ObjCObject:
1742 return getTypeInfo(cast<ObjCObjectType>(T)->getBaseType().getTypePtr());
1743 case Type::Adjusted:
1746 case Type::ObjCInterface: {
1749 Width =
toBits(Layout.getSize());
1750 Align =
toBits(Layout.getAlignment());
1755 const TagType *TT = cast<TagType>(T);
1763 if (
const EnumType *ET = dyn_cast<EnumType>(TT)) {
1764 const EnumDecl *ED = ET->getDecl();
1768 Info.
Align = AttrAlign;
1779 AlignIsRequired = RD->hasAttr<AlignedAttr>();
1783 case Type::SubstTemplateTypeParm:
1784 return getTypeInfo(cast<SubstTemplateTypeParmType>(T)->
1785 getReplacementType().getTypePtr());
1788 const AutoType *A = cast<AutoType>(T);
1790 "cannot request the size of an undeduced or dependent auto type");
1795 return getTypeInfo(cast<ParenType>(T)->getInnerType().getTypePtr());
1797 case Type::Typedef: {
1805 AlignIsRequired =
true;
1814 case Type::Elaborated:
1815 return getTypeInfo(cast<ElaboratedType>(T)->getNamedType().getTypePtr());
1817 case Type::Attributed:
1819 cast<AttributedType>(T)->getEquivalentType().getTypePtr());
1821 case Type::Atomic: {
1830 if (Width != 0 && Width <= Target->getMaxAtomicPromoteWidth()) {
1832 if (!llvm::isPowerOf2_64(Width))
1833 Width = llvm::NextPowerOf2(Width);
1836 Align =
static_cast<unsigned>(Width);
1849 assert(llvm::isPowerOf2_32(Align) &&
"Alignment must be power of 2");
1850 return TypeInfo(Width, Align, AlignIsRequired);
1856 if ((
getTargetInfo().getTriple().getArch() == llvm::Triple::ppc64 ||
1857 getTargetInfo().getTriple().getArch() == llvm::Triple::ppc64le) &&
1898 unsigned ABIAlign = TI.
Align;
1906 if (Target->
getTriple().getArch() == llvm::Triple::xcore)
1911 T = CT->getElementType().getTypePtr();
1913 T = ET->getDecl()->getIntegerType().getTypePtr();
1920 return std::max(ABIAlign, (
unsigned)
getTypeSize(T));
1966 for (
const auto *
I : OI->
ivars())
1972 Ivars.push_back(Iv);
1979 llvm::SmallPtrSet<ObjCProtocolDecl*, 8> &Protocols) {
1983 for (
auto *Proto : OI->all_referenced_protocols()) {
1988 for (
const auto *Cat : OI->visible_categories())
1994 SD = SD->getSuperClass();
1996 }
else if (
const ObjCCategoryDecl *OC = dyn_cast<ObjCCategoryDecl>(CDecl)) {
1997 for (
auto *Proto : OC->protocols()) {
2000 }
else if (
const ObjCProtocolDecl *OP = dyn_cast<ObjCProtocolDecl>(CDecl)) {
2002 if (!Protocols.insert(
2003 const_cast<ObjCProtocolDecl *>(OP->getCanonicalDecl())).second)
2006 for (
auto *Proto : OP->protocols())
2015 count += Ext->ivar_size();
2020 count += ImplDecl->ivar_size();
2038 if (isa<GNUNullExpr>(E))
return true;
2046 I = ObjCImpls.find(D);
2047 if (I != ObjCImpls.end())
2048 return cast<ObjCImplementationDecl>(I->second);
2054 I = ObjCImpls.find(D);
2055 if (I != ObjCImpls.end())
2056 return cast<ObjCCategoryImplDecl>(I->second);
2063 assert(IFaceD && ImplD &&
"Passed null params");
2064 ObjCImpls[IFaceD] = ImplD;
2069 assert(CatD && ImplD &&
"Passed null params");
2070 ObjCImpls[CatD] = ImplD;
2075 return ObjCMethodRedecls.lookup(MD);
2081 ObjCMethodRedecls[MD] = Redecl;
2091 return CD->getClassInterface();
2094 return IMD->getClassInterface();
2102 assert(VD &&
"Passed null params");
2103 assert(VD->
hasAttr<BlocksAttr>() &&
2104 "getBlockVarCopyInits - not __block var");
2106 I = BlockVarCopyInits.find(VD);
2107 return (I != BlockVarCopyInits.end()) ? cast<Expr>(I->second) :
nullptr;
2112 assert(VD && Init &&
"Passed null params");
2113 assert(VD->
hasAttr<BlocksAttr>() &&
2114 "setBlockVarCopyInits - not __block var");
2115 BlockVarCopyInits[VD] = Init;
2119 unsigned DataSize)
const {
2124 "incorrect data size provided to CreateTypeSourceInfo!");
2141 return getObjCLayout(D,
nullptr);
2155 ASTContext::getExtQualType(
const Type *baseType,
Qualifiers quals)
const {
2160 llvm::FoldingSetNodeID
ID;
2162 void *insertPos =
nullptr;
2163 if (
ExtQuals *eq = ExtQualNodes.FindNodeOrInsertPos(ID, insertPos)) {
2164 assert(eq->getQualifiers() == quals);
2173 canon = getExtQualType(canonSplit.
Ty, canonSplit.
Quals);
2176 (void) ExtQualNodes.FindNodeOrInsertPos(ID, insertPos);
2180 ExtQualNodes.InsertNode(eq, insertPos);
2198 "Type cannot be in multiple addr spaces!");
2201 return getExtQualType(TypeNode, Quals);
2226 "Type cannot have multiple ObjCGCs!");
2229 return getExtQualType(TypeNode, Quals);
2247 return cast<FunctionType>(Result.
getTypePtr());
2263 L->DeducedReturnType(FD, ResultType);
2274 if (
auto *PT = dyn_cast<ParenType>(Orig))
2279 if (
auto *AT = dyn_cast<AttributedType>(Orig))
2309 if (TSInfo->getType() != FD->
getType())
2317 "TypeLoc size mismatch from updating exception specification");
2318 TSInfo->overrideType(Updated);
2327 llvm::FoldingSetNodeID
ID;
2330 void *InsertPos =
nullptr;
2331 if (
ComplexType *CT = ComplexTypes.FindNodeOrInsertPos(ID, InsertPos))
2341 ComplexType *NewIP = ComplexTypes.FindNodeOrInsertPos(ID, InsertPos);
2342 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2345 Types.push_back(New);
2346 ComplexTypes.InsertNode(New, InsertPos);
2355 llvm::FoldingSetNodeID
ID;
2358 void *InsertPos =
nullptr;
2359 if (
PointerType *PT = PointerTypes.FindNodeOrInsertPos(ID, InsertPos))
2369 PointerType *NewIP = PointerTypes.FindNodeOrInsertPos(ID, InsertPos);
2370 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2373 Types.push_back(New);
2374 PointerTypes.InsertNode(New, InsertPos);
2379 llvm::FoldingSetNodeID
ID;
2381 void *InsertPos =
nullptr;
2382 AdjustedType *AT = AdjustedTypes.FindNodeOrInsertPos(ID, InsertPos);
2389 AT = AdjustedTypes.FindNodeOrInsertPos(ID, InsertPos);
2390 assert(!AT &&
"Shouldn't be in the map!");
2394 Types.push_back(AT);
2395 AdjustedTypes.InsertNode(AT, InsertPos);
2419 llvm::FoldingSetNodeID
ID;
2421 void *InsertPos =
nullptr;
2422 AdjustedType *AT = AdjustedTypes.FindNodeOrInsertPos(ID, InsertPos);
2429 AT = AdjustedTypes.FindNodeOrInsertPos(ID, InsertPos);
2430 assert(!AT &&
"Shouldn't be in the map!");
2433 Types.push_back(AT);
2434 AdjustedTypes.InsertNode(AT, InsertPos);
2444 llvm::FoldingSetNodeID
ID;
2447 void *InsertPos =
nullptr;
2449 BlockPointerTypes.FindNodeOrInsertPos(ID, InsertPos))
2460 BlockPointerTypes.FindNodeOrInsertPos(ID, InsertPos);
2461 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2465 Types.push_back(New);
2466 BlockPointerTypes.InsertNode(New, InsertPos);
2475 "Unresolved overloaded function type");
2479 llvm::FoldingSetNodeID
ID;
2482 void *InsertPos =
nullptr;
2484 LValueReferenceTypes.FindNodeOrInsertPos(ID, InsertPos))
2492 if (!SpelledAsLValue || InnerRef || !T.
isCanonical()) {
2498 LValueReferenceTypes.FindNodeOrInsertPos(ID, InsertPos);
2499 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2505 Types.push_back(New);
2506 LValueReferenceTypes.InsertNode(New, InsertPos);
2516 llvm::FoldingSetNodeID
ID;
2519 void *InsertPos =
nullptr;
2521 RValueReferenceTypes.FindNodeOrInsertPos(ID, InsertPos))
2535 RValueReferenceTypes.FindNodeOrInsertPos(ID, InsertPos);
2536 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2541 Types.push_back(New);
2542 RValueReferenceTypes.InsertNode(New, InsertPos);
2551 llvm::FoldingSetNodeID
ID;
2554 void *InsertPos =
nullptr;
2556 MemberPointerTypes.FindNodeOrInsertPos(ID, InsertPos))
2567 MemberPointerTypes.FindNodeOrInsertPos(ID, InsertPos);
2568 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2572 Types.push_back(New);
2573 MemberPointerTypes.InsertNode(New, InsertPos);
2580 const llvm::APInt &ArySizeIn,
2582 unsigned IndexTypeQuals)
const {
2585 "Constant array of VLAs is illegal!");
2589 llvm::APInt ArySize(ArySizeIn);
2593 llvm::FoldingSetNodeID
ID;
2596 void *InsertPos =
nullptr;
2598 ConstantArrayTypes.FindNodeOrInsertPos(ID, InsertPos))
2607 ASM, IndexTypeQuals);
2612 ConstantArrayTypes.FindNodeOrInsertPos(ID, InsertPos);
2613 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2618 ConstantArrayTypes.InsertNode(New, InsertPos);
2619 Types.push_back(New);
2633 const Type *ty = split.
Ty;
2635 #define TYPE(Class, Base)
2636 #define ABSTRACT_TYPE(Class, Base)
2637 #define NON_CANONICAL_TYPE(Class, Base) case Type::Class:
2638 #include "clang/AST/TypeNodes.def"
2639 llvm_unreachable(
"didn't desugar past all non-canonical types?");
2645 case Type::ExtVector:
2646 case Type::DependentSizedExtVector:
2647 case Type::ObjCObject:
2648 case Type::ObjCInterface:
2649 case Type::ObjCObjectPointer:
2652 case Type::UnresolvedUsing:
2653 case Type::TypeOfExpr:
2655 case Type::Decltype:
2656 case Type::UnaryTransform:
2657 case Type::DependentName:
2658 case Type::InjectedClassName:
2659 case Type::TemplateSpecialization:
2660 case Type::DependentTemplateSpecialization:
2661 case Type::TemplateTypeParm:
2662 case Type::SubstTemplateTypeParmPack:
2664 case Type::PackExpansion:
2665 llvm_unreachable(
"type should never be variably-modified");
2669 case Type::FunctionNoProto:
2670 case Type::FunctionProto:
2671 case Type::BlockPointer:
2672 case Type::MemberPointer:
2682 cast<PointerType>(ty)->getPointeeType()));
2685 case Type::LValueReference: {
2693 case Type::RValueReference: {
2700 case Type::Atomic: {
2706 case Type::ConstantArray: {
2716 case Type::DependentSizedArray: {
2728 case Type::IncompleteArray: {
2740 case Type::VariableArray: {
2761 unsigned IndexTypeQuals,
2771 IndexTypeQuals, Brackets);
2778 VariableArrayTypes.push_back(New);
2779 Types.push_back(New);
2789 unsigned elementTypeQuals,
2793 "Size must be type- or value-dependent!");
2803 numElements, ASM, elementTypeQuals,
2805 Types.push_back(newType);
2814 void *insertPos =
nullptr;
2815 llvm::FoldingSetNodeID
ID;
2818 ASM, elementTypeQuals, numElements);
2822 DependentSizedArrayTypes.FindNodeOrInsertPos(ID, insertPos);
2828 QualType(), numElements, ASM, elementTypeQuals,
2830 DependentSizedArrayTypes.InsertNode(canonTy, insertPos);
2831 Types.push_back(canonTy);
2836 canonElementType.
Quals);
2840 if (
QualType(canonElementType.
Ty, 0) == elementType &&
2849 ASM, elementTypeQuals, brackets);
2850 Types.push_back(sugaredType);
2856 unsigned elementTypeQuals)
const {
2857 llvm::FoldingSetNodeID
ID;
2860 void *insertPos =
nullptr;
2862 IncompleteArrayTypes.FindNodeOrInsertPos(ID, insertPos))
2873 ASM, elementTypeQuals);
2878 IncompleteArrayTypes.FindNodeOrInsertPos(ID, insertPos);
2879 assert(!existing &&
"Shouldn't be in the map!"); (void) existing;
2885 IncompleteArrayTypes.InsertNode(newType, insertPos);
2886 Types.push_back(newType);
2897 llvm::FoldingSetNodeID
ID;
2900 void *InsertPos =
nullptr;
2901 if (
VectorType *VTP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos))
2911 VectorType *NewIP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos);
2912 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2915 VectorType(vecType, NumElts, Canonical, VecKind);
2916 VectorTypes.InsertNode(New, InsertPos);
2917 Types.push_back(New);
2928 llvm::FoldingSetNodeID
ID;
2931 void *InsertPos =
nullptr;
2932 if (
VectorType *VTP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos))
2942 VectorType *NewIP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos);
2943 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2947 VectorTypes.InsertNode(New, InsertPos);
2948 Types.push_back(New);
2956 llvm::FoldingSetNodeID
ID;
2960 void *InsertPos =
nullptr;
2962 = DependentSizedExtVectorTypes.FindNodeOrInsertPos(ID, InsertPos);
2972 if (CanonVecTy == vecType) {
2978 = DependentSizedExtVectorTypes.FindNodeOrInsertPos(ID, InsertPos);
2979 assert(!CanonCheck &&
"Dependent-sized ext_vector canonical type broken");
2981 DependentSizedExtVectorTypes.InsertNode(New, InsertPos);
2990 Types.push_back(New);
3003 llvm::FoldingSetNodeID
ID;
3006 void *InsertPos =
nullptr;
3008 FunctionNoProtoTypes.FindNodeOrInsertPos(ID, InsertPos))
3017 FunctionNoProtoTypes.FindNodeOrInsertPos(ID, InsertPos);
3018 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
3024 Types.push_back(New);
3025 FunctionNoProtoTypes.InsertNode(New, InsertPos);
3048 return CanResultType;
3054 size_t NumArgs = ArgArray.size();
3058 llvm::FoldingSetNodeID
ID;
3062 void *InsertPos =
nullptr;
3064 FunctionProtoTypes.FindNodeOrInsertPos(ID, InsertPos))
3070 !EPI.HasTrailingReturn;
3071 for (
unsigned i = 0; i != NumArgs && isCanonical; ++i)
3072 if (!ArgArray[i].isCanonicalAsParam())
3073 isCanonical =
false;
3080 CanonicalArgs.reserve(NumArgs);
3081 for (
unsigned i = 0; i !=
NumArgs; ++i)
3090 Canonical =
getFunctionType(CanResultTy, CanonicalArgs, CanonicalEPI);
3094 FunctionProtoTypes.FindNodeOrInsertPos(ID, InsertPos);
3095 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
3109 Size += EPI.ExceptionSpec.Exceptions.size() *
sizeof(
QualType);
3111 Size +=
sizeof(
Expr*);
3117 if (EPI.ConsumedParameters)
3118 Size += NumArgs *
sizeof(
bool);
3123 Types.push_back(FTP);
3124 FunctionProtoTypes.InsertNode(FTP, InsertPos);
3130 llvm::FoldingSetNodeID
ID;
3133 void *InsertPos = 0;
3134 if (
PipeType *PT = PipeTypes.FindNodeOrInsertPos(ID, InsertPos))
3144 PipeType *NewIP = PipeTypes.FindNodeOrInsertPos(ID, InsertPos);
3145 assert(!NewIP &&
"Shouldn't be in the map!");
3149 Types.push_back(New);
3150 PipeTypes.InsertNode(New, InsertPos);
3156 if (!isa<CXXRecordDecl>(D))
return false;
3158 if (isa<ClassTemplatePartialSpecializationDecl>(RD))
3161 !isa<ClassTemplateSpecializationDecl>(RD))
3172 if (Decl->TypeForDecl) {
3173 assert(isa<InjectedClassNameType>(Decl->TypeForDecl));
3175 assert(PrevDecl->TypeForDecl &&
"previous declaration has no type");
3176 Decl->TypeForDecl = PrevDecl->TypeForDecl;
3177 assert(isa<InjectedClassNameType>(Decl->TypeForDecl));
3181 Decl->TypeForDecl = newType;
3182 Types.push_back(newType);
3184 return QualType(Decl->TypeForDecl, 0);
3190 assert(Decl &&
"Passed null for Decl param");
3191 assert(!Decl->TypeForDecl &&
"TypeForDecl present in slow case");
3196 assert(!isa<TemplateTypeParmDecl>(Decl) &&
3197 "Template type parameter types are always available.");
3199 if (
const RecordDecl *Record = dyn_cast<RecordDecl>(Decl)) {
3200 assert(Record->isFirstDecl() &&
"struct/union has previous declaration");
3203 }
else if (
const EnumDecl *Enum = dyn_cast<EnumDecl>(Decl)) {
3204 assert(Enum->isFirstDecl() &&
"enum has previous declaration");
3207 dyn_cast<UnresolvedUsingTypenameDecl>(Decl)) {
3209 Decl->TypeForDecl = newType;
3210 Types.push_back(newType);
3212 llvm_unreachable(
"TypeDecl without a type?");
3214 return QualType(Decl->TypeForDecl, 0);
3222 if (Decl->TypeForDecl)
return QualType(Decl->TypeForDecl, 0);
3228 Decl->TypeForDecl = newType;
3229 Types.push_back(newType);
3234 if (Decl->TypeForDecl)
return QualType(Decl->TypeForDecl, 0);
3237 if (PrevDecl->TypeForDecl)
3238 return QualType(Decl->TypeForDecl = PrevDecl->TypeForDecl, 0);
3241 Decl->TypeForDecl = newType;
3242 Types.push_back(newType);
3247 if (Decl->TypeForDecl)
return QualType(Decl->TypeForDecl, 0);
3250 if (PrevDecl->TypeForDecl)
3251 return QualType(Decl->TypeForDecl = PrevDecl->TypeForDecl, 0);
3254 Decl->TypeForDecl = newType;
3255 Types.push_back(newType);
3262 llvm::FoldingSetNodeID
id;
3265 void *insertPos =
nullptr;
3267 if (type)
return QualType(type, 0);
3273 Types.push_back(type);
3274 AttributedTypes.InsertNode(type, insertPos);
3284 &&
"replacement types must always be canonical");
3286 llvm::FoldingSetNodeID
ID;
3288 void *InsertPos =
nullptr;
3290 = SubstTemplateTypeParmTypes.FindNodeOrInsertPos(ID, InsertPos);
3295 Types.push_back(SubstParm);
3296 SubstTemplateTypeParmTypes.InsertNode(SubstParm, InsertPos);
3309 assert(
P.getAsType().isCanonical() &&
"Pack contains non-canonical type");
3313 llvm::FoldingSetNodeID
ID;
3315 void *InsertPos =
nullptr;
3317 = SubstTemplateTypeParmPackTypes.FindNodeOrInsertPos(ID, InsertPos))
3325 SubstTemplateTypeParmPackTypes.FindNodeOrInsertPos(ID, InsertPos);
3331 Types.push_back(SubstParm);
3332 SubstTemplateTypeParmTypes.InsertNode(SubstParm, InsertPos);
3342 llvm::FoldingSetNodeID
ID;
3344 void *InsertPos =
nullptr;
3346 = TemplateTypeParmTypes.FindNodeOrInsertPos(ID, InsertPos);
3356 = TemplateTypeParmTypes.FindNodeOrInsertPos(ID, InsertPos);
3357 assert(!TypeCheck &&
"Template type parameter canonical type broken");
3363 Types.push_back(TypeParm);
3364 TemplateTypeParmTypes.InsertNode(TypeParm, InsertPos);
3375 "No dependent template names here!");
3385 for (
unsigned i = 0, e = TL.
getNumArgs(); i != e; ++i)
3395 "No dependent template names here!");
3400 ArgVec.reserve(NumArgs);
3401 for (
unsigned i = 0; i !=
NumArgs; ++i)
3402 ArgVec.push_back(Args[i].getArgument());
3412 if (Args[
I].isPackExpansion())
3425 "No dependent template names here!");
3434 if (!Underlying.
isNull())
3440 "Caller must compute aliased type");
3441 IsTypeAlias =
false;
3451 (IsTypeAlias?
sizeof(
QualType) : 0),
3455 IsTypeAlias ? Underlying :
QualType());
3457 Types.push_back(Spec);
3466 "No dependent template names here!");
3475 CanonArgs.reserve(NumArgs);
3481 llvm::FoldingSetNodeID
ID;
3483 CanonArgs.data(),
NumArgs, *
this);
3485 void *InsertPos =
nullptr;
3487 = TemplateSpecializationTypes.FindNodeOrInsertPos(ID, InsertPos);
3497 Types.push_back(Spec);
3498 TemplateSpecializationTypes.InsertNode(Spec, InsertPos);
3501 assert(Spec->isDependentType() &&
3502 "Non-dependent template-id type must have a canonical type");
3510 llvm::FoldingSetNodeID
ID;
3513 void *InsertPos =
nullptr;
3514 ElaboratedType *T = ElaboratedTypes.FindNodeOrInsertPos(ID, InsertPos);
3521 ElaboratedType *CheckT = ElaboratedTypes.FindNodeOrInsertPos(ID, InsertPos);
3522 assert(!CheckT &&
"Elaborated canonical type broken");
3528 ElaboratedTypes.InsertNode(T, InsertPos);
3534 llvm::FoldingSetNodeID
ID;
3537 void *InsertPos =
nullptr;
3538 ParenType *T = ParenTypes.FindNodeOrInsertPos(ID, InsertPos);
3545 ParenType *CheckT = ParenTypes.FindNodeOrInsertPos(ID, InsertPos);
3546 assert(!CheckT &&
"Paren canonical type broken");
3552 ParenTypes.InsertNode(T, InsertPos);
3566 if (CanonNNS != NNS || CanonKeyword != Keyword)
3570 llvm::FoldingSetNodeID
ID;
3573 void *InsertPos =
nullptr;
3575 = DependentNameTypes.FindNodeOrInsertPos(ID, InsertPos);
3581 DependentNameTypes.InsertNode(T, InsertPos);
3593 for (
unsigned I = 0,
E = Args.
size();
I !=
E; ++
I)
3594 ArgCopy.push_back(Args[
I].getArgument());
3608 "nested-name-specifier must be dependent");
3610 llvm::FoldingSetNodeID
ID;
3612 Name, NumArgs, Args);
3614 void *InsertPos =
nullptr;
3616 = DependentTemplateSpecializationTypes.FindNodeOrInsertPos(ID, InsertPos);
3625 bool AnyNonCanonArgs =
false;
3629 if (!CanonArgs[I].structurallyEquals(Args[I]))
3630 AnyNonCanonArgs =
true;
3634 if (AnyNonCanonArgs || CanonNNS != NNS || CanonKeyword != Keyword) {
3640 DependentTemplateSpecializationTypes.FindNodeOrInsertPos(ID, InsertPos);
3647 Name, NumArgs, Args, Canon);
3649 DependentTemplateSpecializationTypes.InsertNode(T, InsertPos);
3655 llvm::FoldingSetNodeID
ID;
3659 "Pack expansions must expand one or more parameter packs");
3660 void *InsertPos =
nullptr;
3662 = PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos);
3677 PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos);
3684 PackExpansionTypes.InsertNode(T, InsertPos);
3696 if (Protocols.empty())
return true;
3698 if (Protocols[0]->getCanonicalDecl() != Protocols[0])
3701 for (
unsigned i = 1; i != Protocols.size(); ++i)
3703 Protocols[i]->getCanonicalDecl() != Protocols[i])
3711 llvm::array_pod_sort(Protocols.begin(), Protocols.end(),
CmpProtocolNames);
3715 P =
P->getCanonicalDecl();
3718 auto ProtocolsEnd = std::unique(Protocols.begin(), Protocols.end());
3719 Protocols.erase(ProtocolsEnd, Protocols.end());
3724 unsigned NumProtocols)
const {
3726 llvm::makeArrayRef(Protocols, NumProtocols),
3734 bool isKindOf)
const {
3737 if (typeArgs.empty() && protocols.empty() && !isKindOf &&
3738 isa<ObjCInterfaceType>(baseType))
3742 llvm::FoldingSetNodeID
ID;
3744 void *InsertPos =
nullptr;
3745 if (
ObjCObjectType *QT = ObjCObjectTypes.FindNodeOrInsertPos(ID, InsertPos))
3752 if (effectiveTypeArgs.empty()) {
3754 effectiveTypeArgs = baseObject->getTypeArgs();
3761 bool typeArgsAreCanonical = std::all_of(effectiveTypeArgs.begin(),
3762 effectiveTypeArgs.end(),
3764 return type.isCanonical();
3767 if (!typeArgsAreCanonical || !protocolsSorted || !baseType.
isCanonical()) {
3771 if (!typeArgsAreCanonical) {
3772 canonTypeArgsVec.reserve(effectiveTypeArgs.size());
3773 for (
auto typeArg : effectiveTypeArgs)
3775 canonTypeArgs = canonTypeArgsVec;
3777 canonTypeArgs = effectiveTypeArgs;
3782 if (!protocolsSorted) {
3783 canonProtocolsVec.append(protocols.begin(), protocols.end());
3785 canonProtocols = canonProtocolsVec;
3787 canonProtocols = protocols;
3791 canonProtocols, isKindOf);
3794 ObjCObjectTypes.FindNodeOrInsertPos(ID, InsertPos);
3798 size += typeArgs.size() *
sizeof(
QualType);
3806 ObjCObjectTypes.InsertNode(T, InsertPos);
3820 for (
auto *Proto : OPT->quals()) {
3841 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> InheritedProtocols;
3843 if (InheritedProtocols.empty())
3847 bool Conforms =
false;
3848 for (
auto *Proto : OPT->
quals()) {
3850 for (
auto *PI : InheritedProtocols) {
3862 for (
auto *PI : InheritedProtocols) {
3864 bool Adopts =
false;
3865 for (
auto *Proto : OPT->
quals()) {
3879 llvm::FoldingSetNodeID
ID;
3882 void *InsertPos =
nullptr;
3884 ObjCObjectPointerTypes.FindNodeOrInsertPos(ID, InsertPos))
3893 ObjCObjectPointerTypes.FindNodeOrInsertPos(ID, InsertPos);
3901 Types.push_back(QType);
3902 ObjCObjectPointerTypes.InsertNode(QType, InsertPos);
3910 if (Decl->TypeForDecl)
3911 return QualType(Decl->TypeForDecl, 0);
3914 assert(PrevDecl->TypeForDecl &&
"previous decl has no TypeForDecl");
3915 Decl->TypeForDecl = PrevDecl->TypeForDecl;
3916 return QualType(PrevDecl->TypeForDecl, 0);
3925 Decl->TypeForDecl = T;
3938 llvm::FoldingSetNodeID
ID;
3941 void *InsertPos =
nullptr;
3943 = DependentTypeOfExprTypes.FindNodeOrInsertPos(ID, InsertPos);
3953 DependentTypeOfExprTypes.InsertNode(Canon, InsertPos);
3960 Types.push_back(toe);
3972 Types.push_back(tot);
3988 llvm::FoldingSetNodeID
ID;
3991 void *InsertPos =
nullptr;
3993 = DependentDecltypeTypes.FindNodeOrInsertPos(ID, InsertPos);
3997 DependentDecltypeTypes.InsertNode(Canon, InsertPos);
4005 Types.push_back(dt);
4020 Types.push_back(Ty);
4028 bool IsDependent)
const {
4033 void *InsertPos =
nullptr;
4034 llvm::FoldingSetNodeID
ID;
4036 if (
AutoType *AT = AutoTypes.FindNodeOrInsertPos(ID, InsertPos))
4042 Types.push_back(AT);
4044 AutoTypes.InsertNode(AT, InsertPos);
4053 llvm::FoldingSetNodeID
ID;
4056 void *InsertPos =
nullptr;
4057 if (
AtomicType *AT = AtomicTypes.FindNodeOrInsertPos(ID, InsertPos))
4067 AtomicType *NewIP = AtomicTypes.FindNodeOrInsertPos(ID, InsertPos);
4068 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
4071 Types.push_back(New);
4072 AtomicTypes.InsertNode(New, InsertPos);
4165 if (isa<ArrayType>(Ty)) {
4167 }
else if (isa<FunctionType>(Ty)) {
4189 quals = splitType.
Quals;
4199 if (elementType == unqualElementType) {
4200 assert(quals.
empty());
4201 quals = splitType.
Quals;
4221 VAT->getSizeModifier(),
4222 VAT->getIndexTypeCVRQualifiers(),
4223 VAT->getBracketsRange());
4243 if (T1PtrType && T2PtrType) {
4251 if (T1MPType && T2MPType &&
4253 QualType(T2MPType->getClass(), 0))) {
4262 if (T1OPType && T2OPType) {
4321 llvm_unreachable(
"bad template name kind!");
4330 = dyn_cast<TemplateTemplateParmDecl>(Template))
4331 Template = getCanonicalTemplateTemplateParmDecl(TTP);
4338 llvm_unreachable(
"cannot canonicalize overloaded template");
4342 assert(DTN &&
"Non-dependent template names must refer to template decls.");
4343 return DTN->CanonicalTemplateName;
4363 llvm_unreachable(
"bad template name!");
4413 A != AEnd; (void)++A, ++Idx)
4416 return TemplateArgument(llvm::makeArrayRef(CanonArgs, Arg.
pack_size()));
4421 llvm_unreachable(
"Unhandled template argument kind");
4477 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
4484 if (
const ArrayType *AT = dyn_cast<ArrayType>(T))
4505 if (!ATy || qs.
empty())
4518 IAT->getSizeModifier(),
4519 IAT->getIndexTypeCVRQualifiers()));
4522 = dyn_cast<DependentSizedArrayType>(ATy))
4523 return cast<ArrayType>(
4525 DSAT->getSizeExpr(),
4526 DSAT->getSizeModifier(),
4527 DSAT->getIndexTypeCVRQualifiers(),
4528 DSAT->getBracketsRange()));
4575 assert(PrettyArrayType &&
"Not an array type!");
4604 uint64_t ElementCount = 1;
4606 ElementCount *= CA->
getSize().getZExtValue();
4607 CA = dyn_cast_or_null<ConstantArrayType>(
4610 return ElementCount;
4619 assert(T->
getAs<
BuiltinType>() &&
"getFloatingRank(): not a floating type");
4621 default: llvm_unreachable(
"getFloatingRank(): not a floating type");
4622 case BuiltinType::Half:
return HalfRank;
4623 case BuiltinType::Float:
return FloatRank;
4638 case HalfRank: llvm_unreachable(
"Complex half is not supported");
4652 llvm_unreachable(
"getFloatingRank(): illegal value for rank");
4673 unsigned ASTContext::getIntegerRank(
const Type *T)
const {
4676 switch (cast<BuiltinType>(T)->getKind()) {
4677 default: llvm_unreachable(
"getIntegerRank(): not a built-in integer");
4678 case BuiltinType::Bool:
4680 case BuiltinType::Char_S:
4681 case BuiltinType::Char_U:
4682 case BuiltinType::SChar:
4683 case BuiltinType::UChar:
4685 case BuiltinType::Short:
4686 case BuiltinType::UShort:
4688 case BuiltinType::Int:
4689 case BuiltinType::UInt:
4691 case BuiltinType::Long:
4692 case BuiltinType::ULong:
4694 case BuiltinType::LongLong:
4695 case BuiltinType::ULongLong:
4697 case BuiltinType::Int128:
4698 case BuiltinType::UInt128:
4738 if (BitWidth < IntSize)
4741 if (BitWidth == IntSize)
4756 assert(!Promotable.
isNull());
4759 return ET->getDecl()->getPromotionType();
4768 if (BT->getKind() == BuiltinType::WChar_S ||
4769 BT->getKind() == BuiltinType::WChar_U ||
4770 BT->getKind() == BuiltinType::Char16 ||
4771 BT->getKind() == BuiltinType::Char32) {
4772 bool FromIsSigned = BT->getKind() == BuiltinType::WChar_S;
4776 for (
size_t Idx = 0; Idx < llvm::array_lengthof(PromoteTypes); ++Idx) {
4778 if (FromSize < ToSize ||
4779 (FromSize == ToSize &&
4780 FromIsSigned == PromoteTypes[Idx]->isSignedIntegerType()))
4781 return PromoteTypes[Idx];
4783 llvm_unreachable(
"char type should fit into long long");
4790 uint64_t PromotableSize =
getIntWidth(Promotable);
4831 if (
const EnumType *ET = dyn_cast<EnumType>(LHSC))
4833 if (
const EnumType *ET = dyn_cast<EnumType>(RHSC))
4836 if (LHSC == RHSC)
return 0;
4841 unsigned LHSRank = getIntegerRank(LHSC);
4842 unsigned RHSRank = getIntegerRank(RHSC);
4844 if (LHSUnsigned == RHSUnsigned) {
4845 if (LHSRank == RHSRank)
return 0;
4846 return LHSRank > RHSRank ? 1 : -1;
4852 if (LHSRank >= RHSRank)
4862 if (RHSRank >= LHSRank)
4873 if (!CFConstantStringTypeDecl) {
4882 FieldTypes[1] =
IntTy;
4889 for (
unsigned i = 0; i < 4; ++i) {
4893 FieldTypes[i],
nullptr,
4898 CFConstantStringTypeDecl->
addDecl(Field);
4908 if (ObjCSuperType.
isNull()) {
4910 TUDecl->
addDecl(ObjCSuperTypeDecl);
4913 return ObjCSuperType;
4918 assert(Rec &&
"Invalid CFConstantStringType");
4919 CFConstantStringTypeDecl = Rec->
getDecl();
4923 if (BlockDescriptorType)
4936 static const char *
const FieldNames[] = {
4941 for (
size_t i = 0; i < 2; ++i) {
4944 &
Idents.
get(FieldNames[i]), FieldTypes[i],
nullptr,
4952 BlockDescriptorType = RD;
4958 if (BlockDescriptorExtendedType)
4973 static const char *
const FieldNames[] = {
4980 for (
size_t i = 0; i < 4; ++i) {
4983 &
Idents.
get(FieldNames[i]), FieldTypes[i],
nullptr,
4992 BlockDescriptorExtendedType = RD;
5003 if (!copyExpr && record->hasTrivialDestructor())
return false;
5029 llvm_unreachable(
"fell out of lifetime switch!");
5037 bool &HasByrefExtendedLayout)
const {
5043 HasByrefExtendedLayout =
false;
5045 HasByrefExtendedLayout =
true;
5059 if (!ObjCInstanceTypeDecl)
5060 ObjCInstanceTypeDecl =
5062 return ObjCInstanceTypeDecl;
5068 if (
const TypedefType *TT = dyn_cast<TypedefType>(T))
5070 return II->isStr(
"BOOL");
5125 for (
auto PI : Decl->
params()) {
5130 assert (sz.
isPositive() &&
"BlockExpr - Incomplete param type");
5139 ParmOffset = PtrSize;
5140 for (
auto PVDecl : Decl->
params()) {
5141 QualType PType = PVDecl->getOriginalType();
5146 if (!isa<ConstantArrayType>(AT))
5147 PType = PVDecl->getType();
5149 PType = PVDecl->getType();
5168 for (
auto PI : Decl->
params()) {
5175 "getObjCEncodingForFunctionDecl - Incomplete param type");
5182 for (
auto PVDecl : Decl->
params()) {
5183 QualType PType = PVDecl->getOriginalType();
5188 if (!isa<ConstantArrayType>(AT))
5189 PType = PVDecl->getType();
5191 PType = PVDecl->getType();
5205 bool Extended)
const {
5209 getObjCEncodingForTypeImpl(T, S,
true,
true,
nullptr,
5221 bool Extended)
const {
5242 "getObjCEncodingForMethodDecl - Incomplete param type");
5250 ParmOffset = 2 * PtrSize;
5259 if (!isa<ConstantArrayType>(AT))
5264 PType,
S, Extended);
5275 const Decl *Container)
const {
5279 dyn_cast<ObjCCategoryImplDecl>(Container)) {
5280 for (
auto *PID : CID->property_impls())
5281 if (PID->getPropertyDecl() == PD)
5286 if (PID->getPropertyDecl() == PD)
5318 const Decl *Container,
5319 std::string&
S)
const {
5321 bool Dynamic =
false;
5329 SynthesizePID = PropertyImpDecl;
5375 if (SynthesizePID) {
5390 if (isa<TypedefType>(PointeeTy.
getTypePtr())) {
5392 if (BT->getKind() == BuiltinType::ULong &&
getIntWidth(PointeeTy) == 32)
5395 if (BT->getKind() == BuiltinType::Long &&
getIntWidth(PointeeTy) == 32)
5408 getObjCEncodingForTypeImpl(T, S,
true,
true, Field,
5409 true ,
false,
false,
5410 false,
false,
false, NotEncodedT);
5414 std::string&
S)
const {
5418 getObjCEncodingForTypeImpl(T, S,
true,
true,
nullptr,
5426 case BuiltinType::Void:
return 'v';
5427 case BuiltinType::Bool:
return 'B';
5428 case BuiltinType::Char_U:
5429 case BuiltinType::UChar:
return 'C';
5430 case BuiltinType::Char16:
5431 case BuiltinType::UShort:
return 'S';
5432 case BuiltinType::Char32:
5433 case BuiltinType::UInt:
return 'I';
5434 case BuiltinType::ULong:
5436 case BuiltinType::UInt128:
return 'T';
5437 case BuiltinType::ULongLong:
return 'Q';
5438 case BuiltinType::Char_S:
5439 case BuiltinType::SChar:
return 'c';
5440 case BuiltinType::Short:
return 's';
5441 case BuiltinType::WChar_S:
5442 case BuiltinType::WChar_U:
5443 case BuiltinType::Int:
return 'i';
5444 case BuiltinType::Long:
5446 case BuiltinType::LongLong:
return 'q';
5447 case BuiltinType::Int128:
return 't';
5448 case BuiltinType::Float:
return 'f';
5449 case BuiltinType::Double:
return 'd';
5450 case BuiltinType::LongDouble:
return 'D';
5451 case BuiltinType::NullPtr:
return '*';
5453 case BuiltinType::Half:
5457 case BuiltinType::ObjCId:
5458 case BuiltinType::ObjCClass:
5459 case BuiltinType::ObjCSel:
5460 llvm_unreachable(
"@encoding ObjC primitive type");
5463 case BuiltinType::OCLImage1d:
5464 case BuiltinType::OCLImage1dArray:
5465 case BuiltinType::OCLImage1dBuffer:
5466 case BuiltinType::OCLImage2d:
5467 case BuiltinType::OCLImage2dArray:
5468 case BuiltinType::OCLImage2dDepth:
5469 case BuiltinType::OCLImage2dArrayDepth:
5470 case BuiltinType::OCLImage2dMSAA:
5471 case BuiltinType::OCLImage2dArrayMSAA:
5472 case BuiltinType::OCLImage2dMSAADepth:
5473 case BuiltinType::OCLImage2dArrayMSAADepth:
5474 case BuiltinType::OCLImage3d:
5475 case BuiltinType::OCLEvent:
5476 case BuiltinType::OCLClkEvent:
5477 case BuiltinType::OCLQueue:
5478 case BuiltinType::OCLNDRange:
5479 case BuiltinType::OCLReserveID:
5480 case BuiltinType::OCLSampler:
5481 case BuiltinType::Dependent:
5482 #define BUILTIN_TYPE(KIND, ID)
5483 #define PLACEHOLDER_TYPE(KIND, ID) \
5484 case BuiltinType::KIND:
5485 #include "clang/AST/BuiltinTypes.def"
5486 llvm_unreachable(
"invalid builtin type for @encode");
5488 llvm_unreachable(
"invalid BuiltinType::Kind value");
5505 assert(FD->
isBitField() &&
"not a bitfield - getObjCEncodingForTypeImpl");
5537 void ASTContext::getObjCEncodingForTypeImpl(
QualType T, std::string&
S,
5538 bool ExpandPointedToStructures,
5539 bool ExpandStructures,
5542 bool EncodingProperty,
5544 bool EncodeBlockParameters,
5545 bool EncodeClassNames,
5546 bool EncodePointerToObjCTypedef,
5549 switch (CT->getTypeClass()) {
5554 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(CT))
5560 case Type::Complex: {
5563 getObjCEncodingForTypeImpl(CT->
getElementType(),
S,
false,
false,
nullptr);
5567 case Type::Atomic: {
5570 getObjCEncodingForTypeImpl(AT->
getValueType(),
S,
false,
false,
nullptr);
5576 case Type::LValueReference:
5577 case Type::RValueReference: {
5579 if (isa<PointerType>(CT)) {
5590 bool isReadOnly =
false;
5600 }
else if (OutermostType) {
5613 if (StringRef(S).endswith(
"nr"))
5614 S.replace(S.end()-2, S.end(),
"rn");
5626 if (RTy->getDecl()->getIdentifier() == &
Idents.
get(
"objc_class")) {
5631 if (RTy->getDecl()->getIdentifier() == &
Idents.
get(
"objc_object")) {
5640 getObjCEncodingForTypeImpl(PointeeTy, S,
false, ExpandPointedToStructures,
5641 nullptr,
false,
false,
false,
false,
false,
false,
5646 case Type::ConstantArray:
5647 case Type::IncompleteArray:
5648 case Type::VariableArray: {
5649 const ArrayType *AT = cast<ArrayType>(CT);
5651 if (isa<IncompleteArrayType>(AT) && !StructField) {
5656 false, ExpandStructures, FD);
5661 S += llvm::utostr(CAT->
getSize().getZExtValue());
5664 assert((isa<VariableArrayType>(AT) || isa<IncompleteArrayType>(AT)) &&
5665 "Unknown array type!");
5670 false, ExpandStructures, FD,
5671 false,
false,
false,
false,
false,
false,
5678 case Type::FunctionNoProto:
5679 case Type::FunctionProto:
5683 case Type::Record: {
5684 RecordDecl *RDecl = cast<RecordType>(CT)->getDecl();
5685 S += RDecl->
isUnion() ?
'(' :
'{';
5690 = dyn_cast<ClassTemplateSpecializationDecl>(RDecl)) {
5692 llvm::raw_string_ostream OS(S);
5694 TemplateArgs.
data(),
5695 TemplateArgs.
size(),
5696 (*this).getPrintingPolicy());
5701 if (ExpandStructures) {
5704 getObjCEncodingForStructureImpl(RDecl, S, FD,
true, NotEncodedT);
5706 for (
const auto *Field : RDecl->
fields()) {
5709 S += Field->getNameAsString();
5714 if (Field->isBitField()) {
5715 getObjCEncodingForTypeImpl(Field->getType(),
S,
false,
true,
5720 getObjCEncodingForTypeImpl(qt, S,
false,
true,
5724 false,
false,
false, NotEncodedT);
5729 S += RDecl->
isUnion() ?
')' :
'}';
5733 case Type::BlockPointer: {
5736 if (EncodeBlockParameters) {
5741 getObjCEncodingForTypeImpl(
5742 FT->
getReturnType(),
S, ExpandPointedToStructures, ExpandStructures,
5743 FD,
false , EncodingProperty,
5744 false , EncodeBlockParameters, EncodeClassNames,
false,
5750 for (
const auto &
I : FPT->param_types())
5751 getObjCEncodingForTypeImpl(
5752 I, S, ExpandPointedToStructures, ExpandStructures, FD,
5753 false , EncodingProperty,
5754 false , EncodeBlockParameters, EncodeClassNames,
5755 false, NotEncodedT);
5762 case Type::ObjCObject: {
5766 S +=
"{objc_object=}";
5770 S +=
"{objc_class=}";
5775 case Type::ObjCInterface: {
5784 for (
unsigned i = 0, e = Ivars.size(); i != e; ++i) {
5785 const FieldDecl *Field = cast<FieldDecl>(Ivars[i]);
5787 getObjCEncodingForTypeImpl(Field->
getType(),
S,
false,
true, Field);
5789 getObjCEncodingForTypeImpl(Field->
getType(),
S,
false,
true, FD,
5790 false,
false,
false,
false,
false,
5791 EncodePointerToObjCTypedef,
5798 case Type::ObjCObjectPointer: {
5815 ExpandPointedToStructures,
5816 ExpandStructures, FD);
5817 if (FD || EncodingProperty || EncodeClassNames) {
5821 for (
const auto *
I : OPT->
quals()) {
5823 S +=
I->getObjCRuntimeNameAsString();
5832 if (!EncodingProperty &&
5834 !EncodePointerToObjCTypedef) {
5844 for (
unsigned i = 0, e = Ivars.size(); i != e; ++i) {
5845 if (cast<FieldDecl>(Ivars[i]) == FD) {
5853 getObjCEncodingForTypeImpl(PointeeTy, S,
5854 false, ExpandPointedToStructures,
5856 false,
false,
false,
false,
false,
5863 (FD || EncodingProperty || EncodeClassNames)) {
5866 for (
const auto *
I : OPT->
quals()) {
5868 S +=
I->getObjCRuntimeNameAsString();
5878 case Type::MemberPointer:
5882 case Type::ExtVector:
5895 #define ABSTRACT_TYPE(KIND, BASE)
5896 #define TYPE(KIND, BASE)
5897 #define DEPENDENT_TYPE(KIND, BASE) \
5899 #define NON_CANONICAL_TYPE(KIND, BASE) \
5901 #define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(KIND, BASE) \
5903 #include "clang/AST/TypeNodes.def"
5904 llvm_unreachable(
"@encode for dependent type!");
5906 llvm_unreachable(
"bad type kind!");
5909 void ASTContext::getObjCEncodingForStructureImpl(
RecordDecl *RDecl,
5914 assert(RDecl &&
"Expected non-null RecordDecl");
5915 assert(!RDecl->
isUnion() &&
"Should not be called for unions");
5920 std::multimap<uint64_t, NamedDecl *> FieldOrBaseOffsets;
5924 for (
const auto &BI : CXXRec->
bases()) {
5925 if (!BI.isVirtual()) {
5930 FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
5931 std::make_pair(offs, base));
5937 for (
auto *Field : RDecl->
fields()) {
5939 FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
5940 std::make_pair(offs, Field));
5944 if (CXXRec && includeVBases) {
5945 for (
const auto &BI : CXXRec->
vbases()) {
5951 FieldOrBaseOffsets.find(offs) == FieldOrBaseOffsets.end())
5952 FieldOrBaseOffsets.insert(FieldOrBaseOffsets.end(),
5953 std::make_pair(offs, base));
5965 uint64_t CurOffs = 0;
5968 CurLayObj = FieldOrBaseOffsets.begin();
5971 (CurLayObj == FieldOrBaseOffsets.end() || CurLayObj->first != 0)) {
5975 if (recname.empty()) recname =
"?";
5987 uint64_t offs =
toBits(size);
5988 FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
5989 std::make_pair(offs,
nullptr));
5992 for (; CurLayObj != FieldOrBaseOffsets.end(); ++CurLayObj) {
5994 assert(CurOffs <= CurLayObj->first);
5995 if (CurOffs < CurLayObj->first) {
5996 uint64_t padding = CurLayObj->first - CurOffs;
6017 getObjCEncodingForStructureImpl(base, S, FD,
false,
6024 FieldDecl *field = cast<FieldDecl>(dcl);
6039 getObjCEncodingForTypeImpl(qt, S,
false,
true, FD,
6043 false,
false,
false, NotEncodedT);
6053 std::string& S)
const {
6086 if (!ObjCClassDecl) {
6091 return ObjCClassDecl;
6095 if (!ObjCProtocolClassDecl) {
6096 ObjCProtocolClassDecl
6105 return ObjCProtocolClassDecl;
6151 const size_t NumFields = 5;
6153 const char *FieldNames[NumFields];
6157 FieldNames[0] =
"__stack";
6161 FieldNames[1] =
"__gr_top";
6165 FieldNames[2] =
"__vr_top";
6168 FieldTypes[3] = Context->
IntTy;
6169 FieldNames[3] =
"__gr_offs";
6172 FieldTypes[4] = Context->
IntTy;
6173 FieldNames[4] =
"__vr_offs";
6176 for (
unsigned i = 0; i < NumFields; ++i) {
6182 FieldTypes[i],
nullptr,
6187 VaListTagDecl->
addDecl(Field);
6204 const size_t NumFields = 5;
6206 const char *FieldNames[NumFields];
6210 FieldNames[0] =
"gpr";
6214 FieldNames[1] =
"fpr";
6218 FieldNames[2] =
"reserved";
6222 FieldNames[3] =
"overflow_arg_area";
6226 FieldNames[4] =
"reg_save_area";
6229 for (
unsigned i = 0; i < NumFields; ++i) {
6234 FieldTypes[i],
nullptr,
6239 VaListTagDecl->
addDecl(Field);
6267 const size_t NumFields = 4;
6269 const char *FieldNames[NumFields];
6273 FieldNames[0] =
"gp_offset";
6277 FieldNames[1] =
"fp_offset";
6281 FieldNames[2] =
"overflow_arg_area";
6285 FieldNames[3] =
"reg_save_area";
6288 for (
unsigned i = 0; i < NumFields; ++i) {
6294 FieldTypes[i],
nullptr,
6299 VaListTagDecl->
addDecl(Field);
6370 const size_t NumFields = 4;
6372 const char *FieldNames[NumFields];
6375 FieldTypes[0] = Context->
LongTy;
6376 FieldNames[0] =
"__gpr";
6379 FieldTypes[1] = Context->
LongTy;
6380 FieldNames[1] =
"__fpr";
6384 FieldNames[2] =
"__overflow_arg_area";
6388 FieldNames[3] =
"__reg_save_area";
6391 for (
unsigned i = 0; i < NumFields; ++i) {
6397 FieldTypes[i],
nullptr,
6402 VaListTagDecl->
addDecl(Field);
6439 llvm_unreachable(
"Unhandled __builtin_va_list type kind");
6443 if (!BuiltinVaListDecl) {
6448 return BuiltinVaListDecl;
6461 if (!BuiltinMSVaListDecl)
6464 return BuiltinMSVaListDecl;
6468 assert(ObjCConstantStringType.
isNull() &&
6469 "'NSConstantString' type already set!");
6479 unsigned size = End - Begin;
6480 assert(size > 1 &&
"set is not overloaded!");
6489 assert(isa<FunctionTemplateDecl>(D) ||
6490 (isa<UsingShadowDecl>(D) &&
6502 bool TemplateKeyword,
6504 assert(NNS &&
"Missing nested-name-specifier in qualified template name");
6507 llvm::FoldingSetNodeID
ID;
6510 void *InsertPos =
nullptr;
6512 QualifiedTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
6514 QTN =
new (*
this, llvm::alignOf<QualifiedTemplateName>())
6516 QualifiedTemplateNames.InsertNode(QTN, InsertPos);
6528 "Nested name specifier must be dependent");
6530 llvm::FoldingSetNodeID
ID;
6533 void *InsertPos =
nullptr;
6535 DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
6541 if (CanonNNS == NNS) {
6542 QTN =
new (*
this, llvm::alignOf<DependentTemplateName>())
6546 QTN =
new (*
this, llvm::alignOf<DependentTemplateName>())
6549 DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
6550 assert(!CheckQTN &&
"Dependent type name canonicalization broken");
6554 DependentTemplateNames.InsertNode(QTN, InsertPos);
6564 "Nested name specifier must be dependent");
6566 llvm::FoldingSetNodeID
ID;
6569 void *InsertPos =
nullptr;
6571 = DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
6577 if (CanonNNS == NNS) {
6578 QTN =
new (*
this, llvm::alignOf<DependentTemplateName>())
6582 QTN =
new (*
this, llvm::alignOf<DependentTemplateName>())
6586 = DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
6587 assert(!CheckQTN &&
"Dependent template name canonicalization broken");
6591 DependentTemplateNames.InsertNode(QTN, InsertPos);
6598 llvm::FoldingSetNodeID
ID;
6601 void *insertPos =
nullptr;
6603 = SubstTemplateTemplateParms.FindNodeOrInsertPos(ID, insertPos);
6607 SubstTemplateTemplateParms.InsertNode(subst, insertPos);
6617 llvm::FoldingSetNodeID
ID;
6620 void *InsertPos =
nullptr;
6622 = SubstTemplateTemplateParmPacks.FindNodeOrInsertPos(ID, InsertPos);
6628 SubstTemplateTemplateParmPacks.InsertNode(Subst, InsertPos);
6652 llvm_unreachable(
"Unhandled TargetInfo::IntType value");
6682 while (
const ArrayType *AT = dyn_cast<ArrayType>(CT))
6705 assert(FirstVec->
isVectorType() &&
"FirstVec should be a vector type");
6706 assert(SecondVec->
isVectorType() &&
"SecondVec should be a vector type");
6749 assert ((lhsQID && rhsOPT) &&
"ObjCQualifiedClassTypesAreCompatible");
6751 for (
auto *lhsProto : lhsQID->
quals()) {
6753 for (
auto *rhsProto : rhsOPT->quals()) {
6780 if (!rhsOPT)
return false;
6786 for (
auto *
I : lhsQID->quals()) {
6790 if (!rhsID->ClassImplementsProtocol(
I,
true))
6798 for (
auto *lhsProto : lhsQID->quals()) {
6804 for (
auto *rhsProto : rhsOPT->
quals()) {
6814 for (
auto *
I : lhsQID->quals()) {
6818 if (rhsID->ClassImplementsProtocol(
I,
true)) {
6832 assert(rhsQID &&
"One of the LHS/RHS should be id<x>");
6837 for (
auto *lhsProto : lhsOPT->quals()) {
6845 for (
auto *rhsProto : rhsQID->
quals()) {
6859 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> LHSInheritedProtocols;
6864 if (LHSInheritedProtocols.empty() && lhsOPT->qual_empty())
6866 for (
auto *lhsProto : LHSInheritedProtocols) {
6868 for (
auto *rhsProto : rhsQID->
quals()) {
6900 auto finish = [&](
bool succeeded) ->
bool {
6940 bool BlockReturnType) {
6944 auto finish = [&](
bool succeeded) ->
bool {
6978 return finish(BlockReturnType);
6980 return finish(!BlockReturnType);
6992 return (*lhs)->getName().compare((*rhs)->getName());
7010 assert(LHS->
getInterface() &&
"LHS must have an interface base");
7011 assert(RHS->
getInterface() &&
"RHS must have an interface base");
7014 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> LHSProtocolSet;
7017 for (
auto proto : LHS->
quals()) {
7025 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> RHSProtocolSet;
7028 for (
auto proto : RHS->
quals()) {
7036 for (
auto proto : LHSProtocolSet) {
7037 if (RHSProtocolSet.count(proto))
7038 IntersectionSet.push_back(proto);
7043 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> ImpliedProtocols;
7047 if (!ImpliedProtocols.empty()) {
7048 IntersectionSet.erase(
7049 std::remove_if(IntersectionSet.begin(),
7050 IntersectionSet.end(),
7052 return ImpliedProtocols.count(proto) > 0;
7054 IntersectionSet.end());
7058 llvm::array_pod_sort(IntersectionSet.begin(), IntersectionSet.end(),
7068 if (lhsOPT && rhsOPT)
7074 if (lhsBlock && rhsBlock)
7080 (rhsOPT && rhsOPT->isObjCIdType() && lhsBlock))
7092 if (lhsArgs.size() != rhsArgs.size())
7096 for (
unsigned i = 0, n = lhsArgs.size(); i != n; ++i) {
7100 switch (typeParams->
begin()[i]->getVariance()) {
7103 !ctx.
hasSameType(lhsArgs[i].stripObjCKindOfType(ctx),
7104 rhsArgs[i].stripObjCKindOfType(ctx))) {
7132 if (!LDecl || !RDecl)
7137 llvm::SmallDenseMap<const ObjCInterfaceDecl *, const ObjCObjectType *, 4>
7147 bool anyChanges =
false;
7165 if (!Protocols.empty())
7181 if (LHSSuperType.
isNull())
7191 if (KnownLHS != LHSAncestors.end()) {
7192 LHS = KnownLHS->second;
7196 bool anyChanges =
false;
7214 if (!Protocols.empty())
7229 if (RHSSuperType.
isNull())
7240 assert(LHS->
getInterface() &&
"LHS is not an interface type");
7241 assert(RHS->
getInterface() &&
"RHS is not an interface type");
7258 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> SuperClassInheritedProtocols;
7262 for (
auto *RHSPI : RHS->
quals())
7265 if (SuperClassInheritedProtocols.empty())
7268 for (
const auto *LHSProto : LHS->
quals()) {
7269 bool SuperImplementsProtocol =
false;
7270 for (
auto *SuperClassProto : SuperClassInheritedProtocols)
7271 if (SuperClassProto->lookupProtocolNamed(LHSProto->getIdentifier())) {
7272 SuperImplementsProtocol =
true;
7275 if (!SuperImplementsProtocol)
7305 if (!LHSOPT || !RHSOPT)
7323 bool CompareUnqualified) {
7342 bool OfBlockPointer,
7346 if (UD->
hasAttr<TransparentUnionAttr>()) {
7347 for (
const auto *
I : UD->
fields()) {
7348 QualType ET =
I->getType().getUnqualifiedType();
7362 bool OfBlockPointer,
7377 return mergeTypes(lhs, rhs, OfBlockPointer, Unqualified);
7381 bool OfBlockPointer,
7387 bool allLTypes =
true;
7388 bool allRTypes =
true;
7392 if (OfBlockPointer) {
7393 QualType RHS = rbase->getReturnType();
7395 bool UnqualifiedResult = Unqualified;
7396 if (!UnqualifiedResult)
7398 retType =
mergeTypes(LHS, RHS,
true, UnqualifiedResult,
true);
7450 if (lproto && rproto) {
7451 assert(!lproto->hasExceptionSpec() && !rproto->hasExceptionSpec() &&
7452 "C++ shouldn't be here");
7454 if (lproto->getNumParams() != rproto->getNumParams())
7458 if (lproto->isVariadic() != rproto->isVariadic())
7461 if (lproto->getTypeQuals() != rproto->getTypeQuals())
7464 if (LangOpts.ObjCAutoRefCount &&
7470 for (
unsigned i = 0, n = lproto->getNumParams(); i < n; i++) {
7471 QualType lParamType = lproto->getParamType(i).getUnqualifiedType();
7472 QualType rParamType = rproto->getParamType(i).getUnqualifiedType();
7474 lParamType, rParamType, OfBlockPointer, Unqualified);
7481 types.push_back(paramType);
7493 if (allLTypes)
return lhs;
7494 if (allRTypes)
return rhs;
7501 if (lproto) allRTypes =
false;
7502 if (rproto) allLTypes =
false;
7513 for (
unsigned i = 0, n = proto->
getNumParams(); i < n; ++i) {
7519 paramTy = Enum->getDecl()->getIntegerType();
7529 if (allLTypes)
return lhs;
7530 if (allRTypes)
return rhs;
7537 if (allLTypes)
return lhs;
7538 if (allRTypes)
return rhs;
7544 QualType other,
bool isBlockReturnType) {
7564 bool OfBlockPointer,
7565 bool Unqualified,
bool BlockReturnType) {
7583 if (LHSCan == RHSCan)
7588 Qualifiers RQuals = RHSCan.getLocalQualifiers();
7589 if (LQuals != RQuals) {
7604 assert((GC_L != GC_R) &&
"unequal qualifier sets had only equal elements");
7625 if (LHSClass == Type::FunctionProto) LHSClass = Type::FunctionNoProto;
7626 if (RHSClass == Type::FunctionProto) RHSClass = Type::FunctionNoProto;
7629 if (LHSClass == Type::VariableArray || LHSClass == Type::IncompleteArray)
7630 LHSClass = Type::ConstantArray;
7631 if (RHSClass == Type::VariableArray || RHSClass == Type::IncompleteArray)
7632 RHSClass = Type::ConstantArray;
7635 if (LHSClass == Type::ObjCInterface) LHSClass = Type::ObjCObject;
7636 if (RHSClass == Type::ObjCInterface) RHSClass = Type::ObjCObject;
7639 if (LHSClass == Type::ExtVector) LHSClass = Type::Vector;
7640 if (RHSClass == Type::ExtVector) RHSClass = Type::Vector;
7643 if (LHSClass != RHSClass) {
7653 if (OfBlockPointer && !BlockReturnType) {
7665 #define TYPE(Class, Base)
7666 #define ABSTRACT_TYPE(Class, Base)
7667 #define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) case Type::Class:
7668 #define NON_CANONICAL_TYPE(Class, Base) case Type::Class:
7669 #define DEPENDENT_TYPE(Class, Base) case Type::Class:
7670 #include "clang/AST/TypeNodes.def"
7671 llvm_unreachable(
"Non-canonical and dependent types shouldn't get here");
7674 case Type::LValueReference:
7675 case Type::RValueReference:
7676 case Type::MemberPointer:
7677 llvm_unreachable(
"C++ should never be in mergeTypes");
7679 case Type::ObjCInterface:
7680 case Type::IncompleteArray:
7681 case Type::VariableArray:
7682 case Type::FunctionProto:
7683 case Type::ExtVector:
7684 llvm_unreachable(
"Types are eliminated above");
7704 case Type::BlockPointer:
7740 case Type::ConstantArray:
7787 case Type::FunctionNoProto:
7804 case Type::ObjCObject: {
7815 case Type::ObjCObjectPointer: {
7816 if (OfBlockPointer) {
7850 llvm_unreachable(
"Invalid Type::Class!");
7864 for (
unsigned i = 0, n = FromFunctionType->
getNumParams(); i != n; ++i) {
7872 ObjCLayouts[CD] =
nullptr;
7882 if (LHSCan == RHSCan)
7884 if (RHSCan->isFunctionType()) {
7888 cast<FunctionType>(RHSCan.getTypePtr())->getReturnType();
7890 cast<FunctionType>(LHSCan.
getTypePtr())->getReturnType();
7893 if (ResReturnType.
isNull())
7895 if (ResReturnType == NewReturnType || ResReturnType == OldReturnType) {
7912 Qualifiers RQuals = RHSCan.getLocalQualifiers();
7913 if (LQuals != RQuals) {
7926 assert((GC_L != GC_R) &&
"unequal qualifier sets had only equal elements");
7942 if (ResQT == LHSBaseQT)
7944 if (ResQT == RHSBaseQT)
7956 T = ET->getDecl()->getIntegerType();
7969 VTy->getNumElements(), VTy->getVectorKind());
7973 T = ETy->getDecl()->getIntegerType();
7976 assert(BTy &&
"Unexpected signed integer type");
7978 case BuiltinType::Char_S:
7979 case BuiltinType::SChar:
7981 case BuiltinType::Short:
7983 case BuiltinType::Int:
7985 case BuiltinType::Long:
7987 case BuiltinType::LongLong:
7989 case BuiltinType::Int128:
7992 llvm_unreachable(
"Unexpected signed integer type");
8016 bool AllowTypeModifiers) {
8019 bool Signed =
false, Unsigned =
false;
8020 RequiresICE =
false;
8026 default: Done =
true; --Str;
break;
8031 assert(!Unsigned &&
"Can't use both 'S' and 'U' modifiers!");
8032 assert(!Signed &&
"Can't use 'S' modifier multiple times!");
8036 assert(!Signed &&
"Can't use both 'S' and 'U' modifiers!");
8037 assert(!Unsigned &&
"Can't use 'U' modifier multiple times!");
8041 assert(HowLong <= 2 &&
"Can't have LLLL modifier");
8046 assert(HowLong == 0 &&
"Can't use both 'L' and 'W' modifiers!");
8049 llvm_unreachable(
"Unexpected integer type");
8064 default: llvm_unreachable(
"Unknown builtin type letter!");
8066 assert(HowLong == 0 && !Signed && !Unsigned &&
8067 "Bad modifiers used with 'v'!");
8071 assert(HowLong == 0 && !Signed && !Unsigned &&
8072 "Bad modifiers used with 'h'!");
8076 assert(HowLong == 0 && !Signed && !Unsigned &&
8077 "Bad modifiers used with 'f'!");
8081 assert(HowLong < 2 && !Signed && !Unsigned &&
8082 "Bad modifiers used with 'd'!");
8089 assert(HowLong == 0 &&
"Bad modifiers used with 's'!");
8098 else if (HowLong == 2)
8100 else if (HowLong == 1)
8106 assert(HowLong == 0 &&
"Bad modifiers used with 'c'!");
8115 assert(HowLong == 0 && !Signed && !Unsigned &&
"Bad modifiers for 'b'!");
8119 assert(HowLong == 0 && !Signed && !Unsigned &&
"Bad modifiers for 'z'!");
8136 assert(!Type.
isNull() &&
"builtin va list type not initialized!");
8148 assert(!Type.
isNull() &&
"builtin va list type not initialized!");
8156 unsigned NumElements = strtoul(Str, &End, 10);
8157 assert(End != Str &&
"Missing vector size");
8161 RequiresICE,
false);
8162 assert(!RequiresICE &&
"Can't require vector ICE");
8172 unsigned NumElements = strtoul(Str, &End, 10);
8173 assert(End != Str &&
"Missing vector size");
8185 assert(!RequiresICE &&
"Can't require complex ICE");
8212 assert(HowLong == 0 && !Signed && !Unsigned &&
"Bad modifiers for 'K'!");
8226 Done = !AllowTypeModifiers;
8228 switch (
char c = *Str++) {
8229 default: Done =
true; --Str;
break;
8235 unsigned AddrSpace = strtoul(Str, &End, 10);
8236 if (End != Str && AddrSpace != 0) {
8260 "Integer constant 'I' type must be an integer");
8268 unsigned *IntegerConstantArgs)
const {
8273 bool RequiresICE =
false;
8280 assert(!RequiresICE &&
"Result of intrinsic cannot be required to be an ICE");
8282 while (TypeStr[0] && TypeStr[0] !=
'.') {
8289 if (RequiresICE && IntegerConstantArgs)
8290 *IntegerConstantArgs |= 1 << ArgTypes.size();
8296 ArgTypes.push_back(Ty);
8299 if (Id == Builtin::BI__GetExceptionInfo)
8302 assert((TypeStr[0] !=
'.' || TypeStr[1] == 0) &&
8303 "'.' should only occur at end of builtin type list!");
8308 bool Variadic = (TypeStr[0] ==
'.');
8311 if (ArgTypes.empty() && Variadic)
8355 !FD->
hasAttr<DLLExportAttr>()) ||
8356 FD->
hasAttr<GNUInlineAttr>()) {
8380 if (D->
hasAttr<DLLImportAttr>()) {
8383 }
else if (D->
hasAttr<DLLExportAttr>() || D->
hasAttr<CUDAGlobalAttr>()) {
8403 while (LexicalContext && !isa<FunctionDecl>(LexicalContext))
8409 StaticLocalLinkage =
8416 : StaticLocalLinkage;
8445 llvm_unreachable(
"Invalid Linkage!");
8454 if (
const VarDecl *VD = dyn_cast<VarDecl>(D)) {
8455 if (!VD->isFileVarDecl())
8460 if (VD->getDescribedVarTemplate() ||
8461 isa<VarTemplatePartialSpecializationDecl>(VD))
8463 }
else if (
const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
8467 }
else if (isa<OMPThreadPrivateDecl>(D))
8477 if (D->
hasAttr<WeakRefAttr>())
8484 if (
const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
8486 if (!FD->doesThisDeclarationHaveABody())
8487 return FD->doesDeclarationForceExternallyVisibleDefinition();
8490 if (FD->
hasAttr<ConstructorAttr>() || FD->
hasAttr<DestructorAttr>())
8496 if (
const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
8517 const VarDecl *VD = cast<VarDecl>(D);
8543 bool IsCXXMethod)
const {
8546 return ABI->getDefaultMethodCallConv(IsVariadic);
8555 return ABI->isNearlyEmpty(RD);
8559 if (!VTContext.get()) {
8565 return VTContext.get();
8582 llvm_unreachable(
"Unsupported ABI");
8588 return ASTRecordLayouts.getMemorySize() +
8589 llvm::capacity_in_bytes(ObjCLayouts) +
8590 llvm::capacity_in_bytes(KeyFunctions) +
8591 llvm::capacity_in_bytes(ObjCImpls) +
8592 llvm::capacity_in_bytes(BlockVarCopyInits) +
8593 llvm::capacity_in_bytes(DeclAttrs) +
8594 llvm::capacity_in_bytes(TemplateOrInstantiation) +
8595 llvm::capacity_in_bytes(InstantiatedFromUsingDecl) +
8596 llvm::capacity_in_bytes(InstantiatedFromUsingShadowDecl) +
8597 llvm::capacity_in_bytes(InstantiatedFromUnnamedFieldDecl) +
8598 llvm::capacity_in_bytes(OverriddenMethods) +
8599 llvm::capacity_in_bytes(Types) +
8600 llvm::capacity_in_bytes(VariableArrayTypes) +
8601 llvm::capacity_in_bytes(ClassScopeSpecializationPattern);
8609 unsigned Signed)
const {
8612 if (!QualTy && DestWidth == 128)
8633 llvm_unreachable(
"Unhandled TargetInfo::RealType value");
8638 MangleNumbers[ND] = Number;
8642 llvm::DenseMap<const NamedDecl *, unsigned>::const_iterator
I =
8643 MangleNumbers.find(ND);
8644 return I != MangleNumbers.end() ? I->second : 1;
8649 StaticLocalNumbers[VD] = Number;
8653 llvm::DenseMap<const VarDecl *, unsigned>::const_iterator
I =
8654 StaticLocalNumbers.find(VD);
8655 return I != StaticLocalNumbers.end() ? I->second : 1;
8660 assert(LangOpts.CPlusPlus);
8668 return ABI->createMangleNumberingContext();
8673 return ABI->getCopyConstructorForExceptionObject(
8679 return ABI->addCopyConstructorForExceptionObject(
8685 unsigned ParmIdx,
Expr *DAE) {
8686 ABI->addDefaultArgExprForConstructor(
8687 cast<CXXConstructorDecl>(CD->
getFirstDecl()), ParmIdx, DAE);
8692 return ABI->getDefaultArgExprForConstructor(
8693 cast<CXXConstructorDecl>(CD->
getFirstDecl()), ParmIdx);
8698 return ABI->addTypedefNameForUnnamedTagDecl(TD, DD);
8703 return ABI->getTypedefNameForUnnamedTagDecl(TD);
8708 return ABI->addDeclaratorForUnnamedTagDecl(TD, DD);
8712 return ABI->getDeclaratorForUnnamedTagDecl(TD);
8716 ParamIndices[D] = index;
8720 ParameterIndexTable::const_iterator
I = ParamIndices.find(D);
8721 assert(I != ParamIndices.end() &&
8722 "ParmIndices lacks entry set by ParmVarDecl");
8730 "don't need to cache the computed value for this temporary");
8732 APValue *&MTVI = MaterializedTemporaryValues[
E];
8738 return MaterializedTemporaryValues.lookup(E);
8743 if (!T.isOSDarwin())
8746 if (!(T.isiOS() && T.isOSVersionLT(7)) &&
8747 !(T.isMacOSX() && T.isOSVersionLT(10, 9)))
8756 return (Size != Align ||
toBits(sizeChars) > MaxInlineWidthInBits);
8762 ASTContext::ParentMapPointers::mapped_type U) {
8763 if (
const auto *D = U.dyn_cast<
const Decl *>())
8765 if (
const auto *S = U.dyn_cast<
const Stmt *>())
8772 template <
typename T>
8805 Visitor.TraverseDecl(&TU);
8806 return std::make_pair(Visitor.Parents, Visitor.OtherParents);
8814 : Parents(Parents), OtherParents(OtherParents) {}
8816 bool shouldVisitTemplateInstantiations()
const {
8819 bool shouldVisitImplicitCode()
const {
8823 template <
typename T,
typename MapNodeTy,
typename BaseTraverseFn,
8825 bool TraverseNode(T
Node, MapNodeTy MapNode,
8826 BaseTraverseFn BaseTraverse,
MapTy *Parents) {
8829 if (ParentStack.size() > 0) {
8840 auto &NodeOrVector = (*Parents)[MapNode];
8841 if (NodeOrVector.isNull()) {
8842 if (
const auto *D = ParentStack.back().get<Decl>())
8844 else if (
const auto *S = ParentStack.back().get<
Stmt>())
8850 if (!NodeOrVector.template is<ASTContext::ParentVector *>()) {
8852 1, getSingleDynTypedNodeFromParentMap(NodeOrVector));
8855 .
template dyn_cast<ast_type_traits::DynTypedNode *>())
8857 NodeOrVector = Vector;
8861 NodeOrVector.template get<ASTContext::ParentVector *>();
8867 std::find(Vector->begin(), Vector->end(),
8868 ParentStack.back()) != Vector->end();
8870 Vector->push_back(ParentStack.back());
8873 ParentStack.push_back(createDynTypedNode(Node));
8874 bool Result = BaseTraverse();
8875 ParentStack.pop_back();
8879 bool TraverseDecl(Decl *DeclNode) {
8880 return TraverseNode(DeclNode, DeclNode,
8881 [&] {
return VisitorBase::TraverseDecl(DeclNode); },
8885 bool TraverseStmt(
Stmt *StmtNode) {
8886 return TraverseNode(StmtNode, StmtNode,
8887 [&] {
return VisitorBase::TraverseStmt(StmtNode); },
8891 bool TraverseTypeLoc(
TypeLoc TypeLocNode) {
8892 return TraverseNode(
8894 [&] {
return VisitorBase::TraverseTypeLoc(TypeLocNode); },
8899 return TraverseNode(
8902 return VisitorBase::TraverseNestedNameSpecifierLoc(NNSLocNode);
8916 template <
typename NodeTy,
typename MapTy>
8919 auto I = Map.find(Node);
8920 if (
I == Map.end()) {
8923 if (
auto *V =
I->second.template dyn_cast<ASTContext::ParentVector *>()) {
8924 return llvm::makeArrayRef(*V);
8926 return getSingleDynTypedNodeFromParentMap(
I->second);
8931 if (!PointerParents) {
8935 PointerParents.reset(Maps.first);
8936 OtherParents.reset(Maps.second);
8947 if (MethodDecl->
hasAttr<UnavailableAttr>()
8948 || MethodDecl->
hasAttr<DeprecatedAttr>())
8962 IM != EM && IF != EF; ++IM, ++IF) {
static CanQual< Type > CreateUnsafe(QualType Other)
Builds a canonical type from a QualType.
bool isObjCSelType() const
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
static TypedefDecl * CreateAArch64ABIBuiltinVaListDecl(const ASTContext *Context)
Internal representation of canonical, dependent typeof(expr) types.
unsigned getNumElements() const
bool hasObjCGCAttr() const
unsigned getAddressSpace() const
Return the address space of this type.
MemberSpecializationInfo * getInstantiatedFromStaticDataMember(const VarDecl *Var)
If this variable is an instantiated static data member of a class template specialization, returns the templated static data member from which it was instantiated.
void setExternalSource(IntrusiveRefCntPtr< ExternalASTSource > Source)
Attach an external AST source to the AST context.
static NamespaceDecl * Create(ASTContext &C, DeclContext *DC, bool Inline, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, NamespaceDecl *PrevDecl)
static bool canAssignObjCObjectTypes(ASTContext &ctx, QualType lhs, QualType rhs)
Determine whether the first type is a subtype of the second.
param_const_iterator param_begin() const
TypedefDecl * getObjCInstanceTypeDecl()
Retrieve the typedef declaration corresponding to the Objective-C "instancetype" type.
int getFloatingTypeOrder(QualType LHS, QualType RHS) const
Compare the rank of the two specified floating point types, ignoring the domain of the type (i...
static void EncodeBitField(const ASTContext *Ctx, std::string &S, QualType T, const FieldDecl *FD)
void Profile(llvm::FoldingSetNodeID &ID) const
bool hasDefinition() const
Determine whether this class has been defined.
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType) const
bool isMacroArgExpansion(SourceLocation Loc, SourceLocation *StartLoc=nullptr) const
Tests whether the given source location represents a macro argument's expansion into the function-lik...
Defines the clang::ASTContext interface.
void setTemplateOrSpecializationInfo(VarDecl *Inst, TemplateOrSpecializationInfo TSI)
The generic AArch64 ABI is also a modified version of the Itanium ABI, but it has fewer divergences t...
Represents a type that was referred to using an elaborated type keyword, e.g., struct S...
ASTMutationListener * Listener
Qualifiers getLocalQualifiers() const
Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifie...
const Type * Ty
The locally-unqualified type.
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
static bool isTypeTypedefedAsBOOL(QualType T)
static unsigned getFullDataSizeForType(QualType Ty)
Returns the size of type source info data block for the given type.
RealType getRealTypeByWidth(unsigned BitWidth) const
Return floating point type with specified width.
void setImplicit(bool I=true)
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl, TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
Note that the static data member Inst is an instantiation of the static data member template Tmpl of ...
llvm::PointerUnion< VarTemplateDecl *, MemberSpecializationInfo * > TemplateOrSpecializationInfo
A type synonym for the TemplateOrInstantiation mapping.
AttrVec & getDeclAttrs(const Decl *D)
Retrieve the attributes for the given declaration.
unsigned getSimdDefaultAlign() const
Return default simd alignment for the given target.
QualType getPromotedIntegerType(QualType PromotableType) const
Return the type that PromotableType will promote to: C99 6.3.1.1p2, assuming that PromotableType is a...
bool isNullPtrType() const
CXXABI * CreateMicrosoftCXXABI(ASTContext &Ctx)
protocol_range protocols() const
ObjCPropertyImplDecl * getObjCPropertyImplDeclForPropertyDecl(const ObjCPropertyDecl *PD, const Decl *Container) const
no exception specification
llvm::iterator_range< pack_iterator > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
Holds information about both target-independent and target-specific builtins, allowing easy queries b...
PointerType - C99 6.7.5.1 - Pointer Declarators.
CanQualType LongDoubleComplexTy
GVALinkage GetGVALinkageForFunction(const FunctionDecl *FD) const
QualType mergeFunctionTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
APValue * evaluateValue() const
Attempt to evaluate the value of the initializer attached to this declaration, and produce notes expl...
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
TemplateSpecializationKind getTemplateSpecializationKind() const
If this variable is an instantiation of a variable template or a static data member of a class templa...
A (possibly-)qualified type.
The iOS 64-bit ABI is follows ARM's published 64-bit ABI more closely, but we don't guarantee to foll...
unsigned overridden_methods_size(const CXXMethodDecl *Method) const
TemplateName getReplacement() const
void setHidden(bool Hide)
Set whether this declaration is hidden from name lookup.
QualType areCommonBaseCompatible(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
TypedefDecl * getUInt128Decl() const
Retrieve the declaration for the 128-bit unsigned integer type.
SourceRange getBracketsRange() const
bool isCanonicalUnqualified() const
Determines if this type would be canonical if it had no further qualification.
bool isSpecificBuiltinType(unsigned K) const
Test for a particular builtin type.
CanQualType OCLImage1dBufferTy
void getObjCEncodingForPropertyType(QualType T, std::string &S) const
Emit the Objective-C property type encoding for the given type T into S.
bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto, ObjCProtocolDecl *rProto) const
ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the inheritance hierarchy of 'rProto...
NestedNameSpecifier * getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const
Retrieves the "canonical" nested name specifier for a given nested name specifier.
ExtInfo withCallingConv(CallingConv cc) const
CharUnits getDeclAlign(const Decl *D, bool ForAlignof=false) const
Return a conservative estimate of the alignment of the specified decl D.
bool isBitField() const
Determines whether this field is a bitfield.
ASTContext(LangOptions &LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins)
DestructionKind isDestructedType() const
Returns a nonzero value if objects of this type require non-trivial work to clean up after...
bool isMemberPointerType() const
QualType getAdjustedType(QualType Orig, QualType New) const
Return the uniqued reference to a type adjusted from the original type to a new type.
void getOverriddenMethods(SmallVectorImpl< const ObjCMethodDecl * > &Overridden) const
Return overridden methods for the given Method.
static unsigned NumImplicitMoveAssignmentOperatorsDeclared
The number of implicitly-declared move assignment operators for which declarations were built...
QualType getComplexType(QualType T) const
Return the uniqued reference to the type for a complex number with the specified element type...
RecordDecl * buildImplicitRecord(StringRef Name, RecordDecl::TagKind TK=TTK_Struct) const
Create a new implicit TU-level CXXRecordDecl or RecordDecl declaration.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT, std::string &S) const
Put the string version of the type qualifiers QT into S.
static MicrosoftMangleContext * create(ASTContext &Context, DiagnosticsEngine &Diags)
unsigned getDefaultAlignForAttributeAligned() const
Return the default alignment for attribute((aligned)) on this target, to be used if no alignment valu...
unsigned getFastQualifiers() const
bool isNoReturn(unsigned ID) const
Return true if we know this builtin never returns.
CharUnits getAlignment() const
getAlignment - Get the record alignment in characters.
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
CanQual< T > getUnqualifiedType() const
Retrieve the unqualified form of this type.
static unsigned NumImplicitDefaultConstructors
The number of implicitly-declared default constructors.
CanQualType OCLImage2dMSAADepthTy
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
void setLAngleLoc(SourceLocation Loc)
virtual void DeducedReturnType(const FunctionDecl *FD, QualType ReturnType)
A function's return type has been deduced.
FunctionType - C99 6.7.5.3 - Function Declarators.
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type...
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
bool CommentsLoaded
True if comments are already loaded from ExternalASTSource.
unsigned getChar16Width() const
getChar16Width/Align - Return the size of 'char16_t' for this target, in bits.
void Profile(llvm::FoldingSetNodeID &ID)
__builtin_va_list as defined by the PNaCl ABI: http://www.chromium.org/nativeclient/pnacl/bitcode-abi...
unsigned getIntWidth(QualType T) const
OverloadedOperatorKind getOperator() const
Return the overloaded operator to which this template name refers.
QualType getIntTypeForBitwidth(unsigned DestWidth, unsigned Signed) const
getIntTypeForBitwidth - sets integer QualTy according to specified details: bitwidth, signed/unsigned.
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
Defines the SourceManager interface.
void Profile(llvm::FoldingSetNodeID &ID)
static const Builtin::Info BuiltinInfo[]
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
static unsigned NumImplicitMoveAssignmentOperators
The number of implicitly-declared move assignment operators.
Qualifiers::GC getObjCGCAttr() const
Returns gc attribute of this type.
Represents a qualified type name for which the type name is dependent.
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
static TypedefDecl * CreateSystemZBuiltinVaListDecl(const ASTContext *Context)
The template argument is an expression, and we've not resolved it to one of the other forms yet...
void Profile(llvm::FoldingSetNodeID &ID)
QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType, UnaryTransformType::UTTKind UKind) const
Unary type transforms.
CanQualType FloatComplexTy
static TemplateTemplateParmDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation L, unsigned D, unsigned P, bool ParameterPack, IdentifierInfo *Id, TemplateParameterList *Params)
RawCommentList Comments
All comments in this translation unit.
static int CmpProtocolNames(ObjCProtocolDecl *const *LHS, ObjCProtocolDecl *const *RHS)
CmpProtocolNames - Comparison predicate for sorting protocols alphabetically.
bool isRecordType() const
QualType getUnderlyingType() const
const DeclContext * getParentFunctionOrMethod() const
If this decl is defined inside a function/method/block it returns the corresponding DeclContext...
Decl - This represents one declaration (or definition), e.g.
static QualType getFunctionTypeWithExceptionSpec(ASTContext &Context, QualType Orig, const FunctionProtoType::ExceptionSpecInfo &ESI)
Get a function type and produce the equivalent function type with the specified exception specificati...
EnumDecl * getPreviousDecl()
CanQualType ObjCBuiltinSelTy
IntType getSizeType() const
void addDefaultArgExprForConstructor(const CXXConstructorDecl *CD, unsigned ParmIdx, Expr *DAE)
QualType getVolatileType(QualType T) const
Return the uniqued reference to the type for a volatile qualified type.
std::string getObjCEncodingForBlock(const BlockExpr *blockExpr) const
Return the encoded type for this block declaration.
Defines the C++ template declaration subclasses.
unsigned getChar16Align() const
bool isVoidPointerType() const
Represents a C++11 auto or C++14 decltype(auto) type.
bool isObjCQualifiedId() const
bool hasFlexibleArrayMember() const
bool isAlignmentRequired(const Type *T) const
Determine if the alignment the type has was required using an alignment attribute.
A class providing a concrete implementation of ObjCObjectType, so as to not increase the footprint of...
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
unsigned getLargeArrayAlign() const
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type...
CanQualType ARCUnbridgedCastTy
TemplateSpecializationType(TemplateName T, const TemplateArgument *Args, unsigned NumArgs, QualType Canon, QualType Aliased)
QualType getPointeeType() const
The base class of the type hierarchy.
void setParameterIndex(const ParmVarDecl *D, unsigned index)
Used by ParmVarDecl to store on the side the index of the parameter when it exceeds the size of the n...
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
The parameter is covariant, e.g., X<T> is a subtype of X<U> when the type parameter is covariant and ...
DependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, unsigned NumArgs, const TemplateArgument *Args, QualType Canon)
QualType getRecordType(const RecordDecl *Decl) const
std::unique_ptr< llvm::MemoryBuffer > Buffer
Represents an array type, per C99 6.7.5.2 - Array Declarators.
const Expr * getInit() const
TemplateTemplateParmDecl * getParameterPack() const
Retrieve the template template parameter pack being substituted.
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
void Profile(llvm::FoldingSetNodeID &ID)
const ObjCObjectType * getObjectType() const
Gets the type pointed to by this ObjC pointer.
NamespaceDecl - Represent a C++ namespace.
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
CharUnits getVBaseClassOffset(const CXXRecordDecl *VBase) const
getVBaseClassOffset - Get the offset, in chars, for the given base class.
static void SortAndUniqueProtocols(SmallVectorImpl< ObjCProtocolDecl * > &Protocols)
void Profile(llvm::FoldingSetNodeID &ID)
virtual void completeDefinition()
completeDefinition - Notes that the definition of this type is now complete.
ObjCDeclQualifier getObjCDeclQualifier() const
bool isBooleanType() const
A container of type source information.
llvm::DenseMap< Stmt *, Stmt * > MapTy
FieldDecl * getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field)
__builtin_va_list as defined by the x86-64 ABI: http://www.x86-64.org/documentation/abi.pdf
bool isBlockPointerType() const
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
Represents a C++ constructor within a class.
bool HasSideEffects(const ASTContext &Ctx, bool IncludePossibleEffects=true) const
HasSideEffects - This routine returns true for all those expressions which have any effect other than...
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
bool isSpelledAsLValue() const
QualType getPipeType(QualType T) const
Return pipe type for the specified type.
A template template parameter that has been substituted for some other template name.
unsigned getBoolAlign() const
Return the alignment of '_Bool' and C++ 'bool' for this target.
NamedDecl *const * const_iterator
Iterates through the template parameters in this list.
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
const llvm::APInt & getSize() const
void setInstantiatedFromUsingDecl(UsingDecl *Inst, NamedDecl *Pattern)
Remember that the using decl Inst is an instantiation of the using decl Pattern of a class template...
void * getAsOpaquePtr() const
void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context)
static void addRedeclaredMethods(const ObjCMethodDecl *ObjCMethod, SmallVectorImpl< const NamedDecl * > &Redeclared)
An identifier, stored as an IdentifierInfo*.
const ASTRecordLayout & getASTObjCImplementationLayout(const ObjCImplementationDecl *D) const
Get or compute information about the layout of the specified Objective-C implementation.
static const Type * getIntegerTypeForEnum(const EnumType *ET)
QualType getBlockPointerType(QualType T) const
Return the uniqued reference to the type for a block of the specified type.
QualType getVariableArrayDecayedType(QualType Ty) const
Returns a vla type where known sizes are replaced with [*].
unsigned getChar32Width() const
getChar32Width/Align - Return the size of 'char32_t' for this target, in bits.
const RawComment * getRaw() const LLVM_READONLY
VarDecl - An instance of this class is created to represent a variable declaration or definition...
bool isFileVarDecl() const
isFileVarDecl - Returns true for file scoped variable declaration.
QualType getFloatingTypeOfSizeWithinDomain(QualType typeSize, QualType typeDomain) const
Return a real floating point or a complex type (based on typeDomain/typeSize).
static NestedNameSpecifier * Create(const ASTContext &Context, NestedNameSpecifier *Prefix, IdentifierInfo *II)
Builds a specifier combining a prefix and an identifier.
TypedefDecl * getBuiltinVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_va_list type...
void removeObjCLifetime()
RecordDecl * getPreviousDecl()
ObjCLifetime getObjCLifetime() const
comments::FullComment * getLocalCommentForDeclUncached(const Decl *D) const
Return parsed documentation comment attached to a given declaration.
void setClassScopeSpecializationPattern(FunctionDecl *FD, FunctionDecl *Pattern)
virtual void CompleteRedeclChain(const Decl *D)
Gives the external AST source an opportunity to complete the redeclaration chain for a declaration...
MangleContext * createMangleContext()
QualType isPromotableBitField(Expr *E) const
Whether this is a promotable bitfield reference according to C99 6.3.1.1p2, bullet 2 (and GCC extensi...
Represents an empty template argument, e.g., one that has not been deduced.
Extra information about a function prototype.
Declaration context for names declared as extern "C" in C++.
__builtin_va_list as defind by the AArch64 ABI http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055a/IHI0055A_aapcs64.pdf
QualType getucontext_tType() const
Retrieve the C ucontext_t type.
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
ObjCMethodDecl - Represents an instance or class method declaration.
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
ObjCImplementationDecl * getObjCImplementation(ObjCInterfaceDecl *D)
Get the implementation of the ObjCInterfaceDecl D, or NULL if none exists.
A namespace, stored as a NamespaceDecl*.
bool ClassImplementsProtocol(ObjCProtocolDecl *lProto, bool lookupCategory, bool RHSIsQualifiedID=false)
ClassImplementsProtocol - Checks that 'lProto' protocol has been implemented in IDecl class...
bool hasAnyConsumedParams() const
void addAddressSpace(unsigned space)
void setRaw(const RawComment *RC)
unsigned getLongDoubleWidth() const
getLongDoubleWidth/Align/Format - Return the size/align/format of 'long double'.
Stores a list of template parameters for a TemplateDecl and its derived classes.
Describes how types, statements, expressions, and declarations should be printed. ...
Qualifiers getIndexTypeQualifiers() const
unsigned param_size() const
bool FunctionTypesMatchOnNSConsumedAttrs(const FunctionProtoType *FromFunctionType, const FunctionProtoType *ToFunctionType)
bool isSpecialized() const
Determine whether this object type is "specialized", meaning that it has type arguments.
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
TemplateTemplateParmDecl * getParameter() const
ParmVarDecl - Represents a parameter to a function.
bool isObjCRetainableType() const
Represents the result of substituting a type for a template type parameter.
void Profile(llvm::FoldingSetNodeID &ID)
NullPointerConstantKind isNullPointerConstant(ASTContext &Ctx, NullPointerConstantValueDependence NPC) const
isNullPointerConstant - C99 6.3.2.3p3 - Test if this reduces down to a Null pointer constant...
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
Defines the clang::Expr interface and subclasses for C++ expressions.
const Type * getUnqualifiedDesugaredType() const
Return the specified type with any "sugar" removed from the type, removing any typedefs, typeofs, etc., as well as any qualifiers.
TemplateArgument getCanonicalTemplateArgument(const TemplateArgument &Arg) const
Retrieve the "canonical" template argument.
QualType getFunctionNoProtoType(QualType ResultTy, const FunctionType::ExtInfo &Info) const
Return a K&R style C function type like 'int()'.
static TypedefDecl * CreatePNaClABIBuiltinVaListDecl(const ASTContext *Context)
unsigned getFloatAlign() const
Represents the builtin template declaration which is used to implement __make_integer_seq.
The collection of all-type qualifiers we support.
FieldDecl * getSourceBitField()
If this expression refers to a bit-field, retrieve the declaration of that bit-field.
QualType withConst() const
Retrieves a version of this type with const applied.
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
QualType getArrayDecayedType(QualType T) const
Return the properly qualified result of decaying the specified array type to a pointer.
void Profile(llvm::FoldingSetNodeID &ID)
unsigned getFloatWidth() const
getFloatWidth/Align/Format - Return the size/align/format of 'float'.
unsigned getStaticLocalNumber(const VarDecl *VD) const
unsigned getLargeArrayMinWidth() const
Base wrapper for a particular "section" of type source info.
unsigned getNumParams() const
RecordDecl - Represents a struct/union/class.
ObjCInterfaceDecl * getObjCProtocolDecl() const
Retrieve the Objective-C class declaration corresponding to the predefined Protocol class...
CharUnits getOffsetOfBaseWithVBPtr(const CXXRecordDecl *RD) const
Loading virtual member pointers using the virtual inheritance model always results in an adjustment u...
unsigned getMaxAlignment() const
getMaxAlignment - return the maximum alignment specified by attributes on this decl, 0 if there are none.
bool isInlineDefinitionExternallyVisible() const
For an inline function definition in C, or for a gnu_inline function in C++, determine whether the de...
param_const_iterator sel_param_end() const
FunctionType::ExtInfo ExtInfo
CanQualType getIntMaxType() const
Return the unique type for "intmax_t" (C99 7.18.1.5), defined in <stdint.h>.
One of these records is kept for each identifier that is lexed.
Represents a class template specialization, which refers to a class template with a given set of temp...
unsigned getIndexTypeCVRQualifiers() const
bool isEmpty() const
Determine whether this is an empty class in the sense of (C++11 [meta.unary.prop]).
This table allows us to fully hide how we implement multi-keyword caching.
OverloadedTemplateStorage * getAsOverloadedTemplate() const
Retrieve the underlying, overloaded function template.
EnumDecl * getInstantiatedFromMemberEnum() const
Returns the enumeration (declared within the template) from which this enumeration type was instantia...
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
CanQualType OCLImage2dArrayMSAADepthTy
void getOverriddenMethods(const NamedDecl *Method, SmallVectorImpl< const NamedDecl * > &Overridden) const
Return C++ or ObjC overridden methods for the given Method.
Represents a class type in Objective C.
static RecordDecl * Create(const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, RecordDecl *PrevDecl=nullptr)
void setManglingNumber(const NamedDecl *ND, unsigned Number)
Expr * getSizeExpr() const
StringRef getBufferData(FileID FID, bool *Invalid=nullptr) const
Return a StringRef to the source buffer data for the specified FileID.
QualType getUnsignedWCharType() const
Return the type of "unsigned wchar_t".
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
CXXRecordDecl * getPreviousDecl()
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
static unsigned NumImplicitMoveConstructorsDeclared
The number of implicitly-declared move constructors for which declarations were built.
A C++ nested-name-specifier augmented with source location information.
CanQualType OCLImage2dArrayTy
Represents a dependent template name that cannot be resolved prior to template instantiation.
unsigned getNumArgs() const
static int compare(DeclarationName LHS, DeclarationName RHS)
ArrayRef< QualType > getParamTypes() const
bool isIdentifier() const
Determine whether this template name refers to an identifier.
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl)
Missing a type from <ucontext.h>
The parameter is contravariant, e.g., X<T> is a subtype of X<U> when the type parameter is covariant ...
QualType getAddrSpaceQualType(QualType T, unsigned AddressSpace) const
Return the uniqued reference to the type for an address space qualified type with the specified type ...
QualType getReturnType() const
The generic Mips ABI is a modified version of the Itanium ABI.
QualType getExtVectorType(QualType VectorType, unsigned NumElts) const
Return the unique reference to an extended vector type of the specified element type and size...
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
unsigned getDoubleWidth() const
getDoubleWidth/Align/Format - Return the size/align/format of 'double'.
bool isAnyPointerType() const
DynTypedNodeList getParents(const NodeT &Node)
Returns the parents of the given node.
void DeepCollectObjCIvars(const ObjCInterfaceDecl *OI, bool leafClass, SmallVectorImpl< const ObjCIvarDecl * > &Ivars) const
DeepCollectObjCIvars - This routine first collects all declared, but not synthesized, ivars in super class and then collects all ivars, including those synthesized for current class.
void Profile(llvm::FoldingSetNodeID &ID)
QualType getBlockDescriptorType() const
Gets the struct used to keep track of the descriptor for pointer to blocks.
void startDefinition()
Starts the definition of this tag declaration.
CXXMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
unsigned getCVRQualifiers() const
unsigned size() const
Retrieve the number of template arguments in this template argument list.
The iterator over UnresolvedSets.
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
Represents the result of substituting a set of types for a template type parameter pack...
void getObjCEncodingForMethodParameter(Decl::ObjCDeclQualifier QT, QualType T, std::string &S, bool Extended) const
getObjCEncodingForMethodParameter - Return the encoded type for a single method parameter or return t...
Container for either a single DynTypedNode or for an ArrayRef to DynTypedNode.
void setStaticLocalNumber(const VarDecl *VD, unsigned Number)
const RecordType * getAsUnionType() const
NOTE: getAs*ArrayType are methods on ASTContext.
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
QualType getTypeOfType(QualType t) const
getTypeOfType - Unlike many "get<Type>" functions, we don't unique TypeOfType nodes...
unsigned getTargetDefaultAlignForAttributeAligned(void) const
Return the default alignment for attribute((aligned)) on this target, to be used if no alignment valu...
static TypedefDecl * CreatePowerABIBuiltinVaListDecl(const ASTContext *Context)
CanQualType OCLReserveIDTy
unsigned getRegParm() const
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
void Profile(llvm::FoldingSetNodeID &ID)
static TypedefDecl * CreateCharPtrNamedVaListDecl(const ASTContext *Context, StringRef Name)
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
Describes a module or submodule.
bool ObjCObjectAdoptsQTypeProtocols(QualType QT, ObjCInterfaceDecl *Decl)
ObjCObjectAdoptsQTypeProtocols - Checks that protocols in IC's protocol list adopt all protocols in Q...
bool isNearlyEmpty(const CXXRecordDecl *RD) const
virtual CallingConv getDefaultCallingConv(CallingConvMethodType MT) const
Gets the default calling convention for the given target and declaration context. ...
unsigned CountNonClassIvars(const ObjCInterfaceDecl *OI) const
const char * getTypeString(unsigned ID) const
Get the type descriptor string for the specified builtin.
QualType mergeObjCGCQualifiers(QualType, QualType)
mergeObjCGCQualifiers - This routine merges ObjC's GC attribute of 'LHS' and 'RHS' attributes and ret...
static bool isTypeSigned(IntType T)
Returns true if the type is signed; false otherwise.
Represents a C++ using-declaration.
An rvalue reference type, per C++11 [dcl.ref].
static void getIntersectionOfProtocols(ASTContext &Context, const ObjCInterfaceDecl *CommonBase, const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT, SmallVectorImpl< ObjCProtocolDecl * > &IntersectionSet)
getIntersectionOfProtocols - This routine finds the intersection of set of protocols inherited from t...
QualType getParenType(QualType NamedType) const
A qualified template name, where the qualification is kept to describe the source code as written...
const TargetInfo & getTargetInfo() const
static ObjCInterfaceDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id, ObjCTypeParamList *typeParamList, ObjCInterfaceDecl *PrevDecl, SourceLocation ClassLoc=SourceLocation(), bool isInternal=false)
bool UnwrapSimilarPointerTypes(QualType &T1, QualType &T2)
UnwrapSimilarPointerTypes - If T1 and T2 are pointer types that may be similar (C++ 4...
static int compareObjCProtocolsByName(ObjCProtocolDecl *const *lhs, ObjCProtocolDecl *const *rhs)
Comparison routine for Objective-C protocols to be used with llvm::array_pod_sort.
QualType getOriginalType() const
ObjCContainerDecl - Represents a container for method declarations.
const LangOptions & getLangOpts() const
static ItaniumMangleContext * create(ASTContext &Context, DiagnosticsEngine &Diags)
void addObjCGCAttr(GC type)
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
static ExternCContextDecl * Create(const ASTContext &C, TranslationUnitDecl *TU)
CharUnits - This is an opaque type for sizes expressed in character units.
A convenient class for passing around template argument information.
const llvm::fltSemantics & getDoubleFormat() const
The Microsoft ABI is the ABI used by Microsoft Visual Studio (and compatible compilers).
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
QualType getReturnType() const
unsigned getLongDoubleAlign() const
QualType GetBuiltinType(unsigned ID, GetBuiltinTypeError &Error, unsigned *IntegerConstantArgs=nullptr) const
Return the type for the specified builtin.
Qualifiers::ObjCLifetime getInnerObjCOwnership(QualType T) const
Recurses in pointer/array types until it finds an Objective-C retainable type and returns its ownersh...
IntType getIntMaxType() const
field_range fields() const
SplitQualType getSplitUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
bool hasPointerIdentity() const
Check if the given ASTNodeKind identifies a type that offers pointer identity.
TemplateArgument getArgumentPack() const
Retrieve the template template argument pack with which this parameter was substituted.
TemplateName getSubstTemplateTemplateParm(TemplateTemplateParmDecl *param, TemplateName replacement) const
Concrete class used by the front-end to report problems and issues.
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
Represents a typeof (or typeof) expression (a GCC extension).
static TemplateTypeParmDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation KeyLoc, SourceLocation NameLoc, unsigned D, unsigned P, IdentifierInfo *Id, bool Typename, bool ParameterPack)
TypeDecl - Represents a declaration of a type.
bool getByrefLifetime(QualType Ty, Qualifiers::ObjCLifetime &Lifetime, bool &HasByrefExtendedLayout) const
Returns true, if given type has a known lifetime.
unsigned getOpenMPDefaultSimdAlign(QualType T) const
Get default simd alignment of the specified complete type in bits.
CanQualType PseudoObjectTy
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
QualType getIntPtrType() const
Return a type compatible with "intptr_t" (C99 7.18.1.4), as defined by the target.
RecordDecl * getDecl() const
ObjCInterfaceDecl * getInterface() const
Gets the interface declaration for this object type, if the base type really is an interface...
Decl * getVaListTagDecl() const
Retrieve the C type declaration corresponding to the predefined __va_list_tag type used to help defin...
TypedefDecl * getObjCIdDecl() const
Retrieve the typedef corresponding to the predefined id type in Objective-C.
Selector getSetterName() const
bool isUnsignedIntegerType() const
Return true if this is an integer type that is unsigned, according to C99 6.2.5p6 [which returns true...
void Profile(llvm::FoldingSetNodeID &ID)
std::string getNameAsString() const
getNameAsString - Get a human-readable name for the declaration, even if it is one of the special kin...
Expr * IgnoreParenCasts() LLVM_READONLY
IgnoreParenCasts - Ignore parentheses and casts.
static bool isAddrSpaceMapManglingEnabled(const TargetInfo &TI, const LangOptions &LangOpts)
static bool hasAnyPackExpansions(const TemplateArgument *Args, unsigned NumArgs)
unsigned getDoubleAlign() const
const ASTRecordLayout & getASTRecordLayout(const RecordDecl *D) const
Get or compute information about the layout of the specified record (struct/union/class) D...
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
QualType getSignatureParameterType(QualType T) const
Retrieve the parameter type as adjusted for use in the signature of a function, decaying array and fu...
uint64_t getFieldOffset(unsigned FieldNo) const
getFieldOffset - Get the offset of the given field index, in bits.
QualType getsigjmp_bufType() const
Retrieve the C sigjmp_buf type.
void eraseDeclAttrs(const Decl *D)
Erase the attributes corresponding to the given declaration.
bool isDependent() const
Whether this nested name specifier refers to a dependent type or not.
SourceLocation getRAngleLoc() const
SplitQualType split() const
TypeClass getTypeClass() const
Represents an Objective-C protocol declaration.
static unsigned NumImplicitDefaultConstructorsDeclared
The number of implicitly-declared default constructors for which declarations were built...
bool isIncompleteType(NamedDecl **Def=nullptr) const
Types are partitioned into 3 broad categories (C99 6.2.5p1): object types, function types...
QualType mergeTransparentUnionType(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
mergeTransparentUnionType - if T is a transparent union type and a member of T is compatible with Sub...
bool isStaticLocal() const
isStaticLocal - Returns true if a variable with function scope is a static local variable.
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
CXXABI * CreateItaniumCXXABI(ASTContext &Ctx)
Creates an instance of a C++ ABI class.
SmallVector< BoundNodes, 1 > match(MatcherT Matcher, const NodeT &Node, ASTContext &Context)
Returns the results of matching Matcher on Node.
A class that does preorder depth-first traversal on the entire Clang AST and visits each node...
Represents an ObjC class declaration.
propimpl_range property_impls() const
static void PrintTemplateArgumentList(raw_ostream &OS, const TemplateArgument *Args, unsigned NumArgs, const PrintingPolicy &Policy, bool SkipBrackets=false)
Print a template argument list, including the '<' and '>' enclosing the template arguments...
detail::InMemoryDirectory::const_iterator I
PropertyAttributeKind getPropertyAttributes() const
The iOS ABI is a partial implementation of the ARM ABI.
TypedefDecl * getObjCClassDecl() const
Retrieve the typedef declaration corresponding to the predefined Objective-C 'Class' type...
QualType getCanonicalTypeInternal() const
unsigned getWCharWidth() const
getWCharWidth/Align - Return the size of 'wchar_t' for this target, in bits.
QualType getInjectedClassNameType(CXXRecordDecl *Decl, QualType TST) const
getInjectedClassNameType - Return the unique reference to the injected class name type for the specif...
unsigned getHalfAlign() const
std::pair< CharUnits, CharUnits > getTypeInfoInChars(const Type *T) const
IntrusiveRefCntPtr< ExternalASTSource > ExternalSource
CanQualType UnsignedCharTy
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type...
static char getObjCEncodingForPrimitiveKind(const ASTContext *C, BuiltinType::Kind kind)
unsigned getHalfWidth() const
getHalfWidth/Align/Format - Return the size/align/format of 'half'.
Represents an extended vector type where either the type or size is dependent.
This object can be modified without requiring retains or releases.
DiagnosticsEngine & getDiagnostics() const
unsigned getPreferredTypeAlign(const Type *T) const
Return the "preferred" alignment of the specified type T for the current target, in bits...
bool isPositive() const
isPositive - Test whether the quantity is greater than zero.
const ArrayType * getAsArrayTypeUnsafe() const
A variant of getAs<> for array types which silently discards qualifiers from the outermost type...
QualType getAutoRRefDeductType() const
C++11 deduction pattern for 'auto &&' type.
EnumDecl * getDecl() const
QualType getTemplateSpecializationType(TemplateName T, const TemplateArgument *Args, unsigned NumArgs, QualType Canon=QualType()) const
void Profile(llvm::FoldingSetNodeID &ID)
static bool isCanonicalResultType(QualType T)
Determine whether T is canonical as the result type of a function.
Represents a K&R-style 'int foo()' function, which has no information available about its arguments...
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
void adjustDeducedFunctionResultType(FunctionDecl *FD, QualType ResultType)
Change the result type of a function type once it is deduced.
void Profile(llvm::FoldingSetNodeID &ID)
QualType getValueType() const
Gets the type contained by this atomic type, i.e.
Optional< unsigned > getNumTemplateExpansions() const
Retrieve the number of expansions that a template template argument expansion will produce...
const ParmVarDecl *const * param_const_iterator
ExtInfo getExtInfo() const
void Profile(llvm::FoldingSetNodeID &ID)
QualType getObjCObjectType(QualType Base, ObjCProtocolDecl *const *Protocols, unsigned NumProtocols) const
Legacy interface: cannot provide type arguments or __kindof.
llvm::PointerUnion< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the class template or class template partial specialization which was specialized by this...
bool AtomicUsesUnsupportedLibcall(const AtomicExpr *E) const
QualType getParamType(unsigned i) const
Represents a prototype with parameter type info, e.g.
The generic ARM ABI is a modified version of the Itanium ABI proposed by ARM for use on ARM-based pla...
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
static unsigned NumImplicitCopyConstructors
The number of implicitly-declared copy constructors.
Represents a ValueDecl that came out of a declarator.
DeclarationNameTable DeclarationNames
A dependent template name that has not been resolved to a template (or set of templates).
void getObjCEncodingForType(QualType T, std::string &S, const FieldDecl *Field=nullptr, QualType *NotEncodedT=nullptr) const
Emit the Objective-CC type encoding for the given type T into S.
ArraySizeModifier
Capture whether this is a normal array (e.g.
overridden_cxx_method_iterator overridden_methods_end(const CXXMethodDecl *Method) const
ObjCDeclQualifier getObjCDeclQualifier() const
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
void setCFConstantStringType(QualType T)
QualType getAtomicType(QualType T) const
Return the uniqued reference to the atomic type for the specified type.
ID
Defines the set of possible language-specific address spaces.
void initialize(ASTContext &Context, SourceLocation Loc) const
Initializes this to state that every location in this type is the given location. ...
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
unsigned getCharAlign() const
QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl...
void Profile(llvm::FoldingSetNodeID &ID)
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
bool ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl, const ObjCMethodDecl *MethodImp)
std::pair< CharUnits, CharUnits > getTypeInfoDataSizeInChars(QualType T) const
bool isRealFloatingType() const
Floating point categories.
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
typedef void* __builtin_va_list;
Exposes information about the current target.
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, const TemplateArgumentListInfo &Args) const
bool isKindOfType() const
Whether this is a "__kindof" type.
Represents an array type in C++ whose size is a value-dependent expression.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
bool isMSStaticDataMemberInlineDefinition(const VarDecl *VD) const
Returns true if this is an inline-initialized static data member which is treated as a definition for...
CommentOptions CommentOpts
Options for parsing comments.
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
DeclContext * getLexicalParent()
getLexicalParent - Returns the containing lexical DeclContext.
bool isMicrosoft() const
Is this ABI an MSVC-compatible ABI?
QualType getAutoDeductType() const
C++11 deduction pattern for 'auto' type.
QualType getSuperClassType() const
Retrieve the type of the superclass of this object type.
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
QualType getPointeeType() const
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
CanQualType getCanonicalFunctionResultType(QualType ResultType) const
Adjust the given function result type.
QualType getBlockDescriptorExtendedType() const
Gets the struct used to keep track of the extended descriptor for pointer to blocks.
void setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst, UsingShadowDecl *Pattern)
The "typename" keyword precedes the qualified type name, e.g., typename T::type.
void addTypedefNameForUnnamedTagDecl(TagDecl *TD, TypedefNameDecl *TND)
static bool compare(const PathDiagnostic &X, const PathDiagnostic &Y)
Qualifiers getQualifiers() const
Retrieve all qualifiers.
void ResetObjCLayout(const ObjCContainerDecl *CD)
IntType getIntPtrType() const
MatchFinder::MatchCallback * Callback
static std::pair< CharUnits, CharUnits > getConstantArrayInfoInChars(const ASTContext &Context, const ConstantArrayType *CAT)
getConstantArrayInfoInChars - Performing the computation in CharUnits instead of in bits prevents ove...
bool isObjCClassType() const
SetterKind getSetterKind() const
getSetterKind - Return the method used for doing assignment in the property setter.
Declaration of a template type parameter.
Internal representation of canonical, dependent decltype(expr) types.
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
ObjCIvarDecl * getPropertyIvarDecl() const
Implements an efficient mapping from strings to IdentifierInfo nodes.
void setObjCMethodRedeclaration(const ObjCMethodDecl *MD, const ObjCMethodDecl *Redecl)
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
TemplateName getOverloadedTemplateName(UnresolvedSetIterator Begin, UnresolvedSetIterator End) const
Retrieve the template name that corresponds to a non-empty lookup.
const llvm::fltSemantics & getFloatFormat() const
void Profile(llvm::FoldingSetNodeID &ID)
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
unsigned getParameterIndex(const ParmVarDecl *D) const
Used by ParmVarDecl to retrieve on the side the index of the parameter when it exceeds the size of th...
CanQualType OMPArraySectionTy
static TypedefDecl * CreateX86_64ABIBuiltinVaListDecl(const ASTContext *Context)
CanQualType getUIntMaxType() const
Return the unique type for "uintmax_t" (C99 7.18.1.5), defined in <stdint.h>.
TranslationUnitDecl * getTranslationUnitDecl() const
static unsigned NumImplicitMoveConstructors
The number of implicitly-declared move constructors.
static TypedefDecl * CreateMSVaListDecl(const ASTContext *Context)
CanQualType OCLImage2dArrayMSAATy
static std::string charUnitsToString(const CharUnits &CU)
void Profile(llvm::FoldingSetNodeID &ID)
ArgKind getKind() const
Return the kind of stored template argument.
ExtProtoInfo getExtProtoInfo() const
ExtProtoInfo withExceptionSpec(const ExceptionSpecInfo &O)
overridden_cxx_method_iterator overridden_methods_begin(const CXXMethodDecl *Method) const
void removeFastQualifiers(unsigned mask)
void Profile(llvm::FoldingSetNodeID &ID)
DeclContext * getDeclContext()
CharUnits getBaseClassOffset(const CXXRecordDecl *Base) const
getBaseClassOffset - Get the offset, in chars, for the given base class.
A structure for storing the information associated with a substituted template template parameter...
UsingShadowDecl * getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst)
void Profile(llvm::FoldingSetNodeID &ID)
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
internal::Matcher< T > id(StringRef ID, const internal::BindableMatcher< T > &InnerMatcher)
If the provided matcher matches a node, binds the node to ID.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
QualType getObjCSuperType() const
Returns the C struct type for objc_super.
Represents a C++ template name within the type system.
MangleNumberingContext * createMangleNumberingContext() const
const bool * ConsumedParameters
Represents the type decltype(expr) (C++11).
static TypedefDecl * CreateAAPCSABIBuiltinVaListDecl(const ASTContext *Context)
TypeSourceInfo * getTemplateSpecializationTypeInfo(TemplateName T, SourceLocation TLoc, const TemplateArgumentListInfo &Args, QualType Canon=QualType()) const
Defines the clang::TypeLoc interface and its subclasses.
A namespace alias, stored as a NamespaceAliasDecl*.
bool isObjCIdType() const
TemplateOrSpecializationInfo getTemplateOrSpecializationInfo(const VarDecl *Var)
void setObjCImplementation(ObjCInterfaceDecl *IFaceD, ObjCImplementationDecl *ImplD)
Set the implementation of ObjCInterfaceDecl.
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
virtual void RedefinedHiddenDefinition(const NamedDecl *D, Module *M)
A definition has been made visible by being redefined locally.
CharUnits toCharUnitsFromBits(int64_t BitSize) const
Convert a size in bits to a size in characters.
CanQualType UnsignedInt128Ty
Specifies that a value-dependent expression of integral or dependent type should be considered a null...
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
const CXXRecordDecl * getBaseSharingVBPtr() const
IntType getProcessIDType() const
QualType getFILEType() const
Retrieve the C FILE type.
QualType getAdjustedParameterType(QualType T) const
Perform adjustment on the parameter type of a function.
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
const ObjCObjectPointerType * stripObjCKindOfTypeAndQuals(const ASTContext &ctx) const
Strip off the Objective-C "kindof" type and (with it) any protocol qualifiers.
CanQualType OCLImage2dMSAATy
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isInstanceMethod() const
clang::ObjCRuntime ObjCRuntime
Qualifiers Quals
The local qualifiers.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
bool isObjCQualifiedIdType() const
True if this is equivalent to 'id.
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
CanQualType OCLImage2dArrayDepthTy
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
QualType getObjCIdType() const
Represents the Objective-CC id type.
const TemplateArgument * data() const
Retrieve a pointer to the template argument list.
bool isExternallyVisible() const
Represents a GCC generic vector type.
struct CXXOpName CXXOperatorName
unsigned getChar32Align() const
NamedDecl * getInstantiatedFromUsingDecl(UsingDecl *Inst)
If the given using decl Inst is an instantiation of a (possibly unresolved) using decl from a templat...
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...
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
void addDeclaratorForUnnamedTagDecl(TagDecl *TD, DeclaratorDecl *DD)
QualType getSubstTemplateTypeParmPackType(const TemplateTypeParmType *Replaced, const TemplateArgument &ArgPack)
Retrieve a.
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
Implements C++ ABI-specific semantic analysis functions.
void deduplicateMergedDefinitonsFor(NamedDecl *ND)
Clean up the merged definition list.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
void CollectInheritedProtocols(const Decl *CDecl, llvm::SmallPtrSet< ObjCProtocolDecl *, 8 > &Protocols)
CollectInheritedProtocols - Collect all protocols in current class and those inherited by it...
QualType getElementType() const
BuiltinTemplateDecl * getMakeIntegerSeqDecl() const
The result type of a method or function.
unsigned getWCharAlign() const
This template specialization was implicitly instantiated from a template.
bool ObjCQualifiedClassTypesAreCompatible(QualType LHS, QualType RHS)
ObjCQualifiedClassTypesAreCompatible - compare Class<pr,...> and Class<pr1, ...>. ...
const T * get() const
Retrieve the stored node as type T.
bool getObjCEncodingForFunctionDecl(const FunctionDecl *Decl, std::string &S)
Emit the encoded type for the function Decl into S.
RecordDecl * getDefinition() const
getDefinition - Returns the RecordDecl that actually defines this struct/union/class.
const LangAS::Map & getAddressSpaceMap() const
A type, stored as a Type*.
unsigned getIntAlign() const
void setOriginalDecl(const Decl *Orig)
TypeSourceInfo * getTypeSourceInfo() const
void setDeclContext(DeclContext *DC)
setDeclContext - Set both the semantic and lexical DeclContext to DC.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
unsigned getLongAlign() const
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateDecl *Template) const
Retrieve the template name that represents a qualified template name such as std::vector.
static CXXRecordDecl * Create(const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl=nullptr, bool DelayTypeCreation=false)
bool hasObjCLifetime() const
SourceRange getBracketsRange() const
WatchOS is a modernisation of the iOS ABI, which roughly means it's the iOS64 ABI ported to 32-bits...
param_const_iterator param_end() const
unsigned getMaxVectorAlign() const
Return the maximum vector alignment supported for the given target.
static TemplateParameterList * Create(const ASTContext &C, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ArrayRef< NamedDecl * > Params, SourceLocation RAngleLoc)
QualType getPackExpansionType(QualType Pattern, Optional< unsigned > NumExpansions)
SourceLocation getLocStart() const LLVM_READONLY
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
llvm::SmallVector< ast_type_traits::DynTypedNode, 2 > ParentVector
Contains parents of a node.
A template template parameter pack that has been substituted for a template template argument pack...
TypeSourceInfo * CreateTypeSourceInfo(QualType T, unsigned Size=0) const
Allocate an uninitialized TypeSourceInfo.
There is no lifetime qualification on this type.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
static unsigned NumImplicitDestructorsDeclared
The number of implicitly-declared destructors for which declarations were built.
unsigned getTypeAlign(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in bits.
int getIntegerTypeOrder(QualType LHS, QualType RHS) const
Return the highest ranked integer type, see C99 6.3.1.8p1.
TypeInfo getTypeInfo(const Type *T) const
Get the size and alignment of the specified complete type in bits.
is AltiVec 'vector Pixel'
CharUnits getTypeAlignInChars(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in characters.
This declaration does not have an attached comment, and we have searched the redeclaration chain...
Assigning into this object requires the old value to be released and the new value to be retained...
DeclarationNameInfo getNameForTemplate(TemplateName Name, SourceLocation NameLoc) const
bool QIdProtocolsAdoptObjCObjectProtocols(QualType QT, ObjCInterfaceDecl *IDecl)
QIdProtocolsAdoptObjCObjectProtocols - Checks that protocols in QT's qualified-id protocol list adopt...
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
uint64_t getPointerAlign(unsigned AddrSpace) const
not a target-specific vector type
unsigned getMinGlobalAlign() const
getMinGlobalAlign - Return the minimum alignment of a global variable, unless its alignment is explic...
Expr * getBlockVarCopyInits(const VarDecl *VD)
Get the copy initialization expression of the VarDecl VD, or NULL if none exists. ...
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
static GVALinkage basicGVALinkageForFunction(const ASTContext &Context, const FunctionDecl *FD)
void AddDeallocation(void(*Callback)(void *), void *Data)
Add a deallocation callback that will be invoked when the ASTContext is destroyed.
ExternCContextDecl * getExternCContextDecl() const
Encodes a location in the source.
Sugar for parentheses used when specifying types.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums...
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
bool hasSameTemplateName(TemplateName X, TemplateName Y)
Determine whether the given template names refer to the same template.
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
CharUnits getSize() const
getSize - Get the record size in characters.
const TemplateArgument * iterator
QualType getElementType() const
unsigned getBitWidthValue(const ASTContext &Ctx) const
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists...
Represents typeof(type), a GCC extension.
Interfaces are the core concept in Objective-C for object oriented design.
static const LangAS::Map * getAddressSpaceMap(const TargetInfo &T, const LangOptions &LOpts)
RawComment * getRawCommentForDeclNoCache(const Decl *D) const
Return the documentation comment attached to a given declaration, without looking into cache...
This names the __make_integer_seq BuiltinTemplateDecl.
A structure for storing an already-substituted template template parameter pack.
bool isComplexType() const
isComplexType() does not include complex integers (a GCC extension).
bool isBuiltinType() const
Helper methods to distinguish type categories.
CharUnits getObjCEncodingTypeSize(QualType T) const
Return the size of type T for Objective-C encoding purpose, in characters.
static unsigned NumImplicitCopyAssignmentOperatorsDeclared
The number of implicitly-declared copy assignment operators for which declarations were built...
Kind getKind() const LLVM_READONLY
void getLegacyIntegralTypeEncoding(QualType &t) const
getLegacyIntegralTypeEncoding - Another legacy compatibility encoding: 32-bit longs are encoded as 'l...
TagDecl - Represents the declaration of a struct/union/class/enum.
const void * getMemoizationData() const
Returns a pointer that identifies the stored AST node.
TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, const IdentifierInfo *Name) const
Retrieve the template name that represents a dependent template name such as MetaFun::template apply...
bool isConstantSizeType() const
Return true if this is not a variable sized type, according to the rules of C99 6.7.5p3.
IdentifierInfo * getMakeIntegerSeqName() const
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location, which defaults to the empty location.
QualType getDependentSizedArrayType(QualType EltTy, Expr *NumElts, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const
Return a non-unique reference to the type for a dependently-sized array of the specified element type...
void Profile(llvm::FoldingSetNodeID &ID)
bool isObjCUnqualifiedIdOrClass() const
VectorKind getVectorKind() const
bool isMSExternInline() const
The combination of the extern and inline keywords under MSVC forces the function to be required...
void Profile(llvm::FoldingSetNodeID &ID)
QualType withConst() const
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
Represents a static or instance method of a struct/union/class.
bool isObjCBuiltinType() const
TypedefNameDecl * getTypedefNameForUnnamedTagDecl(const TagDecl *TD)
CanQualType getCanonicalParamType(QualType T) const
Return the canonical parameter type corresponding to the specific potentially non-canonical one...
void Profile(llvm::FoldingSetNodeID &ID)
DiagnosticsEngine & getDiagnostics() const
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
ExtInfo withNoReturn(bool noReturn) const
QualType getIncompleteArrayType(QualType EltTy, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return a unique reference to the type for an incomplete array of the specified element type...
const ConstantArrayType * getAsConstantArrayType(QualType T) const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
ObjCCategoryDecl - Represents a category declaration.
const ObjCInterfaceDecl * getClassInterface() const
BuiltinTemplateKind
Kinds of BuiltinTemplateDecl.
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>.
QualType getObjCGCQualType(QualType T, Qualifiers::GC gcAttr) const
Return the uniqued reference to the type for an Objective-C gc-qualified type.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
bool isPropertyAccessor() const
static bool areSortedAndUniqued(ArrayRef< ObjCProtocolDecl * > Protocols)
SplitQualType getSplitDesugaredType() const
const Type * getBaseElementTypeUnsafe() const
Get the base element type of this type, potentially discarding type qualifiers.
This declaration is only a declaration.
is AltiVec 'vector bool ...'
virtual BuiltinVaListKind getBuiltinVaListKind() const =0
Returns the kind of __builtin_va_list type that should be used with this target.
SourceLocation getLAngleLoc() const
std::string getAsString() const
Derive the full selector name (e.g.
IntType getUIntMaxType() const
Represents one property declaration in an Objective-C interface.
__builtin_va_list as defined by the Power ABI: https://www.power.org /resources/downloads/Power-Arch-...
bool canBindObjCObjectType(QualType To, QualType From)
We have found a comment attached to this particular declaration.
ASTNodeKind getNodeKind() const
unsigned getNumProtocols() const
Return the number of qualifying protocols in this interface type, or 0 if there are none...
bool isObjCQualifiedClassType() const
True if this is equivalent to 'Class.
The generic Itanium ABI is the standard ABI of most open-source and Unix-like platforms.
bool isGNUFamily() const
Is this runtime basically of the GNU family of runtimes?
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm() const
Retrieve the substituted template template parameter, if known.
void InitBuiltinTypes(const TargetInfo &Target, const TargetInfo *AuxTarget=nullptr)
Initialize built-in types.
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
QualType getReturnType() const
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
const T * castAs() const
Member-template castAs<specific type>.
QualType getAttributedType(AttributedType::Kind attrKind, QualType modifiedType, QualType equivalentType)
This template specialization was instantiated from a template due to an explicit instantiation defini...
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent) const
C++11 deduced auto type.
This template specialization was formed from a template-id but has not yet been declared, defined, or instantiated.
bool typesAreBlockPointerCompatible(QualType, QualType)
bool isVectorType() const
virtual IntType getIntTypeByWidth(unsigned BitWidth, bool IsSigned) const
Return integer type with specified width.
TypedefDecl * getInt128Decl() const
Retrieve the declaration for the 128-bit signed integer type.
bool isPromotableIntegerType() const
More type predicates useful for type checking/promotion.
VarDecl * getInstantiatedFromStaticDataMember() const
If this variable is an instantiated static data member of a class template specialization, returns the templated static data member from which it was instantiated.
QualType getRealTypeForBitwidth(unsigned DestWidth) const
getRealTypeForBitwidth - sets floating point QualTy according to specified bitwidth.
FunctionDecl * getClassScopeSpecializationPattern(const FunctionDecl *FD)
Assigning into this object requires a lifetime extension.
llvm::DenseMap< const Decl *, RawCommentAndCacheFlags > RedeclComments
Mapping from declarations to comments attached to any redeclaration.
static DynTypedNode create(const T &Node)
Creates a DynTypedNode from Node.
const BlockDecl * getBlockDecl() const
bool isDynamicClass() const
__builtin_va_list as defined by ARM AAPCS ABI http://infocenter.arm.com
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
void Profile(llvm::FoldingSetNodeID &ID)
bool isObjCQualifiedClass() const
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Represents a pointer type decayed from an array or function type.
unsigned getManglingNumber(const NamedDecl *ND) const
The WebAssembly ABI is a modified version of the Itanium ABI.
The injected class name of a C++ class template or class template partial specialization.
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
QualType getPointeeType() const
void getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD, const Decl *Container, std::string &S) const
getObjCEncodingForPropertyDecl - Return the encoded type for this method declaration.
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
Represents a pack expansion of types.
QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon=QualType()) const
static QualType mergeEnumWithInteger(ASTContext &Context, const EnumType *ET, QualType other, bool isBlockReturnType)
Given that we have an enum type and a non-enum type, try to merge them.
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments of this object type as they were written.
DeclarationNameLoc - Additional source/type location info for a declaration name. ...
void setTemplateKeywordLoc(SourceLocation Loc)
QualType getObjCSelType() const
Retrieve the type that corresponds to the predefined Objective-C 'SEL' type.
ArrayRef< QualType > getTypeArgs() const
Retrieve the type arguments of this object type (semantically).
Expr * getSizeExpr() const
CanQualType UnsignedShortTy
ObjCIvarDecl * getNextIvar()
bool isSuperClassOf(const ObjCInterfaceDecl *I) const
isSuperClassOf - Return true if this class is the specified class or is a super class of the specifie...
Base class for declarations which introduce a typedef-name.
ast_type_traits::DynTypedNode Node
bool propertyTypesAreCompatible(QualType, QualType)
Represents a template argument.
TypedefDecl * buildImplicitTypedef(QualType T, StringRef Name) const
Create a new implicit TU-level typedef declaration.
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context, ASTContext::GetBuiltinTypeError &Error, bool &RequiresICE, bool AllowTypeModifiers)
DecodeTypeFromStr - This decodes one type descriptor from Str, advancing the pointer over the consume...
QualType getMemberPointerType(QualType T, const Type *Cls) const
Return the uniqued reference to the type for a member pointer to the specified type in the specified ...
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons...
QualType getAsType() const
Retrieve the type for a type template argument.
IntType
===-— Target Data Type Query Methods ----------------------------—===//
Represents a template name that was expressed as a qualified name.
TagTypeKind
The kind of a tag type.
TemplateName getSubstTemplateTemplateParmPack(TemplateTemplateParmDecl *Param, const TemplateArgument &ArgPack) const
CanQualType ObjCBuiltinIdTy
static const Type * getElementType(const Expr *BaseExpr)
const llvm::fltSemantics & getLongDoubleFormat() const
void * getAsVoidPointer() const
Retrieve the template name as a void pointer.
QualType getCanonicalTemplateSpecializationType(TemplateName T, const TemplateArgument *Args, unsigned NumArgs) const
QualType getDecayedType(QualType T) const
Return the uniqued reference to the decayed version of the given type.
not evaluated yet, for special member function
static NonTypeTemplateParmDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, unsigned D, unsigned P, IdentifierInfo *Id, QualType T, bool ParameterPack, TypeSourceInfo *TInfo)
A qualifier set is used to build a set of qualifiers.
QualType mergeTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool BlockReturnType=false)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
bool isSentinelNullExpr(const Expr *E)
The base class of all kinds of template declarations (e.g., class, function, etc.).
CanQualType DoubleComplexTy
bool isZero() const
isZero - Test whether the quantity equals zero.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
void addCopyConstructorForExceptionObject(CXXRecordDecl *RD, CXXConstructorDecl *CD)
typedef char* __builtin_va_list;
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
static FloatingRank getFloatingRank(QualType T)
getFloatingRank - Return a relative rank for floating point types.
comments::FullComment * getCommentForDecl(const Decl *D, const Preprocessor *PP) const
Return parsed documentation comment attached to a given declaration.
static BuiltinTemplateDecl * Create(const ASTContext &C, DeclContext *DC, DeclarationName Name, BuiltinTemplateKind BTK)
bool isKindOfType() const
Whether this ia a "__kindof" type (semantically).
The template argument is a pack expansion of a template name that was provided for a template templat...
TemplateName getCanonicalTemplateName(TemplateName Name) const
Retrieves the "canonical" template name that refers to a given template.
bool isInvalidDecl() const
static bool areCompatVectorTypes(const VectorType *LHS, const VectorType *RHS)
areCompatVectorTypes - Return true if the two specified vector types are compatible.
unsigned getCharWidth() const
bool getProducesResult() const
CanQualType UnsignedLongLongTy
ObjCInterfaceDecl * getDefinition()
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
This template specialization was instantiated from a template due to an explicit instantiation declar...
const ObjCInterfaceType * getInterfaceType() const
If this pointer points to an Objective C @interface type, gets the type for that interface.
QualType getEnumType(const EnumDecl *Decl) const
QualType getExceptionObjectType(QualType T) const
unsigned getShortWidth() const
Return the size of 'signed short' and 'unsigned short' for this target, in bits.
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.
void Profile(llvm::FoldingSetNodeID &ID)
DeclarationName - The name of a declaration.
CallingConv getCC() const
const Type * strip(QualType type)
Collect any qualifiers on the given type and return an unqualified type.
Selector getGetterName() const
QualType getObjCObjectPointerType(QualType OIT) const
Return a ObjCObjectPointerType type for the given ObjCObjectType.
DefinitionKind isThisDeclarationADefinition(ASTContext &) const
Check whether this declaration is a definition.
static ASTContext::DynTypedNodeList getDynNodeFromMap(const NodeTy &Node, const MapTy &Map)
void Profile(llvm::FoldingSetNodeID &ID)
unsigned getLineNumber(FileID FID, unsigned FilePos, bool *Invalid=nullptr) const
Given a SourceLocation, return the spelling line number for the position indicated.
MangleNumberingContext & getManglingNumberContext(const DeclContext *DC)
Retrieve the context for computing mangling numbers in the given DeclContext.
QualType getTemplateTypeParmType(unsigned Depth, unsigned Index, bool ParameterPack, TemplateTypeParmDecl *ParmDecl=nullptr) const
Retrieve the template type parameter type for a template parameter or parameter pack with the given d...
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
Selector getSelector() const
EnumDecl - Represents an enum.
FunctionType::ExtInfo getFunctionExtInfo(const Type &t)
void Profile(llvm::FoldingSetNodeID &ID)
detail::InMemoryDirectory::const_iterator E
A pointer to member type per C++ 8.3.3 - Pointers to members.
const FunctionType * adjustFunctionType(const FunctionType *Fn, FunctionType::ExtInfo EInfo)
Change the ExtInfo on a function type.
static GVALinkage adjustGVALinkageForAttributes(GVALinkage L, const Decl *D)
virtual ~ASTMutationListener()
bool canAssignObjCInterfacesInBlockPointer(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT, bool BlockReturnType)
canAssignObjCInterfacesInBlockPointer - This routine is specifically written for providing type-safet...
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
const llvm::fltSemantics & getHalfFormat() const
QualType AutoRRefDeductTy
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
unsigned getMaxAtomicInlineWidth() const
Return the maximum width lock-free atomic operation which can be inlined given the supported features...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
A type that was preceded by the 'template' keyword, stored as a Type*.
QualType getCorrespondingUnsignedType(QualType T) const
unsigned Map[Count]
The type of a lookup table which maps from language-specific address spaces to target-specific ones...
bool areComparableObjCPointerTypes(QualType LHS, QualType RHS)
void Profile(llvm::FoldingSetNodeID &ID)
QualType getBuiltinVaListType() const
Retrieve the type of the __builtin_va_list type.
static unsigned NumImplicitCopyAssignmentOperators
The number of implicitly-declared copy assignment operators.
void addConsistentQualifiers(Qualifiers qs)
Add the qualifiers from the given set to this set, given that they don't conflict.
known_extensions_range known_extensions() const
const VariableArrayType * getAsVariableArrayType(QualType T) const
unsigned getDepth() const
Get the nesting depth of the template parameter.
QualType getPointeeType() const
Gets the type pointed to by this ObjC pointer.
GVALinkage GetGVALinkageForVariable(const VarDecl *VD)
A dynamically typed AST node container.
const Decl * getOriginalDecl() const LLVM_READONLY
QualType getDependentSizedExtVectorType(QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc) const
Represents a pointer to an Objective C object.
CanQualType ObjCBuiltinBoolTy
const RawComment * getRawCommentForAnyRedecl(const Decl *D, const Decl **OriginalDecl=nullptr) const
Return the documentation comment attached to a given declaration.
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
unsigned getAlignOfGlobalVar(QualType T) const
Return the alignment in bits that should be given to a global variable with type T.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Complex values, per C99 6.2.5p11.
BuiltinTemplateDecl * buildBuiltinTemplateDecl(BuiltinTemplateKind BTK, const IdentifierInfo *II) const
QualType getPointerDiffType() const
Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.
comments::FullComment * cloneFullComment(comments::FullComment *FC, const Decl *D) const
const T * getAs() const
Member-template getAs<specific type>'.
QualType getCanonicalType() const
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
This template specialization was declared or defined by an explicit specialization (C++ [temp...
CanQualType UnsignedLongTy
ObjCInterfaceDecl * getInterfaceDecl() const
If this pointer points to an Objective @interface type, gets the declaration for that interface...
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template instantiation this function represents.
bool areCompatibleVectorTypes(QualType FirstVec, QualType SecondVec)
Return true if the given vector types are of the same unqualified type or if they are equivalent to t...
void Profile(llvm::FoldingSetNodeID &ID)
QualType getIntegralType() const
Retrieve the type of the integral value.
bool isObjCQualifiedIdType() const
QualType getIntegerType() const
getIntegerType - Return the integer type this enum decl corresponds to.
static char ObjCEncodingForEnumType(const ASTContext *C, const EnumType *ET)
bool isFunctionType() const
static GVALinkage basicGVALinkageForVariable(const ASTContext &Context, const VarDecl *VD)
ExtVectorType - Extended vector type.
CanQualType ObjCBuiltinClassTy
DeclaratorDecl * getDeclaratorForUnnamedTagDecl(const TagDecl *TD)
bool isComplete() const
Returns true if this can be considered a complete type.
Base for LValueReferenceType and RValueReferenceType.
CanQualType BoundMemberTy
static TypedefDecl * CreateCharPtrBuiltinVaListDecl(const ASTContext *Context)
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
unsigned getAddressSpace() const
ObjCInterfaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C class.
QualType withRestrict() const
CanQualType OCLImage2dDepthTy
uint64_t getCharWidth() const
Return the size of the character type, in bits.
llvm::DenseMap< const Decl *, comments::FullComment * > ParsedComments
Mapping from declarations to parsed comments attached to any redeclaration.
The template argument is a type.
ObjCImplementationDecl * getImplementation() const
void addDecl(Decl *D)
Add the declaration D into this context.
bool canAssignObjCInterfaces(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
canAssignObjCInterfaces - Return true if the two interface types are compatible for assignment from R...
void setBlockVarCopyInits(VarDecl *VD, Expr *Init)
Set the copy inialization expression of a block var decl.
unsigned getIntWidth() const
getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for this target, in bits.
The template argument is actually a parameter pack.
unsigned getLongLongWidth() const
getLongLongWidth/Align - Return the size of 'signed long long' and 'unsigned long long' for this targ...
QualType getTagDeclType(const TagDecl *Decl) const
Return the unique reference to the type for the specified TagDecl (struct/union/class/enum) decl...
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
bool getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, std::string &S, bool Extended=false) const
Emit the encoded type for the method declaration Decl into S.
bool isStaticDataMember() const
Determines whether this is a static data member.
CharUnits getNonVirtualSize() const
getNonVirtualSize - Get the non-virtual size (in chars) of an object, which is the size of the object...
ASTMutationListener * getASTMutationListener() const
Retrieve a pointer to the AST mutation listener associated with this AST context, if any...
unsigned getFieldIndex() const
getFieldIndex - Returns the index of this field within its record, as appropriate for passing to ASTR...
QualType getPointeeType() const
TypeDecl * getFloat128StubType() const
Retrieve the declaration for a 128-bit float stub type.
uint64_t getPointerWidth(unsigned AddrSpace) const
Return the width of pointers on this target, for the specified address space.
A template argument list.
static TypedefDecl * CreateVaListDecl(const ASTContext *Context, TargetInfo::BuiltinVaListKind Kind)
void mergeDefinitionIntoModule(NamedDecl *ND, Module *M, bool NotifyListeners=true)
Note that the definition ND has been merged into module M, and should be visible whenever M is visibl...
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
const Type * getClass() const
Reading or writing from this object requires a barrier call.
QualType getNullPtrType() const
Retrieve the type for null non-type template argument.
QualType getTypedefType(const TypedefNameDecl *Decl, QualType Canon=QualType()) const
Return the unique reference to the type for the specified typedef-name decl.
QualType getTypeOfExprType(Expr *e) const
GCC extension.
An attributed type is a type to which a type attribute has been applied.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
bool hasAddressSpace() const
bool typesAreCompatible(QualType T1, QualType T2, bool CompareUnqualified=false)
Compatibility predicates used to check assignment expressions.
unsigned pack_size() const
The number of template arguments in the given template argument pack.
bool isObjCClassType() const
True if this is equivalent to the 'Class' type, i.e.
QualType getVariableArrayType(QualType EltTy, Expr *NumElts, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const
Return a non-unique reference to the type for a variable array of the specified element type...
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
const CXXMethodDecl * getCurrentKeyFunction(const CXXRecordDecl *RD)
Get our current best idea for the key function of the given record decl, or NULL if there isn't one...
Represents a C++ struct/union/class.
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
bool isReadOnly() const
isReadOnly - Return true iff the property has a setter.
bool isObjCObjectPointerType() const
The template argument is a template name that was provided for a template template parameter...
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
Represents a C array with an unspecified size.
VTableContextBase * getVTableContext()
bool useAddressSpaceMapMangling() const
Specify if mangling based on address space map should be used or not for language specific address sp...
Missing a type from <stdio.h>
bool isOutOfLine() const override
Determine whether this is or was instantiated from an out-of-line definition of a static data member...
static TranslationUnitDecl * Create(ASTContext &C)
ObjCIvarDecl - Represents an ObjC instance variable.
CanQualType OCLImage1dArrayTy
unsigned getBoolWidth() const
Return the size of '_Bool' and C++ 'bool' for this target, in bits.
void * Allocate(size_t Size, unsigned Align=8) const
static TypedefDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
CallingConv getDefaultCallingConvention(bool isVariadic, bool IsCXXMethod) const
Retrieves the default calling convention for the current target.
Provides information a specialization of a member of a class template, which may be a member function...
ArraySizeModifier getSizeModifier() const
A structure for storing the information associated with an overloaded template name.
IntType getInt64Type() const
size_t getSideTableAllocatedMemory() const
Return the total memory used for various side tables.
CharUnits getDataSize() const
getDataSize() - Get the record data size, which is the record size without tail padding, in characters.
We searched for a comment attached to the particular declaration, but didn't find any...
static unsigned NumImplicitCopyConstructorsDeclared
The number of implicitly-declared copy constructors for which declarations were built.
Builtin::Context & BuiltinInfo
void Profile(llvm::FoldingSetNodeID &ID)
Declaration of a class template.
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorType::VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
unsigned kind
All of the diagnostics that can be emitted by the frontend.
This class is used for builtin types like 'int'.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
pack_iterator pack_end() const
Iterator referencing one past the last argument of a template argument pack.
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
unsigned getLongWidth() const
getLongWidth/Align - Return the size of 'signed long' and 'unsigned long' for this target...
static TypedefDecl * CreateVoidPtrBuiltinVaListDecl(const ASTContext *Context)
QualType getParamTypeForDecl() const
Defines the clang::TargetInfo interface.
ObjCInterfaceDecl * getSuperClass() const
void setRAngleLoc(SourceLocation Loc)
void adjustExceptionSpec(FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI, bool AsWritten=false)
Change the exception specification on a function once it is delay-parsed, instantiated, or computed.
CXXMethodVector::const_iterator overridden_cxx_method_iterator
bool getHasRegParm() const
static bool sameObjCTypeArgs(ASTContext &ctx, const ObjCInterfaceDecl *iface, ArrayRef< QualType > lhsArgs, ArrayRef< QualType > rhsArgs, bool stripKindOf)
TagDecl * getDecl() const
bool isIncompleteArrayType() const
static Decl::Kind getKind(const Decl *D)
decl_type * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
static bool NeedsInjectedClassNameType(const RecordDecl *D)
TranslationUnitDecl - The top declaration context.
unsigned getTargetAddressSpace(QualType T) const
QualType getDecltypeType(Expr *e, QualType UnderlyingType) const
C++11 decltype.
QualType getjmp_bufType() const
Retrieve the C jmp_buf type.
QualType getUIntPtrType() const
Return a type compatible with "uintptr_t" (C99 7.18.1.4), as defined by the target.
GVALinkage
A more specific kind of linkage than enum Linkage.
A lazy value (of type T) that is within an AST node of type Owner, where the value might change in la...
QualType getConstantArrayType(QualType EltTy, const llvm::APInt &ArySize, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return the unique reference to the type for a constant array of the specified element type...
QualType getElementType() const
uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const
Return number of constant array elements.
QualType mergeFunctionParameterTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
mergeFunctionParameterTypes - merge two types which appear as function parameter types ...
Expr * getDefaultArgExprForConstructor(const CXXConstructorDecl *CD, unsigned ParmIdx)
bool hasQualifiers() const
Determine whether this type has any qualifiers.
const ObjCInterfaceDecl * getObjContainingInterface(const NamedDecl *ND) const
Returns the Objective-C interface that ND belongs to if it is an Objective-C method/property/ivar etc...
TypedefDecl * getObjCSelDecl() const
Retrieve the typedef corresponding to the predefined 'SEL' type in Objective-C.
bool hasExceptionSpec() const
Return whether this function has any kind of exception spec.
TypedefDecl * getBuiltinMSVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_ms_va_list type...
We can encode up to four bits in the low bits of a type pointer, but there are many more type qualifi...
Qualifiers::GC getObjCGCAttrKind(QualType Ty) const
Return one of the GCNone, Weak or Strong Objective-C garbage collection attributes.
int64_t toBits(CharUnits CharSize) const
Convert a size in characters to a size in bits.
A set of overloaded template declarations.
const llvm::fltSemantics & getFloatTypeSemantics(QualType T) const
Return the APFloat 'semantics' for the specified scalar floating point type.
A trivial tuple used to represent a source range.
SourceLocation getLocation() const
NamedDecl - This represents a decl with a name.
ObjCIvarDecl * all_declared_ivar_begin()
all_declared_ivar_begin - return first ivar declared in this class, its extensions and its implementa...
FunctionDecl * getInstantiatedFromMemberFunction() const
If this function is an instantiation of a member function of a class template specialization, retrieves the function from which it was instantiated.
QualType getSignedWCharType() const
Return the type of "signed wchar_t".
void setAccess(AccessSpecifier AS)
Represents a C array with a specified size that is not an integer-constant-expression.
SourceLocation getExpansionLoc(SourceLocation Loc) const
Given a SourceLocation object Loc, return the expansion location referenced by the ID...
const ASTRecordLayout & getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D) const
Get or compute information about the layout of the specified Objective-C interface.
void setTemplateNameLoc(SourceLocation Loc)
void addOverriddenMethod(const CXXMethodDecl *Method, const CXXMethodDecl *Overridden)
Note that the given C++ Method overrides the given Overridden method.
bool DeclMustBeEmitted(const Decl *D)
Determines if the decl can be CodeGen'ed or deserialized from PCH lazily, only when used; this is onl...
const CXXConstructorDecl * getCopyConstructorForExceptionObject(CXXRecordDecl *RD)
No keyword precedes the qualified type name.
std::pair< FileID, unsigned > getDecomposedLoc(SourceLocation Loc) const
Decompose the specified location into a raw FileID + Offset pair.
bool ObjCQualifiedIdTypesAreCompatible(QualType LHS, QualType RHS, bool ForCompare)
ObjCQualifiedIdTypesAreCompatible - We know that one of lhs/rhs is an ObjCQualifiedIDType.
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char, signed char, short, int, long..], or an enum decl which has a signed representation.
llvm::DenseMap< const void *, llvm::PointerUnion4< const Decl *, const Stmt *, ast_type_traits::DynTypedNode *, ParentVector * > > ParentMapPointers
Maps from a node to its parents.
void Profile(llvm::FoldingSetNodeID &ID)
CharUnits getAlignOfGlobalVarInChars(QualType T) const
Return the alignment in characters that should be given to a global variable with type T...
bool isConstQualified() const
Determine whether this type is const-qualified.
bool hasSignedIntegerRepresentation() const
Determine whether this type has an signed integer representation of some sort, e.g., it is an signed integer type or a vector.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
static bool isObjCNSObjectType(QualType Ty)
Return true if this is an NSObject object with its NSObject attribute set.
IntType getPtrDiffType(unsigned AddrSpace) const
static FieldDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)
unsigned getShortAlign() const
Return the alignment of 'signed short' and 'unsigned short' for this target.
void addedLocalImportDecl(ImportDecl *Import)
Notify the AST context that a new import declaration has been parsed or implicitly created within thi...
const ObjCObjectPointerType * getAsObjCInterfacePointerType() const
QualType getSubstTemplateTypeParmType(const TemplateTypeParmType *Replaced, QualType Replacement) const
Retrieve a substitution-result type.
The global specifier '::'. There is no stored value.
bool isObjCIdType() const
True if this is equivalent to the 'id' type, i.e.
Missing a type from <setjmp.h>
void setType(QualType newType)
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
base_class_range vbases()
Represents the canonical version of C arrays with a specified constant size.
This class handles loading and caching of source files into memory.
The parameter is invariant: must match exactly.
ExceptionSpecInfo ExceptionSpec
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
Defines enum values for all the target-independent builtin functions.
Declaration of a template function.
llvm::DenseMap< ast_type_traits::DynTypedNode, llvm::PointerUnion4< const Decl *, const Stmt *, ast_type_traits::DynTypedNode *, ParentVector * > > ParentMapOtherNodes
Parent map for nodes without pointer identity.
A class which abstracts out some details necessary for making a call.
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals)
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals...
bool BlockRequiresCopying(QualType Ty, const VarDecl *D)
Returns true iff we need copy/dispose helpers for the given type.
unsigned getLongLongAlign() const
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
APValue * getMaterializedTemporaryValue(const MaterializeTemporaryExpr *E, bool MayCreate)
Get the storage for the constant value of a materialized temporary of static storage duration...
A single template declaration.
void Profile(llvm::FoldingSetNodeID &ID)
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
CanQualType OCLClkEventTy
const RecordDecl * getParent() const
getParent - Returns the parent of this field declaration, which is the struct in which this method is...
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
const ObjCObjectPointerType * getAsObjCQualifiedIdType() const
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
CanQualType UnsignedIntTy
QualType getProcessIDType() const
Return the unique type for "pid_t" defined in <sys/types.h>.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
bool isPointerType() const
static unsigned NumImplicitDestructors
The number of implicitly-declared destructors.
QualType getCFConstantStringType() const
Return the C structure type used to represent constant CFStrings.
QualType getDeducedType() const
Get the type deduced for this auto type, or null if it's either not been deduced or was deduced to a ...