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))
146 DeclLoc = D->getLocStart();
148 DeclLoc = D->getLocation();
150 if (isa<TypedefDecl>(D)) {
154 DeclLoc = D->getLocStart();
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);
203 std::pair<FileID, unsigned> DeclLocDecomp = SourceMgr.
getDecomposedLoc(DeclLoc);
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 &&
215 SourceMgr.
getLineNumber(DeclLocDecomp.first, DeclLocDecomp.second)
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;
355 for (
auto I : D->redecls()) {
367 OriginalDeclForRC =
I;
387 *OriginalDecl = OriginalDeclForRC;
395 for (
auto I : D->redecls()) {
406 const DeclContext *DC = ObjCMethod->getDeclContext();
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;
444 if (D->isInvalidDecl())
446 D = adjustDeclToTemplate(D);
448 const Decl *Canonical = D->getCanonicalDecl();
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,
643 NTTP->getPosition(),
nullptr,
645 NTTP->isParameterPack(),
648 CanonParams.push_back(Param);
651 CanonParams.push_back(getCanonicalTemplateTemplateParmDecl(
652 cast<TemplateTemplateParmDecl>(*
P)));
667 Canonical = CanonTemplateTemplateParms.FindNodeOrInsertPos(ID, InsertPos);
668 assert(!Canonical &&
"Shouldn't be in the map!");
672 Canonical =
new (*this) CanonicalTemplateTemplateParm(CanonTTP);
673 CanonTemplateTemplateParms.InsertNode(Canonical, InsertPos);
678 if (!LangOpts.CPlusPlus)
return nullptr;
693 llvm_unreachable(
"Invalid CXXABI type!");
698 if (LOpts.FakeAddressSpaceMap) {
701 static const unsigned FakeAddrSpaceMap[] = {
710 return &FakeAddrSpaceMap;
718 switch (LangOpts.getAddressSpaceMapMangling()) {
726 llvm_unreachable(
"getAddressSpaceMapMangling() doesn't cover anything.");
732 : FunctionProtoTypes(this_()), TemplateSpecializationTypes(this_()),
733 DependentTemplateSpecializationTypes(this_()),
734 SubstTemplateTemplateParmPacks(this_()),
735 GlobalNestedNameSpecifier(nullptr), Int128Decl(nullptr),
736 UInt128Decl(nullptr), BuiltinVaListDecl(nullptr),
737 BuiltinMSVaListDecl(nullptr), ObjCIdDecl(nullptr), ObjCSelDecl(nullptr),
738 ObjCClassDecl(nullptr), ObjCProtocolClassDecl(nullptr), BOOLDecl(nullptr),
739 CFConstantStringTagDecl(nullptr), CFConstantStringTypeDecl(nullptr),
740 ObjCInstanceTypeDecl(nullptr), FILEDecl(nullptr), jmp_bufDecl(nullptr),
741 sigjmp_bufDecl(nullptr), ucontext_tDecl(nullptr),
742 BlockDescriptorType(nullptr), BlockDescriptorExtendedType(nullptr),
743 cudaConfigureCallDecl(nullptr), FirstLocalImport(), LastLocalImport(),
744 ExternCContext(nullptr), MakeIntegerSeqDecl(nullptr),
745 TypePackElementDecl(nullptr), SourceMgr(SM), LangOpts(LOpts),
747 AddrSpaceMap(nullptr), Target(nullptr), AuxTarget(nullptr),
749 BuiltinInfo(builtins), DeclarationNames(*this), ExternalSource(nullptr),
750 Listener(nullptr), Comments(SM), CommentsLoaded(
false),
751 CommentCommandTraits(BumpAlloc, LOpts.CommentOpts), LastSDM(nullptr, 0) {
756 ReleaseParentMapEntries();
760 ReleaseDeclContextMaps();
763 for (
auto &Pair : Deallocations)
764 (Pair.first)(Pair.second);
770 I = ObjCLayouts.begin(),
E = ObjCLayouts.end();
I !=
E; )
776 I = ASTRecordLayouts.begin(),
E = ASTRecordLayouts.end();
I !=
E; ) {
783 AEnd = DeclAttrs.end();
785 A->second->~AttrVec();
787 for (std::pair<const MaterializeTemporaryExpr *, APValue *> &MTVPair :
788 MaterializedTemporaryValues)
789 MTVPair.second->~APValue();
791 llvm::DeleteContainerSeconds(MangleNumberingContexts);
794 void ASTContext::ReleaseParentMapEntries() {
795 if (!PointerParents)
return;
796 for (
const auto &Entry : *PointerParents) {
803 for (
const auto &Entry : *OtherParents) {
813 Deallocations.push_back({
Callback, Data});
822 llvm::errs() <<
"\n*** AST Context Stats:\n";
823 llvm::errs() <<
" " << Types.size() <<
" types total.\n";
825 unsigned counts[] = {
826 #define TYPE(Name, Parent) 0,
827 #define ABSTRACT_TYPE(Name, Parent)
828 #include "clang/AST/TypeNodes.def"
832 for (
unsigned i = 0, e = Types.size(); i != e; ++i) {
838 unsigned TotalBytes = 0;
839 #define TYPE(Name, Parent) \
841 llvm::errs() << " " << counts[Idx] << " " << #Name \
843 TotalBytes += counts[Idx] * sizeof(Name##Type); \
845 #define ABSTRACT_TYPE(Name, Parent)
846 #include "clang/AST/TypeNodes.def"
848 llvm::errs() <<
"Total bytes = " << TotalBytes <<
"\n";
853 <<
" implicit default constructors created\n";
856 <<
" implicit copy constructors created\n";
860 <<
" implicit move constructors created\n";
863 <<
" implicit copy assignment operators created\n";
867 <<
" implicit move assignment operators created\n";
870 <<
" implicit destructors created\n";
873 llvm::errs() <<
"\n";
877 BumpAlloc.PrintStats();
881 bool NotifyListeners) {
887 MergedDefModules[ND].push_back(M);
893 auto It = MergedDefModules.find(ND);
894 if (It == MergedDefModules.end())
897 auto &Merged = It->second;
900 if (!Found.insert(M).second)
902 Merged.erase(std::remove(Merged.begin(), Merged.end(),
nullptr), Merged.end());
909 return ExternCContext;
916 BuiltinTemplate->setImplicit();
917 TUDecl->
addDecl(BuiltinTemplate);
919 return BuiltinTemplate;
924 if (!MakeIntegerSeqDecl)
927 return MakeIntegerSeqDecl;
932 if (!TypePackElementDecl)
935 return TypePackElementDecl;
948 NewDecl->setImplicit();
949 NewDecl->addAttr(TypeVisibilityAttr::CreateImplicit(
950 const_cast<ASTContext &>(*
this), TypeVisibilityAttr::Default));
955 StringRef
Name)
const {
960 NewDecl->setImplicit();
984 assert((!this->Target || this->Target == &Target) &&
985 "Incorrect target reinitialization");
988 this->Target = &Target;
989 this->AuxTarget = AuxTarget;
991 ABI.reset(createCXXABI(Target));
996 InitBuiltinType(
VoidTy, BuiltinType::Void);
999 InitBuiltinType(
BoolTy, BuiltinType::Bool);
1001 if (LangOpts.CharIsSigned)
1002 InitBuiltinType(
CharTy, BuiltinType::Char_S);
1004 InitBuiltinType(
CharTy, BuiltinType::Char_U);
1007 InitBuiltinType(
ShortTy, BuiltinType::Short);
1008 InitBuiltinType(
IntTy, BuiltinType::Int);
1009 InitBuiltinType(
LongTy, BuiltinType::Long);
1010 InitBuiltinType(
LongLongTy, BuiltinType::LongLong);
1020 InitBuiltinType(
FloatTy, BuiltinType::Float);
1021 InitBuiltinType(
DoubleTy, BuiltinType::Double);
1022 InitBuiltinType(
LongDoubleTy, BuiltinType::LongDouble);
1025 InitBuiltinType(
Float128Ty, BuiltinType::Float128);
1028 InitBuiltinType(
Int128Ty, BuiltinType::Int128);
1033 InitBuiltinType(
WCharTy, BuiltinType::WChar_S);
1035 InitBuiltinType(
WCharTy, BuiltinType::WChar_U);
1036 if (LangOpts.CPlusPlus && LangOpts.WChar)
1040 WideCharTy = getFromTargetType(Target.getWCharType());
1043 WIntTy = getFromTargetType(Target.getWIntType());
1045 if (LangOpts.CPlusPlus)
1046 InitBuiltinType(
Char16Ty, BuiltinType::Char16);
1048 Char16Ty = getFromTargetType(Target.getChar16Type());
1050 if (LangOpts.CPlusPlus)
1051 InitBuiltinType(
Char32Ty, BuiltinType::Char32);
1053 Char32Ty = getFromTargetType(Target.getChar32Type());
1060 InitBuiltinType(
DependentTy, BuiltinType::Dependent);
1063 InitBuiltinType(
OverloadTy, BuiltinType::Overload);
1072 InitBuiltinType(
UnknownAnyTy, BuiltinType::UnknownAny);
1078 InitBuiltinType(
BuiltinFnTy, BuiltinType::BuiltinFn);
1081 if (LangOpts.OpenMP)
1095 if (LangOpts.OpenCL) {
1096 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
1097 InitBuiltinType(SingletonId, BuiltinType::Id);
1098 #include "clang/Basic/OpenCLImageTypes.def"
1100 InitBuiltinType(
OCLSamplerTy, BuiltinType::OCLSampler);
1101 InitBuiltinType(
OCLEventTy, BuiltinType::OCLEvent);
1103 InitBuiltinType(
OCLQueueTy, BuiltinType::OCLQueue);
1104 InitBuiltinType(
OCLNDRangeTy, BuiltinType::OCLNDRange);
1112 ObjCConstantStringType =
QualType();
1120 InitBuiltinType(
NullPtrTy, BuiltinType::NullPtr);
1123 InitBuiltinType(
HalfTy, BuiltinType::Half);
1146 if (Pos != DeclAttrs.end()) {
1147 Pos->second->~AttrVec();
1148 DeclAttrs.erase(Pos);
1163 TemplateOrInstantiation.find(Var);
1164 if (Pos == TemplateOrInstantiation.end())
1177 Tmpl, TSK, PointOfInstantiation));
1183 assert(!TemplateOrInstantiation[Inst] &&
1184 "Already noted what the variable was instantiated from");
1185 TemplateOrInstantiation[Inst] = TSI;
1190 assert(FD &&
"Specialization is 0");
1191 llvm::DenseMap<const FunctionDecl*, FunctionDecl *>::const_iterator Pos
1192 = ClassScopeSpecializationPattern.find(FD);
1193 if (Pos == ClassScopeSpecializationPattern.end())
1201 assert(FD &&
"Specialization is 0");
1202 assert(Pattern &&
"Class scope specialization pattern is 0");
1203 ClassScopeSpecializationPattern[FD] = Pattern;
1208 llvm::DenseMap<UsingDecl *, NamedDecl *>::const_iterator Pos
1209 = InstantiatedFromUsingDecl.find(UUD);
1210 if (Pos == InstantiatedFromUsingDecl.end())
1218 assert((isa<UsingDecl>(Pattern) ||
1219 isa<UnresolvedUsingValueDecl>(Pattern) ||
1220 isa<UnresolvedUsingTypenameDecl>(Pattern)) &&
1221 "pattern decl is not a using decl");
1222 assert(!InstantiatedFromUsingDecl[Inst] &&
"pattern already exists");
1223 InstantiatedFromUsingDecl[Inst] = Pattern;
1228 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>::const_iterator Pos
1229 = InstantiatedFromUsingShadowDecl.find(Inst);
1230 if (Pos == InstantiatedFromUsingShadowDecl.end())
1239 assert(!InstantiatedFromUsingShadowDecl[Inst] &&
"pattern already exists");
1240 InstantiatedFromUsingShadowDecl[Inst] = Pattern;
1245 = InstantiatedFromUnnamedFieldDecl.find(Field);
1246 if (Pos == InstantiatedFromUnnamedFieldDecl.end())
1254 assert(!Inst->
getDeclName() &&
"Instantiated field decl is not unnamed");
1255 assert(!Tmpl->
getDeclName() &&
"Template field decl is not unnamed");
1256 assert(!InstantiatedFromUnnamedFieldDecl[Inst] &&
1257 "Already noted what unnamed field was instantiated from");
1259 InstantiatedFromUnnamedFieldDecl[Inst] = Tmpl;
1264 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector>::const_iterator Pos =
1266 if (Pos == OverriddenMethods.end())
1268 return Pos->second.begin();
1273 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector>::const_iterator Pos =
1275 if (Pos == OverriddenMethods.end())
1277 return Pos->second.end();
1282 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector>::const_iterator Pos =
1284 if (Pos == OverriddenMethods.end())
1286 return Pos->second.size();
1297 assert(Method->isCanonicalDecl() && Overridden->isCanonicalDecl());
1298 OverriddenMethods[Method].push_back(Overridden);
1306 if (
const CXXMethodDecl *CXXMethod = dyn_cast<CXXMethodDecl>(D)) {
1318 Overridden.append(OverDecls.begin(), OverDecls.end());
1322 assert(!Import->NextLocalImport &&
"Import declaration already in the chain");
1323 assert(!Import->isFromASTFile() &&
"Non-local import declaration");
1324 if (!FirstLocalImport) {
1325 FirstLocalImport = Import;
1326 LastLocalImport = Import;
1330 LastLocalImport->NextLocalImport = Import;
1331 LastLocalImport = Import;
1342 assert(BT &&
"Not a floating point type!");
1344 default: llvm_unreachable(
"Not a floating point type!");
1356 bool UseAlignAttrOnly =
false;
1357 if (
unsigned AlignFromAttr = D->getMaxAlignment()) {
1358 Align = AlignFromAttr;
1366 if (isa<FieldDecl>(D)) {
1367 UseAlignAttrOnly = D->hasAttr<PackedAttr>() ||
1368 cast<FieldDecl>(D)->getParent()->hasAttr<PackedAttr>();
1370 UseAlignAttrOnly =
true;
1373 else if (isa<FieldDecl>(D))
1375 D->hasAttr<PackedAttr>() ||
1376 cast<FieldDecl>(D)->getParent()->hasAttr<PackedAttr>();
1380 if (UseAlignAttrOnly) {
1383 }
else if (
const ValueDecl *VD = dyn_cast<ValueDecl>(D)) {
1397 if (!ForAlignof && MinWidth) {
1398 if (isa<VariableArrayType>(arrayType))
1400 else if (isa<ConstantArrayType>(arrayType) &&
1401 MinWidth <= getTypeSize(cast<ConstantArrayType>(arrayType)))
1406 if (
const VarDecl *VD = dyn_cast<VarDecl>(D)) {
1407 if (VD->hasGlobalStorage() && !ForAlignof)
1417 if (
const FieldDecl *Field = dyn_cast<FieldDecl>(VD)) {
1418 const RecordDecl *Parent = Field->getParent();
1420 if (!Parent->isInvalidDecl()) {
1431 uint64_t LowBitOfOffset = Offset & (~Offset + 1);
1432 if (LowBitOfOffset < FieldAlign)
1433 FieldAlign =
static_cast<unsigned>(LowBitOfOffset);
1436 Align =
std::min(Align, FieldAlign);
1448 std::pair<CharUnits, CharUnits>
1462 return sizeAndAlign;
1467 std::pair<CharUnits, CharUnits>
1470 std::pair<CharUnits, CharUnits> EltInfo =
1472 uint64_t Size = CAT->
getSize().getZExtValue();
1473 assert((Size == 0 || static_cast<uint64_t>(EltInfo.first.getQuantity()) <=
1474 (uint64_t)(-1)/Size) &&
1475 "Overflow in array type char size evaluation");
1476 uint64_t Width = EltInfo.first.getQuantity() * Size;
1477 unsigned Align = EltInfo.second.getQuantity();
1480 Width = llvm::alignTo(Width, Align);
1485 std::pair<CharUnits, CharUnits>
1494 std::pair<CharUnits, CharUnits>
1509 if (I != MemoizedTypeInfo.end())
1514 MemoizedTypeInfo[T] = TI;
1524 TypeInfo ASTContext::getTypeInfoImpl(
const Type *T)
const {
1527 bool AlignIsRequired =
false;
1529 #define TYPE(Class, Base)
1530 #define ABSTRACT_TYPE(Class, Base)
1531 #define NON_CANONICAL_TYPE(Class, Base)
1532 #define DEPENDENT_TYPE(Class, Base) case Type::Class:
1533 #define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) \
1535 assert(!T->isDependentType() && "should not see dependent types here"); \
1536 return getTypeInfo(cast<Class##Type>(T)->desugar().getTypePtr());
1537 #include "clang/AST/TypeNodes.def"
1538 llvm_unreachable(
"Should not see dependent types");
1540 case Type::FunctionNoProto:
1541 case Type::FunctionProto:
1547 case Type::IncompleteArray:
1548 case Type::VariableArray:
1550 Align =
getTypeAlign(cast<ArrayType>(T)->getElementType());
1553 case Type::ConstantArray: {
1557 uint64_t Size = CAT->
getSize().getZExtValue();
1558 assert((Size == 0 || EltInfo.Width <= (uint64_t)(-1) / Size) &&
1559 "Overflow in array type bit size evaluation");
1560 Width = EltInfo.Width * Size;
1561 Align = EltInfo.Align;
1564 Width = llvm::alignTo(Width, Align);
1567 case Type::ExtVector:
1568 case Type::Vector: {
1575 if (Align & (Align-1)) {
1576 Align = llvm::NextPowerOf2(Align);
1577 Width = llvm::alignTo(Width, Align);
1581 if (TargetVectorAlign && TargetVectorAlign < Align)
1582 Align = TargetVectorAlign;
1587 switch (cast<BuiltinType>(T)->
getKind()) {
1588 default: llvm_unreachable(
"Unknown builtin type!");
1589 case BuiltinType::Void:
1595 case BuiltinType::Bool:
1599 case BuiltinType::Char_S:
1600 case BuiltinType::Char_U:
1601 case BuiltinType::UChar:
1602 case BuiltinType::SChar:
1606 case BuiltinType::WChar_S:
1607 case BuiltinType::WChar_U:
1611 case BuiltinType::Char16:
1615 case BuiltinType::Char32:
1619 case BuiltinType::UShort:
1620 case BuiltinType::Short:
1624 case BuiltinType::UInt:
1625 case BuiltinType::Int:
1629 case BuiltinType::ULong:
1630 case BuiltinType::Long:
1634 case BuiltinType::ULongLong:
1635 case BuiltinType::LongLong:
1639 case BuiltinType::Int128:
1640 case BuiltinType::UInt128:
1644 case BuiltinType::Half:
1648 case BuiltinType::Float:
1652 case BuiltinType::Double:
1656 case BuiltinType::LongDouble:
1660 case BuiltinType::Float128:
1664 case BuiltinType::NullPtr:
1668 case BuiltinType::ObjCId:
1669 case BuiltinType::ObjCClass:
1670 case BuiltinType::ObjCSel:
1674 case BuiltinType::OCLSampler:
1679 case BuiltinType::OCLEvent:
1680 case BuiltinType::OCLClkEvent:
1681 case BuiltinType::OCLQueue:
1682 case BuiltinType::OCLNDRange:
1683 case BuiltinType::OCLReserveID:
1684 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
1685 case BuiltinType::Id:
1686 #include "clang/Basic/OpenCLImageTypes.def"
1694 case Type::ObjCObjectPointer:
1698 case Type::BlockPointer: {
1700 cast<BlockPointerType>(T)->getPointeeType());
1705 case Type::LValueReference:
1706 case Type::RValueReference: {
1710 cast<ReferenceType>(T)->getPointeeType());
1715 case Type::Pointer: {
1721 case Type::MemberPointer: {
1723 std::tie(Width, Align) = ABI->getMemberPointerWidthAndAlign(MPT);
1726 case Type::Complex: {
1730 Width = EltInfo.
Width * 2;
1731 Align = EltInfo.
Align;
1734 case Type::ObjCObject:
1735 return getTypeInfo(cast<ObjCObjectType>(T)->getBaseType().getTypePtr());
1736 case Type::Adjusted:
1739 case Type::ObjCInterface: {
1742 Width =
toBits(Layout.getSize());
1743 Align =
toBits(Layout.getAlignment());
1748 const TagType *TT = cast<TagType>(T);
1750 if (TT->
getDecl()->isInvalidDecl()) {
1756 if (
const EnumType *ET = dyn_cast<EnumType>(TT)) {
1757 const EnumDecl *ED = ET->getDecl();
1760 if (
unsigned AttrAlign = ED->getMaxAlignment()) {
1761 Info.
Align = AttrAlign;
1772 AlignIsRequired = RD->hasAttr<AlignedAttr>();
1776 case Type::SubstTemplateTypeParm:
1777 return getTypeInfo(cast<SubstTemplateTypeParmType>(T)->
1778 getReplacementType().getTypePtr());
1781 const AutoType *A = cast<AutoType>(T);
1783 "cannot request the size of an undeduced or dependent auto type");
1788 return getTypeInfo(cast<ParenType>(T)->getInnerType().getTypePtr());
1790 case Type::Typedef: {
1796 if (
unsigned AttrAlign = Typedef->getMaxAlignment()) {
1798 AlignIsRequired =
true;
1807 case Type::Elaborated:
1808 return getTypeInfo(cast<ElaboratedType>(T)->getNamedType().getTypePtr());
1810 case Type::Attributed:
1812 cast<AttributedType>(T)->getEquivalentType().getTypePtr());
1814 case Type::Atomic: {
1823 if (Width != 0 && Width <= Target->getMaxAtomicPromoteWidth()) {
1825 if (!llvm::isPowerOf2_64(Width))
1826 Width = llvm::NextPowerOf2(Width);
1829 Align =
static_cast<unsigned>(Width);
1842 assert(llvm::isPowerOf2_32(Align) &&
"Alignment must be power of 2");
1843 return TypeInfo(Width, Align, AlignIsRequired);
1849 if ((
getTargetInfo().getTriple().getArch() == llvm::Triple::ppc64 ||
1850 getTargetInfo().getTriple().getArch() == llvm::Triple::ppc64le) &&
1891 unsigned ABIAlign = TI.
Align;
1904 T = CT->getElementType().getTypePtr();
1906 T = ET->getDecl()->getIntegerType().getTypePtr();
1959 for (
const auto *
I : OI->
ivars())
1965 Ivars.push_back(Iv);
1972 llvm::SmallPtrSet<ObjCProtocolDecl*, 8> &Protocols) {
1976 for (
auto *Proto : OI->all_referenced_protocols()) {
1981 for (
const auto *Cat : OI->visible_categories())
1987 SD = SD->getSuperClass();
1989 }
else if (
const ObjCCategoryDecl *OC = dyn_cast<ObjCCategoryDecl>(CDecl)) {
1990 for (
auto *Proto : OC->protocols()) {
1993 }
else if (
const ObjCProtocolDecl *OP = dyn_cast<ObjCProtocolDecl>(CDecl)) {
1995 if (!Protocols.insert(
1996 const_cast<ObjCProtocolDecl *>(OP->getCanonicalDecl())).second)
1999 for (
auto *Proto : OP->protocols())
2008 count += Ext->ivar_size();
2013 count += ImplDecl->ivar_size();
2031 if (isa<GNUNullExpr>(E))
return true;
2039 I = ObjCImpls.find(D);
2040 if (I != ObjCImpls.end())
2041 return cast<ObjCImplementationDecl>(I->second);
2047 I = ObjCImpls.find(D);
2048 if (I != ObjCImpls.end())
2049 return cast<ObjCCategoryImplDecl>(I->second);
2056 assert(IFaceD && ImplD &&
"Passed null params");
2057 ObjCImpls[IFaceD] = ImplD;
2062 assert(CatD && ImplD &&
"Passed null params");
2063 ObjCImpls[CatD] = ImplD;
2068 return ObjCMethodRedecls.lookup(MD);
2074 ObjCMethodRedecls[MD] = Redecl;
2080 dyn_cast<ObjCInterfaceDecl>(ND->getDeclContext()))
2083 dyn_cast<ObjCCategoryDecl>(ND->getDeclContext()))
2084 return CD->getClassInterface();
2086 dyn_cast<ObjCImplDecl>(ND->getDeclContext()))
2087 return IMD->getClassInterface();
2095 assert(VD &&
"Passed null params");
2096 assert(VD->hasAttr<BlocksAttr>() &&
2097 "getBlockVarCopyInits - not __block var");
2099 I = BlockVarCopyInits.find(VD);
2100 return (I != BlockVarCopyInits.end()) ? cast<Expr>(I->second) :
nullptr;
2105 assert(VD && Init &&
"Passed null params");
2106 assert(VD->hasAttr<BlocksAttr>() &&
2107 "setBlockVarCopyInits - not __block var");
2108 BlockVarCopyInits[VD] = Init;
2112 unsigned DataSize)
const {
2117 "incorrect data size provided to CreateTypeSourceInfo!");
2134 return getObjCLayout(D,
nullptr);
2148 ASTContext::getExtQualType(
const Type *baseType,
Qualifiers quals)
const {
2153 llvm::FoldingSetNodeID
ID;
2155 void *insertPos =
nullptr;
2156 if (
ExtQuals *eq = ExtQualNodes.FindNodeOrInsertPos(ID, insertPos)) {
2157 assert(eq->getQualifiers() == quals);
2166 canon = getExtQualType(canonSplit.
Ty, canonSplit.
Quals);
2169 (void) ExtQualNodes.FindNodeOrInsertPos(ID, insertPos);
2173 ExtQualNodes.InsertNode(eq, insertPos);
2191 "Type cannot be in multiple addr spaces!");
2194 return getExtQualType(TypeNode, Quals);
2219 "Type cannot have multiple ObjCGCs!");
2222 return getExtQualType(TypeNode, Quals);
2240 return cast<FunctionType>(Result.
getTypePtr());
2256 L->DeducedReturnType(FD, ResultType);
2267 if (
auto *PT = dyn_cast<ParenType>(Orig))
2272 if (
auto *AT = dyn_cast<AttributedType>(Orig))
2302 if (TSInfo->getType() != FD->
getType())
2310 "TypeLoc size mismatch from updating exception specification");
2311 TSInfo->overrideType(Updated);
2320 llvm::FoldingSetNodeID
ID;
2323 void *InsertPos =
nullptr;
2324 if (
ComplexType *CT = ComplexTypes.FindNodeOrInsertPos(ID, InsertPos))
2334 ComplexType *NewIP = ComplexTypes.FindNodeOrInsertPos(ID, InsertPos);
2335 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2338 Types.push_back(New);
2339 ComplexTypes.InsertNode(New, InsertPos);
2348 llvm::FoldingSetNodeID
ID;
2351 void *InsertPos =
nullptr;
2352 if (
PointerType *PT = PointerTypes.FindNodeOrInsertPos(ID, InsertPos))
2362 PointerType *NewIP = PointerTypes.FindNodeOrInsertPos(ID, InsertPos);
2363 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2366 Types.push_back(New);
2367 PointerTypes.InsertNode(New, InsertPos);
2372 llvm::FoldingSetNodeID
ID;
2374 void *InsertPos =
nullptr;
2375 AdjustedType *AT = AdjustedTypes.FindNodeOrInsertPos(ID, InsertPos);
2382 AT = AdjustedTypes.FindNodeOrInsertPos(ID, InsertPos);
2383 assert(!AT &&
"Shouldn't be in the map!");
2387 Types.push_back(AT);
2388 AdjustedTypes.InsertNode(AT, InsertPos);
2412 llvm::FoldingSetNodeID
ID;
2414 void *InsertPos =
nullptr;
2415 AdjustedType *AT = AdjustedTypes.FindNodeOrInsertPos(ID, InsertPos);
2422 AT = AdjustedTypes.FindNodeOrInsertPos(ID, InsertPos);
2423 assert(!AT &&
"Shouldn't be in the map!");
2426 Types.push_back(AT);
2427 AdjustedTypes.InsertNode(AT, InsertPos);
2437 llvm::FoldingSetNodeID
ID;
2440 void *InsertPos =
nullptr;
2442 BlockPointerTypes.FindNodeOrInsertPos(ID, InsertPos))
2453 BlockPointerTypes.FindNodeOrInsertPos(ID, InsertPos);
2454 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2458 Types.push_back(New);
2459 BlockPointerTypes.InsertNode(New, InsertPos);
2468 "Unresolved overloaded function type");
2472 llvm::FoldingSetNodeID
ID;
2475 void *InsertPos =
nullptr;
2477 LValueReferenceTypes.FindNodeOrInsertPos(ID, InsertPos))
2485 if (!SpelledAsLValue || InnerRef || !T.
isCanonical()) {
2491 LValueReferenceTypes.FindNodeOrInsertPos(ID, InsertPos);
2492 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2498 Types.push_back(New);
2499 LValueReferenceTypes.InsertNode(New, InsertPos);
2509 llvm::FoldingSetNodeID
ID;
2512 void *InsertPos =
nullptr;
2514 RValueReferenceTypes.FindNodeOrInsertPos(ID, InsertPos))
2528 RValueReferenceTypes.FindNodeOrInsertPos(ID, InsertPos);
2529 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2534 Types.push_back(New);
2535 RValueReferenceTypes.InsertNode(New, InsertPos);
2544 llvm::FoldingSetNodeID
ID;
2547 void *InsertPos =
nullptr;
2549 MemberPointerTypes.FindNodeOrInsertPos(ID, InsertPos))
2560 MemberPointerTypes.FindNodeOrInsertPos(ID, InsertPos);
2561 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2565 Types.push_back(New);
2566 MemberPointerTypes.InsertNode(New, InsertPos);
2573 const llvm::APInt &ArySizeIn,
2575 unsigned IndexTypeQuals)
const {
2578 "Constant array of VLAs is illegal!");
2582 llvm::APInt ArySize(ArySizeIn);
2586 llvm::FoldingSetNodeID
ID;
2589 void *InsertPos =
nullptr;
2591 ConstantArrayTypes.FindNodeOrInsertPos(ID, InsertPos))
2600 ASM, IndexTypeQuals);
2605 ConstantArrayTypes.FindNodeOrInsertPos(ID, InsertPos);
2606 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2611 ConstantArrayTypes.InsertNode(New, InsertPos);
2612 Types.push_back(New);
2626 const Type *ty = split.
Ty;
2628 #define TYPE(Class, Base)
2629 #define ABSTRACT_TYPE(Class, Base)
2630 #define NON_CANONICAL_TYPE(Class, Base) case Type::Class:
2631 #include "clang/AST/TypeNodes.def"
2632 llvm_unreachable(
"didn't desugar past all non-canonical types?");
2638 case Type::ExtVector:
2639 case Type::DependentSizedExtVector:
2640 case Type::ObjCObject:
2641 case Type::ObjCInterface:
2642 case Type::ObjCObjectPointer:
2645 case Type::UnresolvedUsing:
2646 case Type::TypeOfExpr:
2648 case Type::Decltype:
2649 case Type::UnaryTransform:
2650 case Type::DependentName:
2651 case Type::InjectedClassName:
2652 case Type::TemplateSpecialization:
2653 case Type::DependentTemplateSpecialization:
2654 case Type::TemplateTypeParm:
2655 case Type::SubstTemplateTypeParmPack:
2657 case Type::PackExpansion:
2658 llvm_unreachable(
"type should never be variably-modified");
2662 case Type::FunctionNoProto:
2663 case Type::FunctionProto:
2664 case Type::BlockPointer:
2665 case Type::MemberPointer:
2675 cast<PointerType>(ty)->getPointeeType()));
2678 case Type::LValueReference: {
2686 case Type::RValueReference: {
2693 case Type::Atomic: {
2699 case Type::ConstantArray: {
2709 case Type::DependentSizedArray: {
2721 case Type::IncompleteArray: {
2733 case Type::VariableArray: {
2754 unsigned IndexTypeQuals,
2764 IndexTypeQuals, Brackets);
2771 VariableArrayTypes.push_back(New);
2772 Types.push_back(New);
2782 unsigned elementTypeQuals,
2786 "Size must be type- or value-dependent!");
2796 numElements, ASM, elementTypeQuals,
2798 Types.push_back(newType);
2807 void *insertPos =
nullptr;
2808 llvm::FoldingSetNodeID
ID;
2811 ASM, elementTypeQuals, numElements);
2815 DependentSizedArrayTypes.FindNodeOrInsertPos(ID, insertPos);
2821 QualType(), numElements, ASM, elementTypeQuals,
2823 DependentSizedArrayTypes.InsertNode(canonTy, insertPos);
2824 Types.push_back(canonTy);
2829 canonElementType.
Quals);
2833 if (
QualType(canonElementType.
Ty, 0) == elementType &&
2842 ASM, elementTypeQuals, brackets);
2843 Types.push_back(sugaredType);
2849 unsigned elementTypeQuals)
const {
2850 llvm::FoldingSetNodeID
ID;
2853 void *insertPos =
nullptr;
2855 IncompleteArrayTypes.FindNodeOrInsertPos(ID, insertPos))
2866 ASM, elementTypeQuals);
2871 IncompleteArrayTypes.FindNodeOrInsertPos(ID, insertPos);
2872 assert(!existing &&
"Shouldn't be in the map!"); (void) existing;
2878 IncompleteArrayTypes.InsertNode(newType, insertPos);
2879 Types.push_back(newType);
2890 llvm::FoldingSetNodeID
ID;
2893 void *InsertPos =
nullptr;
2894 if (
VectorType *VTP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos))
2904 VectorType *NewIP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos);
2905 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2908 VectorType(vecType, NumElts, Canonical, VecKind);
2909 VectorTypes.InsertNode(New, InsertPos);
2910 Types.push_back(New);
2921 llvm::FoldingSetNodeID
ID;
2924 void *InsertPos =
nullptr;
2925 if (
VectorType *VTP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos))
2935 VectorType *NewIP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos);
2936 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
2940 VectorTypes.InsertNode(New, InsertPos);
2941 Types.push_back(New);
2949 llvm::FoldingSetNodeID
ID;
2953 void *InsertPos =
nullptr;
2955 = DependentSizedExtVectorTypes.FindNodeOrInsertPos(ID, InsertPos);
2965 if (CanonVecTy == vecType) {
2971 = DependentSizedExtVectorTypes.FindNodeOrInsertPos(ID, InsertPos);
2972 assert(!CanonCheck &&
"Dependent-sized ext_vector canonical type broken");
2974 DependentSizedExtVectorTypes.InsertNode(New, InsertPos);
2983 Types.push_back(New);
3001 llvm::FoldingSetNodeID
ID;
3004 void *InsertPos =
nullptr;
3006 FunctionNoProtoTypes.FindNodeOrInsertPos(ID, InsertPos))
3016 FunctionNoProtoTypes.FindNodeOrInsertPos(ID, InsertPos);
3017 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
3022 Types.push_back(New);
3023 FunctionNoProtoTypes.InsertNode(New, InsertPos);
3039 return CanResultType;
3045 size_t NumArgs = ArgArray.size();
3049 llvm::FoldingSetNodeID
ID;
3053 void *InsertPos =
nullptr;
3055 FunctionProtoTypes.FindNodeOrInsertPos(ID, InsertPos))
3061 !EPI.HasTrailingReturn;
3062 for (
unsigned i = 0; i != NumArgs && isCanonical; ++i)
3063 if (!ArgArray[i].isCanonicalAsParam())
3064 isCanonical =
false;
3071 CanonicalArgs.reserve(NumArgs);
3072 for (
unsigned i = 0; i !=
NumArgs; ++i)
3081 Canonical =
getFunctionType(CanResultTy, CanonicalArgs, CanonicalEPI);
3085 FunctionProtoTypes.FindNodeOrInsertPos(ID, InsertPos);
3086 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
3101 Size += EPI.ExceptionSpec.Exceptions.size() *
sizeof(
QualType);
3103 Size +=
sizeof(
Expr*);
3116 if (EPI.ExtParameterInfos) {
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!");
3398 ArgVec.reserve(Args.
size());
3400 ArgVec.push_back(Arg.getArgument());
3408 if (Arg.isPackExpansion())
3420 "No dependent template names here!");
3429 if (!Underlying.
isNull())
3435 "Caller must compute aliased type");
3436 IsTypeAlias =
false;
3445 (IsTypeAlias?
sizeof(
QualType) : 0),
3449 IsTypeAlias ? Underlying :
QualType());
3451 Types.push_back(Spec);
3458 "No dependent template names here!");
3467 unsigned NumArgs = Args.size();
3468 CanonArgs.reserve(NumArgs);
3474 llvm::FoldingSetNodeID
ID;
3478 void *InsertPos =
nullptr;
3480 = TemplateSpecializationTypes.FindNodeOrInsertPos(ID, InsertPos);
3490 Types.push_back(Spec);
3491 TemplateSpecializationTypes.InsertNode(Spec, InsertPos);
3494 assert(Spec->isDependentType() &&
3495 "Non-dependent template-id type must have a canonical type");
3503 llvm::FoldingSetNodeID
ID;
3506 void *InsertPos =
nullptr;
3507 ElaboratedType *T = ElaboratedTypes.FindNodeOrInsertPos(ID, InsertPos);
3514 ElaboratedType *CheckT = ElaboratedTypes.FindNodeOrInsertPos(ID, InsertPos);
3515 assert(!CheckT &&
"Elaborated canonical type broken");
3521 ElaboratedTypes.InsertNode(T, InsertPos);
3527 llvm::FoldingSetNodeID
ID;
3530 void *InsertPos =
nullptr;
3531 ParenType *T = ParenTypes.FindNodeOrInsertPos(ID, InsertPos);
3538 ParenType *CheckT = ParenTypes.FindNodeOrInsertPos(ID, InsertPos);
3539 assert(!CheckT &&
"Paren canonical type broken");
3545 ParenTypes.InsertNode(T, InsertPos);
3559 if (CanonNNS != NNS || CanonKeyword != Keyword)
3563 llvm::FoldingSetNodeID
ID;
3566 void *InsertPos =
nullptr;
3568 = DependentNameTypes.FindNodeOrInsertPos(ID, InsertPos);
3574 DependentNameTypes.InsertNode(T, InsertPos);
3586 for (
unsigned I = 0,
E = Args.
size();
I !=
E; ++
I)
3587 ArgCopy.push_back(Args[
I].getArgument());
3598 "nested-name-specifier must be dependent");
3600 llvm::FoldingSetNodeID
ID;
3604 void *InsertPos =
nullptr;
3606 = DependentTemplateSpecializationTypes.FindNodeOrInsertPos(ID, InsertPos);
3615 bool AnyNonCanonArgs =
false;
3616 unsigned NumArgs = Args.size();
3620 if (!CanonArgs[I].structurallyEquals(Args[I]))
3621 AnyNonCanonArgs =
true;
3625 if (AnyNonCanonArgs || CanonNNS != NNS || CanonKeyword != Keyword) {
3631 DependentTemplateSpecializationTypes.FindNodeOrInsertPos(ID, InsertPos);
3640 DependentTemplateSpecializationTypes.InsertNode(T, InsertPos);
3646 llvm::FoldingSetNodeID
ID;
3650 "Pack expansions must expand one or more parameter packs");
3651 void *InsertPos =
nullptr;
3653 = PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos);
3668 PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos);
3675 PackExpansionTypes.InsertNode(T, InsertPos);
3687 if (Protocols.empty())
return true;
3692 for (
unsigned i = 1; i != Protocols.size(); ++i)
3694 Protocols[i]->getCanonicalDecl() != Protocols[i])
3702 llvm::array_pod_sort(Protocols.begin(), Protocols.end(),
CmpProtocolNames);
3706 P =
P->getCanonicalDecl();
3709 auto ProtocolsEnd = std::unique(Protocols.begin(), Protocols.end());
3710 Protocols.erase(ProtocolsEnd, Protocols.end());
3715 unsigned NumProtocols)
const {
3717 llvm::makeArrayRef(Protocols, NumProtocols),
3725 bool isKindOf)
const {
3728 if (typeArgs.empty() && protocols.empty() && !isKindOf &&
3729 isa<ObjCInterfaceType>(baseType))
3733 llvm::FoldingSetNodeID
ID;
3735 void *InsertPos =
nullptr;
3736 if (
ObjCObjectType *QT = ObjCObjectTypes.FindNodeOrInsertPos(ID, InsertPos))
3743 if (effectiveTypeArgs.empty()) {
3745 effectiveTypeArgs = baseObject->getTypeArgs();
3752 bool typeArgsAreCanonical = std::all_of(effectiveTypeArgs.begin(),
3753 effectiveTypeArgs.end(),
3755 return type.isCanonical();
3758 if (!typeArgsAreCanonical || !protocolsSorted || !baseType.
isCanonical()) {
3762 if (!typeArgsAreCanonical) {
3763 canonTypeArgsVec.reserve(effectiveTypeArgs.size());
3764 for (
auto typeArg : effectiveTypeArgs)
3766 canonTypeArgs = canonTypeArgsVec;
3768 canonTypeArgs = effectiveTypeArgs;
3773 if (!protocolsSorted) {
3774 canonProtocolsVec.append(protocols.begin(), protocols.end());
3776 canonProtocols = canonProtocolsVec;
3778 canonProtocols = protocols;
3782 canonProtocols, isKindOf);
3785 ObjCObjectTypes.FindNodeOrInsertPos(ID, InsertPos);
3789 size += typeArgs.size() *
sizeof(
QualType);
3797 ObjCObjectTypes.InsertNode(T, InsertPos);
3811 for (
auto *Proto : OPT->quals()) {
3832 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> InheritedProtocols;
3834 if (InheritedProtocols.empty())
3838 bool Conforms =
false;
3839 for (
auto *Proto : OPT->
quals()) {
3841 for (
auto *PI : InheritedProtocols) {
3853 for (
auto *PI : InheritedProtocols) {
3855 bool Adopts =
false;
3856 for (
auto *Proto : OPT->
quals()) {
3870 llvm::FoldingSetNodeID
ID;
3873 void *InsertPos =
nullptr;
3875 ObjCObjectPointerTypes.FindNodeOrInsertPos(ID, InsertPos))
3884 ObjCObjectPointerTypes.FindNodeOrInsertPos(ID, InsertPos);
3892 Types.push_back(QType);
3893 ObjCObjectPointerTypes.InsertNode(QType, InsertPos);
3901 if (Decl->TypeForDecl)
3902 return QualType(Decl->TypeForDecl, 0);
3905 assert(PrevDecl->TypeForDecl &&
"previous decl has no TypeForDecl");
3906 Decl->TypeForDecl = PrevDecl->TypeForDecl;
3907 return QualType(PrevDecl->TypeForDecl, 0);
3916 Decl->TypeForDecl = T;
3929 llvm::FoldingSetNodeID
ID;
3932 void *InsertPos =
nullptr;
3934 = DependentTypeOfExprTypes.FindNodeOrInsertPos(ID, InsertPos);
3944 DependentTypeOfExprTypes.InsertNode(Canon, InsertPos);
3951 Types.push_back(toe);
3963 Types.push_back(tot);
3979 llvm::FoldingSetNodeID
ID;
3982 void *InsertPos =
nullptr;
3984 = DependentDecltypeTypes.FindNodeOrInsertPos(ID, InsertPos);
3988 DependentDecltypeTypes.InsertNode(Canon, InsertPos);
3996 Types.push_back(dt);
4010 llvm::FoldingSetNodeID
ID;
4013 void *InsertPos =
nullptr;
4015 = DependentUnaryTransformTypes.FindNodeOrInsertPos(ID, InsertPos);
4022 DependentUnaryTransformTypes.InsertNode(Canon, InsertPos);
4030 UnderlyingType, Kind,
4033 Types.push_back(ut);
4041 bool IsDependent)
const {
4046 void *InsertPos =
nullptr;
4047 llvm::FoldingSetNodeID
ID;
4049 if (
AutoType *AT = AutoTypes.FindNodeOrInsertPos(ID, InsertPos))
4055 Types.push_back(AT);
4057 AutoTypes.InsertNode(AT, InsertPos);
4066 llvm::FoldingSetNodeID
ID;
4069 void *InsertPos =
nullptr;
4070 if (
AtomicType *AT = AtomicTypes.FindNodeOrInsertPos(ID, InsertPos))
4080 AtomicType *NewIP = AtomicTypes.FindNodeOrInsertPos(ID, InsertPos);
4081 assert(!NewIP &&
"Shouldn't be in the map!"); (void)NewIP;
4084 Types.push_back(New);
4085 AtomicTypes.InsertNode(New, InsertPos);
4178 if (isa<ArrayType>(Ty)) {
4180 }
else if (isa<FunctionType>(Ty)) {
4202 quals = splitType.
Quals;
4212 if (elementType == unqualElementType) {
4213 assert(quals.
empty());
4214 quals = splitType.
Quals;
4234 VAT->getSizeModifier(),
4235 VAT->getIndexTypeCVRQualifiers(),
4236 VAT->getBracketsRange());
4256 if (T1PtrType && T2PtrType) {
4264 if (T1MPType && T2MPType &&
4266 QualType(T2MPType->getClass(), 0))) {
4275 if (T1OPType && T2OPType) {
4334 llvm_unreachable(
"bad template name kind!");
4343 = dyn_cast<TemplateTemplateParmDecl>(Template))
4344 Template = getCanonicalTemplateTemplateParmDecl(TTP);
4347 return TemplateName(cast<TemplateDecl>(Template->getCanonicalDecl()));
4351 llvm_unreachable(
"cannot canonicalize overloaded template");
4355 assert(DTN &&
"Non-dependent template names must refer to template decls.");
4356 return DTN->CanonicalTemplateName;
4376 llvm_unreachable(
"bad template name!");
4426 A != AEnd; (void)++A, ++Idx)
4429 return TemplateArgument(llvm::makeArrayRef(CanonArgs, Arg.
pack_size()));
4434 llvm_unreachable(
"Unhandled template argument kind");
4490 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
4497 if (
const ArrayType *AT = dyn_cast<ArrayType>(T))
4518 if (!ATy || qs.
empty())
4531 IAT->getSizeModifier(),
4532 IAT->getIndexTypeCVRQualifiers()));
4535 = dyn_cast<DependentSizedArrayType>(ATy))
4536 return cast<ArrayType>(
4538 DSAT->getSizeExpr(),
4539 DSAT->getSizeModifier(),
4540 DSAT->getIndexTypeCVRQualifiers(),
4541 DSAT->getBracketsRange()));
4588 assert(PrettyArrayType &&
"Not an array type!");
4617 uint64_t ElementCount = 1;
4619 ElementCount *= CA->
getSize().getZExtValue();
4620 CA = dyn_cast_or_null<ConstantArrayType>(
4623 return ElementCount;
4632 assert(T->
getAs<
BuiltinType>() &&
"getFloatingRank(): not a floating type");
4634 default: llvm_unreachable(
"getFloatingRank(): not a floating type");
4635 case BuiltinType::Half:
return HalfRank;
4636 case BuiltinType::Float:
return FloatRank;
4652 case HalfRank: llvm_unreachable(
"Complex half is not supported");
4668 llvm_unreachable(
"getFloatingRank(): illegal value for rank");
4689 unsigned ASTContext::getIntegerRank(
const Type *T)
const {
4692 switch (cast<BuiltinType>(T)->getKind()) {
4693 default: llvm_unreachable(
"getIntegerRank(): not a built-in integer");
4694 case BuiltinType::Bool:
4696 case BuiltinType::Char_S:
4697 case BuiltinType::Char_U:
4698 case BuiltinType::SChar:
4699 case BuiltinType::UChar:
4701 case BuiltinType::Short:
4702 case BuiltinType::UShort:
4704 case BuiltinType::Int:
4705 case BuiltinType::UInt:
4707 case BuiltinType::Long:
4708 case BuiltinType::ULong:
4710 case BuiltinType::LongLong:
4711 case BuiltinType::ULongLong:
4713 case BuiltinType::Int128:
4714 case BuiltinType::UInt128:
4754 if (BitWidth < IntSize)
4757 if (BitWidth == IntSize)
4772 assert(!Promotable.
isNull());
4775 return ET->getDecl()->getPromotionType();
4784 if (BT->getKind() == BuiltinType::WChar_S ||
4785 BT->getKind() == BuiltinType::WChar_U ||
4786 BT->getKind() == BuiltinType::Char16 ||
4787 BT->getKind() == BuiltinType::Char32) {
4788 bool FromIsSigned = BT->getKind() == BuiltinType::WChar_S;
4792 for (
size_t Idx = 0; Idx < llvm::array_lengthof(PromoteTypes); ++Idx) {
4794 if (FromSize < ToSize ||
4795 (FromSize == ToSize &&
4796 FromIsSigned == PromoteTypes[Idx]->isSignedIntegerType()))
4797 return PromoteTypes[Idx];
4799 llvm_unreachable(
"char type should fit into long long");
4806 uint64_t PromotableSize =
getIntWidth(Promotable);
4847 if (
const EnumType *ET = dyn_cast<EnumType>(LHSC))
4849 if (
const EnumType *ET = dyn_cast<EnumType>(RHSC))
4852 if (LHSC == RHSC)
return 0;
4857 unsigned LHSRank = getIntegerRank(LHSC);
4858 unsigned RHSRank = getIntegerRank(RHSC);
4860 if (LHSUnsigned == RHSUnsigned) {
4861 if (LHSRank == RHSRank)
return 0;
4862 return LHSRank > RHSRank ? 1 : -1;
4868 if (LHSRank >= RHSRank)
4878 if (RHSRank >= LHSRank)
4888 if (!CFConstantStringTypeDecl) {
4889 assert(!CFConstantStringTagDecl &&
4890 "tag and typedef should be initialized together");
4895 const char *FieldNames[4];
4899 FieldNames[0] =
"isa";
4901 FieldTypes[1] =
IntTy;
4902 FieldNames[1] =
"flags";
4905 FieldNames[2] =
"str";
4908 FieldNames[3] =
"length";
4911 for (
unsigned i = 0; i < 4; ++i) {
4916 FieldTypes[i],
nullptr,
4921 CFConstantStringTagDecl->
addDecl(Field);
4928 CFConstantStringTypeDecl =
4932 return CFConstantStringTypeDecl;
4936 if (!CFConstantStringTagDecl)
4938 return CFConstantStringTagDecl;
4947 if (ObjCSuperType.
isNull()) {
4949 TUDecl->
addDecl(ObjCSuperTypeDecl);
4952 return ObjCSuperType;
4957 assert(TD &&
"Invalid CFConstantStringType");
4958 CFConstantStringTypeDecl = cast<TypedefDecl>(TD->
getDecl());
4961 assert(TagType &&
"Invalid CFConstantStringType");
4962 CFConstantStringTagDecl = TagType->getDecl();
4966 if (BlockDescriptorType)
4979 static const char *
const FieldNames[] = {
4984 for (
size_t i = 0; i < 2; ++i) {
4987 &
Idents.
get(FieldNames[i]), FieldTypes[i],
nullptr,
4995 BlockDescriptorType = RD;
5001 if (BlockDescriptorExtendedType)
5016 static const char *
const FieldNames[] = {
5023 for (
size_t i = 0; i < 4; ++i) {
5026 &
Idents.
get(FieldNames[i]), FieldTypes[i],
nullptr,
5035 BlockDescriptorExtendedType = RD;
5046 if (!copyExpr && record->hasTrivialDestructor())
return false;
5072 llvm_unreachable(
"fell out of lifetime switch!");
5080 bool &HasByrefExtendedLayout)
const {
5086 HasByrefExtendedLayout =
false;
5088 HasByrefExtendedLayout =
true;
5102 if (!ObjCInstanceTypeDecl)
5103 ObjCInstanceTypeDecl =
5105 return ObjCInstanceTypeDecl;
5111 if (
const TypedefType *TT = dyn_cast<TypedefType>(T))
5113 return II->isStr(
"BOOL");
5149 if (!First->isConstexpr() || First->isInlineSpecified() ||
5156 if (D->getLexicalDeclContext()->isFileContext())
5194 assert (sz.
isPositive() &&
"BlockExpr - Incomplete param type");
5203 ParmOffset = PtrSize;
5205 QualType PType = PVDecl->getOriginalType();
5210 if (!isa<ConstantArrayType>(AT))
5211 PType = PVDecl->getType();
5213 PType = PVDecl->getType();
5239 "getObjCEncodingForFunctionDecl - Incomplete param type");
5247 QualType PType = PVDecl->getOriginalType();
5252 if (!isa<ConstantArrayType>(AT))
5253 PType = PVDecl->getType();
5255 PType = PVDecl->getType();
5269 bool Extended)
const {
5273 getObjCEncodingForTypeImpl(T, S,
true,
true,
nullptr,
5285 bool Extended)
const {
5306 "getObjCEncodingForMethodDecl - Incomplete param type");
5314 ParmOffset = 2 * PtrSize;
5323 if (!isa<ConstantArrayType>(AT))
5328 PType,
S, Extended);
5339 const Decl *Container)
const {
5343 dyn_cast<ObjCCategoryImplDecl>(Container)) {
5344 for (
auto *PID : CID->property_impls())
5345 if (PID->getPropertyDecl() == PD)
5350 if (PID->getPropertyDecl() == PD)
5382 const Decl *Container,
5383 std::string&
S)
const {
5385 bool Dynamic =
false;
5393 SynthesizePID = PropertyImpDecl;
5439 if (SynthesizePID) {
5454 if (isa<TypedefType>(PointeeTy.
getTypePtr())) {
5456 if (BT->getKind() == BuiltinType::ULong &&
getIntWidth(PointeeTy) == 32)
5459 if (BT->getKind() == BuiltinType::Long &&
getIntWidth(PointeeTy) == 32)
5472 getObjCEncodingForTypeImpl(T, S,
true,
true, Field,
5473 true ,
false,
false,
5474 false,
false,
false, NotEncodedT);
5478 std::string&
S)
const {
5482 getObjCEncodingForTypeImpl(T, S,
true,
true,
nullptr,
5490 case BuiltinType::Void:
return 'v';
5491 case BuiltinType::Bool:
return 'B';
5492 case BuiltinType::Char_U:
5493 case BuiltinType::UChar:
return 'C';
5494 case BuiltinType::Char16:
5495 case BuiltinType::UShort:
return 'S';
5496 case BuiltinType::Char32:
5497 case BuiltinType::UInt:
return 'I';
5498 case BuiltinType::ULong:
5500 case BuiltinType::UInt128:
return 'T';
5501 case BuiltinType::ULongLong:
return 'Q';
5502 case BuiltinType::Char_S:
5503 case BuiltinType::SChar:
return 'c';
5504 case BuiltinType::Short:
return 's';
5505 case BuiltinType::WChar_S:
5506 case BuiltinType::WChar_U:
5507 case BuiltinType::Int:
return 'i';
5508 case BuiltinType::Long:
5510 case BuiltinType::LongLong:
return 'q';
5511 case BuiltinType::Int128:
return 't';
5512 case BuiltinType::Float:
return 'f';
5513 case BuiltinType::Double:
return 'd';
5514 case BuiltinType::LongDouble:
return 'D';
5515 case BuiltinType::NullPtr:
return '*';
5517 case BuiltinType::Float128:
5518 case BuiltinType::Half:
5522 case BuiltinType::ObjCId:
5523 case BuiltinType::ObjCClass:
5524 case BuiltinType::ObjCSel:
5525 llvm_unreachable(
"@encoding ObjC primitive type");
5528 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
5529 case BuiltinType::Id:
5530 #include "clang/Basic/OpenCLImageTypes.def"
5531 case BuiltinType::OCLEvent:
5532 case BuiltinType::OCLClkEvent:
5533 case BuiltinType::OCLQueue:
5534 case BuiltinType::OCLNDRange:
5535 case BuiltinType::OCLReserveID:
5536 case BuiltinType::OCLSampler:
5537 case BuiltinType::Dependent:
5538 #define BUILTIN_TYPE(KIND, ID)
5539 #define PLACEHOLDER_TYPE(KIND, ID) \
5540 case BuiltinType::KIND:
5541 #include "clang/AST/BuiltinTypes.def"
5542 llvm_unreachable(
"invalid builtin type for @encode");
5544 llvm_unreachable(
"invalid BuiltinType::Kind value");
5561 assert(FD->
isBitField() &&
"not a bitfield - getObjCEncodingForTypeImpl");
5593 void ASTContext::getObjCEncodingForTypeImpl(
QualType T, std::string&
S,
5594 bool ExpandPointedToStructures,
5595 bool ExpandStructures,
5598 bool EncodingProperty,
5600 bool EncodeBlockParameters,
5601 bool EncodeClassNames,
5602 bool EncodePointerToObjCTypedef,
5605 switch (CT->getTypeClass()) {
5610 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(CT))
5616 case Type::Complex: {
5619 getObjCEncodingForTypeImpl(CT->
getElementType(),
S,
false,
false,
nullptr);
5623 case Type::Atomic: {
5626 getObjCEncodingForTypeImpl(AT->
getValueType(),
S,
false,
false,
nullptr);
5632 case Type::LValueReference:
5633 case Type::RValueReference: {
5635 if (isa<PointerType>(CT)) {
5646 bool isReadOnly =
false;
5656 }
else if (OutermostType) {
5669 if (StringRef(S).endswith(
"nr"))
5670 S.replace(S.end()-2, S.end(),
"rn");
5682 if (RTy->getDecl()->getIdentifier() == &
Idents.
get(
"objc_class")) {
5687 if (RTy->getDecl()->getIdentifier() == &
Idents.
get(
"objc_object")) {
5696 getObjCEncodingForTypeImpl(PointeeTy, S,
false, ExpandPointedToStructures,
5697 nullptr,
false,
false,
false,
false,
false,
false,
5702 case Type::ConstantArray:
5703 case Type::IncompleteArray:
5704 case Type::VariableArray: {
5705 const ArrayType *AT = cast<ArrayType>(CT);
5707 if (isa<IncompleteArrayType>(AT) && !StructField) {
5712 false, ExpandStructures, FD);
5717 S += llvm::utostr(CAT->
getSize().getZExtValue());
5720 assert((isa<VariableArrayType>(AT) || isa<IncompleteArrayType>(AT)) &&
5721 "Unknown array type!");
5726 false, ExpandStructures, FD,
5727 false,
false,
false,
false,
false,
false,
5734 case Type::FunctionNoProto:
5735 case Type::FunctionProto:
5739 case Type::Record: {
5740 RecordDecl *RDecl = cast<RecordType>(CT)->getDecl();
5741 S += RDecl->
isUnion() ?
'(' :
'{';
5746 = dyn_cast<ClassTemplateSpecializationDecl>(RDecl)) {
5748 llvm::raw_string_ostream OS(S);
5751 (*this).getPrintingPolicy());
5756 if (ExpandStructures) {
5759 getObjCEncodingForStructureImpl(RDecl, S, FD,
true, NotEncodedT);
5761 for (
const auto *Field : RDecl->
fields()) {
5764 S +=
Field->getNameAsString();
5769 if (
Field->isBitField()) {
5770 getObjCEncodingForTypeImpl(
Field->getType(),
S,
false,
true,
5775 getObjCEncodingForTypeImpl(qt, S,
false,
true,
5779 false,
false,
false, NotEncodedT);
5784 S += RDecl->
isUnion() ?
')' :
'}';
5788 case Type::BlockPointer: {
5791 if (EncodeBlockParameters) {
5796 getObjCEncodingForTypeImpl(
5797 FT->
getReturnType(),
S, ExpandPointedToStructures, ExpandStructures,
5798 FD,
false , EncodingProperty,
5799 false , EncodeBlockParameters, EncodeClassNames,
false,
5805 for (
const auto &
I : FPT->param_types())
5806 getObjCEncodingForTypeImpl(
5807 I, S, ExpandPointedToStructures, ExpandStructures, FD,
5808 false , EncodingProperty,
5809 false , EncodeBlockParameters, EncodeClassNames,
5810 false, NotEncodedT);
5817 case Type::ObjCObject: {
5821 S +=
"{objc_object=}";
5825 S +=
"{objc_class=}";
5830 case Type::ObjCInterface: {
5839 for (
unsigned i = 0, e = Ivars.size(); i != e; ++i) {
5842 getObjCEncodingForTypeImpl(Field->
getType(),
S,
false,
true, Field);
5844 getObjCEncodingForTypeImpl(Field->
getType(),
S,
false,
true, FD,
5845 false,
false,
false,
false,
false,
5846 EncodePointerToObjCTypedef,
5853 case Type::ObjCObjectPointer: {
5870 ExpandPointedToStructures,
5871 ExpandStructures, FD);
5872 if (FD || EncodingProperty || EncodeClassNames) {
5876 for (
const auto *
I : OPT->
quals()) {
5878 S +=
I->getObjCRuntimeNameAsString();
5887 if (!EncodingProperty &&
5889 !EncodePointerToObjCTypedef) {
5899 for (
unsigned i = 0, e = Ivars.size(); i != e; ++i) {
5900 if (cast<FieldDecl>(Ivars[i]) == FD) {
5908 getObjCEncodingForTypeImpl(PointeeTy, S,
5909 false, ExpandPointedToStructures,
5911 false,
false,
false,
false,
false,
5918 (FD || EncodingProperty || EncodeClassNames)) {
5921 for (
const auto *
I : OPT->
quals()) {
5923 S +=
I->getObjCRuntimeNameAsString();
5933 case Type::MemberPointer:
5937 case Type::ExtVector:
5950 #define ABSTRACT_TYPE(KIND, BASE)
5951 #define TYPE(KIND, BASE)
5952 #define DEPENDENT_TYPE(KIND, BASE) \
5954 #define NON_CANONICAL_TYPE(KIND, BASE) \
5956 #define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(KIND, BASE) \
5958 #include "clang/AST/TypeNodes.def"
5959 llvm_unreachable(
"@encode for dependent type!");
5961 llvm_unreachable(
"bad type kind!");
5964 void ASTContext::getObjCEncodingForStructureImpl(
RecordDecl *RDecl,
5969 assert(RDecl &&
"Expected non-null RecordDecl");
5970 assert(!RDecl->
isUnion() &&
"Should not be called for unions");
5975 std::multimap<uint64_t, NamedDecl *> FieldOrBaseOffsets;
5979 for (
const auto &BI : CXXRec->
bases()) {
5980 if (!BI.isVirtual()) {
5985 FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
5986 std::make_pair(offs, base));
5992 for (
auto *Field : RDecl->
fields()) {
5994 FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
5995 std::make_pair(offs, Field));
5999 if (CXXRec && includeVBases) {
6000 for (
const auto &BI : CXXRec->
vbases()) {
6006 FieldOrBaseOffsets.find(offs) == FieldOrBaseOffsets.end())
6007 FieldOrBaseOffsets.insert(FieldOrBaseOffsets.end(),
6008 std::make_pair(offs, base));
6020 uint64_t CurOffs = 0;
6023 CurLayObj = FieldOrBaseOffsets.begin();
6026 (CurLayObj == FieldOrBaseOffsets.end() || CurLayObj->first != 0)) {
6030 if (recname.empty()) recname =
"?";
6042 uint64_t offs =
toBits(size);
6043 FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
6044 std::make_pair(offs,
nullptr));
6047 for (; CurLayObj != FieldOrBaseOffsets.end(); ++CurLayObj) {
6049 assert(CurOffs <= CurLayObj->first);
6050 if (CurOffs < CurLayObj->first) {
6051 uint64_t padding = CurLayObj->first - CurOffs;
6072 getObjCEncodingForStructureImpl(base, S, FD,
false,
6079 FieldDecl *field = cast<FieldDecl>(dcl);
6094 getObjCEncodingForTypeImpl(qt, S,
false,
true, FD,
6098 false,
false,
false, NotEncodedT);
6108 std::string& S)
const {
6109 if (QT & Decl::OBJC_TQ_In)
6111 if (QT & Decl::OBJC_TQ_Inout)
6113 if (QT & Decl::OBJC_TQ_Out)
6115 if (QT & Decl::OBJC_TQ_Bycopy)
6117 if (QT & Decl::OBJC_TQ_Byref)
6119 if (QT & Decl::OBJC_TQ_Oneway)
6141 if (!ObjCClassDecl) {
6146 return ObjCClassDecl;
6150 if (!ObjCProtocolClassDecl) {
6151 ObjCProtocolClassDecl
6160 return ObjCProtocolClassDecl;
6201 VaListTagDecl->setDeclContext(NS);
6206 const size_t NumFields = 5;
6208 const char *FieldNames[NumFields];
6212 FieldNames[0] =
"__stack";
6216 FieldNames[1] =
"__gr_top";
6220 FieldNames[2] =
"__vr_top";
6223 FieldTypes[3] = Context->
IntTy;
6224 FieldNames[3] =
"__gr_offs";
6227 FieldTypes[4] = Context->
IntTy;
6228 FieldNames[4] =
"__vr_offs";
6231 for (
unsigned i = 0; i < NumFields; ++i) {
6237 FieldTypes[i],
nullptr,
6242 VaListTagDecl->
addDecl(Field);
6259 const size_t NumFields = 5;
6261 const char *FieldNames[NumFields];
6265 FieldNames[0] =
"gpr";
6269 FieldNames[1] =
"fpr";
6273 FieldNames[2] =
"reserved";
6277 FieldNames[3] =
"overflow_arg_area";
6281 FieldNames[4] =
"reg_save_area";
6284 for (
unsigned i = 0; i < NumFields; ++i) {
6289 FieldTypes[i],
nullptr,
6294 VaListTagDecl->
addDecl(Field);
6322 const size_t NumFields = 4;
6324 const char *FieldNames[NumFields];
6328 FieldNames[0] =
"gp_offset";
6332 FieldNames[1] =
"fp_offset";
6336 FieldNames[2] =
"overflow_arg_area";
6340 FieldNames[3] =
"reg_save_area";
6343 for (
unsigned i = 0; i < NumFields; ++i) {
6349 FieldTypes[i],
nullptr,
6354 VaListTagDecl->
addDecl(Field);
6391 VaListDecl->setDeclContext(NS);
6426 const size_t NumFields = 4;
6428 const char *FieldNames[NumFields];
6431 FieldTypes[0] = Context->
LongTy;
6432 FieldNames[0] =
"__gpr";
6435 FieldTypes[1] = Context->
LongTy;
6436 FieldNames[1] =
"__fpr";
6440 FieldNames[2] =
"__overflow_arg_area";
6444 FieldNames[3] =
"__reg_save_area";
6447 for (
unsigned i = 0; i < NumFields; ++i) {
6453 FieldTypes[i],
nullptr,
6458 VaListTagDecl->
addDecl(Field);
6495 llvm_unreachable(
"Unhandled __builtin_va_list type kind");
6499 if (!BuiltinVaListDecl) {
6501 assert(BuiltinVaListDecl->isImplicit());
6504 return BuiltinVaListDecl;
6517 if (!BuiltinMSVaListDecl)
6520 return BuiltinMSVaListDecl;
6524 assert(ObjCConstantStringType.
isNull() &&
6525 "'NSConstantString' type already set!");
6535 unsigned size = End - Begin;
6536 assert(size > 1 &&
"set is not overloaded!");
6545 assert(isa<FunctionTemplateDecl>(D) ||
6546 (isa<UsingShadowDecl>(D) &&
6558 bool TemplateKeyword,
6560 assert(NNS &&
"Missing nested-name-specifier in qualified template name");
6563 llvm::FoldingSetNodeID
ID;
6566 void *InsertPos =
nullptr;
6568 QualifiedTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
6570 QTN =
new (*
this, llvm::alignOf<QualifiedTemplateName>())
6572 QualifiedTemplateNames.InsertNode(QTN, InsertPos);
6584 "Nested name specifier must be dependent");
6586 llvm::FoldingSetNodeID
ID;
6589 void *InsertPos =
nullptr;
6591 DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
6597 if (CanonNNS == NNS) {
6598 QTN =
new (*
this, llvm::alignOf<DependentTemplateName>())
6602 QTN =
new (*
this, llvm::alignOf<DependentTemplateName>())
6605 DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
6606 assert(!CheckQTN &&
"Dependent type name canonicalization broken");
6610 DependentTemplateNames.InsertNode(QTN, InsertPos);
6620 "Nested name specifier must be dependent");
6622 llvm::FoldingSetNodeID
ID;
6625 void *InsertPos =
nullptr;
6627 = DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
6633 if (CanonNNS == NNS) {
6634 QTN =
new (*
this, llvm::alignOf<DependentTemplateName>())
6638 QTN =
new (*
this, llvm::alignOf<DependentTemplateName>())
6642 = DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
6643 assert(!CheckQTN &&
"Dependent template name canonicalization broken");
6647 DependentTemplateNames.InsertNode(QTN, InsertPos);
6654 llvm::FoldingSetNodeID
ID;
6657 void *insertPos =
nullptr;
6659 = SubstTemplateTemplateParms.FindNodeOrInsertPos(ID, insertPos);
6663 SubstTemplateTemplateParms.InsertNode(subst, insertPos);
6673 llvm::FoldingSetNodeID
ID;
6676 void *InsertPos =
nullptr;
6678 = SubstTemplateTemplateParmPacks.FindNodeOrInsertPos(ID, InsertPos);
6684 SubstTemplateTemplateParmPacks.InsertNode(Subst, InsertPos);
6708 llvm_unreachable(
"Unhandled TargetInfo::IntType value");
6738 while (
const ArrayType *AT = dyn_cast<ArrayType>(CT))
6761 assert(FirstVec->
isVectorType() &&
"FirstVec should be a vector type");
6762 assert(SecondVec->
isVectorType() &&
"SecondVec should be a vector type");
6805 assert ((lhsQID && rhsOPT) &&
"ObjCQualifiedClassTypesAreCompatible");
6807 for (
auto *lhsProto : lhsQID->
quals()) {
6809 for (
auto *rhsProto : rhsOPT->quals()) {
6836 if (!rhsOPT)
return false;
6842 for (
auto *
I : lhsQID->quals()) {
6846 if (!rhsID->ClassImplementsProtocol(
I,
true))
6854 for (
auto *lhsProto : lhsQID->quals()) {
6860 for (
auto *rhsProto : rhsOPT->
quals()) {
6870 for (
auto *
I : lhsQID->quals()) {
6874 if (rhsID->ClassImplementsProtocol(
I,
true)) {
6888 assert(rhsQID &&
"One of the LHS/RHS should be id<x>");
6893 for (
auto *lhsProto : lhsOPT->quals()) {
6901 for (
auto *rhsProto : rhsQID->
quals()) {
6915 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> LHSInheritedProtocols;
6920 if (LHSInheritedProtocols.empty() && lhsOPT->qual_empty())
6922 for (
auto *lhsProto : LHSInheritedProtocols) {
6924 for (
auto *rhsProto : rhsQID->
quals()) {
6956 auto finish = [&](
bool succeeded) ->
bool {
6996 bool BlockReturnType) {
7000 auto finish = [&](
bool succeeded) ->
bool {
7034 return finish(BlockReturnType);
7036 return finish(!BlockReturnType);
7048 return (*lhs)->getName().compare((*rhs)->getName());
7066 assert(LHS->
getInterface() &&
"LHS must have an interface base");
7067 assert(RHS->
getInterface() &&
"RHS must have an interface base");
7070 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> LHSProtocolSet;
7073 for (
auto proto : LHS->
quals()) {
7081 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> RHSProtocolSet;
7084 for (
auto proto : RHS->
quals()) {
7092 for (
auto proto : LHSProtocolSet) {
7093 if (RHSProtocolSet.count(proto))
7094 IntersectionSet.push_back(proto);
7099 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> ImpliedProtocols;
7103 if (!ImpliedProtocols.empty()) {
7104 IntersectionSet.erase(
7105 std::remove_if(IntersectionSet.begin(),
7106 IntersectionSet.end(),
7108 return ImpliedProtocols.count(proto) > 0;
7110 IntersectionSet.end());
7114 llvm::array_pod_sort(IntersectionSet.begin(), IntersectionSet.end(),
7124 if (lhsOPT && rhsOPT)
7130 if (lhsBlock && rhsBlock)
7136 (rhsOPT && rhsOPT->isObjCIdType() && lhsBlock))
7148 if (lhsArgs.size() != rhsArgs.size())
7152 for (
unsigned i = 0, n = lhsArgs.size(); i != n; ++i) {
7156 switch (typeParams->
begin()[i]->getVariance()) {
7159 !ctx.
hasSameType(lhsArgs[i].stripObjCKindOfType(ctx),
7160 rhsArgs[i].stripObjCKindOfType(ctx))) {
7188 if (!LDecl || !RDecl)
7198 llvm::SmallDenseMap<const ObjCInterfaceDecl *, const ObjCObjectType *, 4>
7208 bool anyChanges =
false;
7226 if (!Protocols.empty())
7244 if (LHSSuperType.
isNull())
7254 if (KnownLHS != LHSAncestors.end()) {
7255 LHS = KnownLHS->second;
7259 bool anyChanges =
false;
7277 if (!Protocols.empty())
7294 if (RHSSuperType.
isNull())
7305 assert(LHS->
getInterface() &&
"LHS is not an interface type");
7306 assert(RHS->
getInterface() &&
"RHS is not an interface type");
7323 llvm::SmallPtrSet<ObjCProtocolDecl *, 8> SuperClassInheritedProtocols;
7327 for (
auto *RHSPI : RHS->
quals())
7330 if (SuperClassInheritedProtocols.empty())
7333 for (
const auto *LHSProto : LHS->
quals()) {
7334 bool SuperImplementsProtocol =
false;
7335 for (
auto *SuperClassProto : SuperClassInheritedProtocols)
7336 if (SuperClassProto->lookupProtocolNamed(LHSProto->getIdentifier())) {
7337 SuperImplementsProtocol =
true;
7340 if (!SuperImplementsProtocol)
7370 if (!LHSOPT || !RHSOPT)
7388 bool CompareUnqualified) {
7407 bool OfBlockPointer,
7411 if (UD->hasAttr<TransparentUnionAttr>()) {
7412 for (
const auto *
I : UD->
fields()) {
7413 QualType ET =
I->getType().getUnqualifiedType();
7427 bool OfBlockPointer,
7442 return mergeTypes(lhs, rhs, OfBlockPointer, Unqualified);
7446 bool OfBlockPointer,
7452 bool allLTypes =
true;
7453 bool allRTypes =
true;
7457 if (OfBlockPointer) {
7458 QualType RHS = rbase->getReturnType();
7460 bool UnqualifiedResult = Unqualified;
7461 if (!UnqualifiedResult)
7463 retType =
mergeTypes(LHS, RHS,
true, UnqualifiedResult,
true);
7515 if (lproto && rproto) {
7516 assert(!lproto->hasExceptionSpec() && !rproto->hasExceptionSpec() &&
7517 "C++ shouldn't be here");
7519 if (lproto->getNumParams() != rproto->getNumParams())
7523 if (lproto->isVariadic() != rproto->isVariadic())
7526 if (lproto->getTypeQuals() != rproto->getTypeQuals())
7534 for (
unsigned i = 0, n = lproto->getNumParams(); i < n; i++) {
7535 QualType lParamType = lproto->getParamType(i).getUnqualifiedType();
7536 QualType rParamType = rproto->getParamType(i).getUnqualifiedType();
7538 lParamType, rParamType, OfBlockPointer, Unqualified);
7545 types.push_back(paramType);
7557 if (allLTypes)
return lhs;
7558 if (allRTypes)
return rhs;
7565 if (lproto) allRTypes =
false;
7566 if (rproto) allLTypes =
false;
7577 for (
unsigned i = 0, n = proto->
getNumParams(); i < n; ++i) {
7583 paramTy = Enum->getDecl()->getIntegerType();
7593 if (allLTypes)
return lhs;
7594 if (allRTypes)
return rhs;
7601 if (allLTypes)
return lhs;
7602 if (allRTypes)
return rhs;
7608 QualType other,
bool isBlockReturnType) {
7628 bool OfBlockPointer,
7629 bool Unqualified,
bool BlockReturnType) {
7647 if (LHSCan == RHSCan)
7652 Qualifiers RQuals = RHSCan.getLocalQualifiers();
7653 if (LQuals != RQuals) {
7677 assert((GC_L != GC_R) &&
"unequal qualifier sets had only equal elements");
7698 if (LHSClass == Type::FunctionProto) LHSClass = Type::FunctionNoProto;
7699 if (RHSClass == Type::FunctionProto) RHSClass = Type::FunctionNoProto;
7702 if (LHSClass == Type::VariableArray || LHSClass == Type::IncompleteArray)
7703 LHSClass = Type::ConstantArray;
7704 if (RHSClass == Type::VariableArray || RHSClass == Type::IncompleteArray)
7705 RHSClass = Type::ConstantArray;
7708 if (LHSClass == Type::ObjCInterface) LHSClass = Type::ObjCObject;
7709 if (RHSClass == Type::ObjCInterface) RHSClass = Type::ObjCObject;
7712 if (LHSClass == Type::ExtVector) LHSClass = Type::Vector;
7713 if (RHSClass == Type::ExtVector) RHSClass = Type::Vector;
7716 if (LHSClass != RHSClass) {
7726 if (OfBlockPointer && !BlockReturnType) {
7738 #define TYPE(Class, Base)
7739 #define ABSTRACT_TYPE(Class, Base)
7740 #define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) case Type::Class:
7741 #define NON_CANONICAL_TYPE(Class, Base) case Type::Class:
7742 #define DEPENDENT_TYPE(Class, Base) case Type::Class:
7743 #include "clang/AST/TypeNodes.def"
7744 llvm_unreachable(
"Non-canonical and dependent types shouldn't get here");
7747 case Type::LValueReference:
7748 case Type::RValueReference:
7749 case Type::MemberPointer:
7750 llvm_unreachable(
"C++ should never be in mergeTypes");
7752 case Type::ObjCInterface:
7753 case Type::IncompleteArray:
7754 case Type::VariableArray:
7755 case Type::FunctionProto:
7756 case Type::ExtVector:
7757 llvm_unreachable(
"Types are eliminated above");
7777 case Type::BlockPointer:
7813 case Type::ConstantArray:
7860 case Type::FunctionNoProto:
7877 case Type::ObjCObject: {
7888 case Type::ObjCObjectPointer: {
7889 if (OfBlockPointer) {
7923 llvm_unreachable(
"Invalid Type::Class!");
7940 assert(firstEPI.size() == secondEPI.size());
7942 for (
size_t i = 0, n = firstEPI.size(); i != n; ++i) {
7943 if (firstEPI[i] != secondEPI[i])
7950 ObjCLayouts[CD] =
nullptr;
7960 if (LHSCan == RHSCan)
7962 if (RHSCan->isFunctionType()) {
7966 cast<FunctionType>(RHSCan.getTypePtr())->getReturnType();
7968 cast<FunctionType>(LHSCan.
getTypePtr())->getReturnType();
7971 if (ResReturnType.
isNull())
7973 if (ResReturnType == NewReturnType || ResReturnType == OldReturnType) {
7990 Qualifiers RQuals = RHSCan.getLocalQualifiers();
7991 if (LQuals != RQuals) {
8004 assert((GC_L != GC_R) &&
"unequal qualifier sets had only equal elements");
8020 if (ResQT == LHSBaseQT)
8022 if (ResQT == RHSBaseQT)
8034 T = ET->getDecl()->getIntegerType();
8047 VTy->getNumElements(), VTy->getVectorKind());
8051 T = ETy->getDecl()->getIntegerType();
8054 assert(BTy &&
"Unexpected signed integer type");
8056 case BuiltinType::Char_S:
8057 case BuiltinType::SChar:
8059 case BuiltinType::Short:
8061 case BuiltinType::Int:
8063 case BuiltinType::Long:
8065 case BuiltinType::LongLong:
8067 case BuiltinType::Int128:
8070 llvm_unreachable(
"Unexpected signed integer type");
8094 bool AllowTypeModifiers) {
8097 bool Signed =
false, Unsigned =
false;
8098 RequiresICE =
false;
8104 default: Done =
true; --Str;
break;
8109 assert(!Unsigned &&
"Can't use both 'S' and 'U' modifiers!");
8110 assert(!Signed &&
"Can't use 'S' modifier multiple times!");
8114 assert(!Signed &&
"Can't use both 'S' and 'U' modifiers!");
8115 assert(!Unsigned &&
"Can't use 'U' modifier multiple times!");
8119 assert(HowLong <= 2 &&
"Can't have LLLL modifier");
8124 assert(HowLong == 0 &&
"Can't use both 'L' and 'W' modifiers!");
8127 llvm_unreachable(
"Unexpected integer type");
8142 default: llvm_unreachable(
"Unknown builtin type letter!");
8144 assert(HowLong == 0 && !Signed && !Unsigned &&
8145 "Bad modifiers used with 'v'!");
8149 assert(HowLong == 0 && !Signed && !Unsigned &&
8150 "Bad modifiers used with 'h'!");
8154 assert(HowLong == 0 && !Signed && !Unsigned &&
8155 "Bad modifiers used with 'f'!");
8159 assert(HowLong < 2 && !Signed && !Unsigned &&
8160 "Bad modifiers used with 'd'!");
8167 assert(HowLong == 0 &&
"Bad modifiers used with 's'!");
8176 else if (HowLong == 2)
8178 else if (HowLong == 1)
8184 assert(HowLong == 0 &&
"Bad modifiers used with 'c'!");
8193 assert(HowLong == 0 && !Signed && !Unsigned &&
"Bad modifiers for 'b'!");
8197 assert(HowLong == 0 && !Signed && !Unsigned &&
"Bad modifiers for 'z'!");
8214 assert(!Type.
isNull() &&
"builtin va list type not initialized!");
8226 assert(!Type.
isNull() &&
"builtin va list type not initialized!");
8234 unsigned NumElements = strtoul(Str, &End, 10);
8235 assert(End != Str &&
"Missing vector size");
8239 RequiresICE,
false);
8240 assert(!RequiresICE &&
"Can't require vector ICE");
8250 unsigned NumElements = strtoul(Str, &End, 10);
8251 assert(End != Str &&
"Missing vector size");
8263 assert(!RequiresICE &&
"Can't require complex ICE");
8290 assert(HowLong == 0 && !Signed && !Unsigned &&
"Bad modifiers for 'K'!");
8304 Done = !AllowTypeModifiers;
8306 switch (
char c = *Str++) {
8307 default: Done =
true; --Str;
break;
8313 unsigned AddrSpace = strtoul(Str, &End, 10);
8314 if (End != Str && AddrSpace != 0) {
8338 "Integer constant 'I' type must be an integer");
8346 unsigned *IntegerConstantArgs)
const {
8351 bool RequiresICE =
false;
8358 assert(!RequiresICE &&
"Result of intrinsic cannot be required to be an ICE");
8360 while (TypeStr[0] && TypeStr[0] !=
'.') {
8367 if (RequiresICE && IntegerConstantArgs)
8368 *IntegerConstantArgs |= 1 << ArgTypes.size();
8374 ArgTypes.push_back(Ty);
8377 if (Id == Builtin::BI__GetExceptionInfo)
8380 assert((TypeStr[0] !=
'.' || TypeStr[1] == 0) &&
8381 "'.' should only occur at end of builtin type list!");
8386 bool Variadic = (TypeStr[0] ==
'.');
8389 if (ArgTypes.empty() && Variadic)
8433 !FD->hasAttr<DLLExportAttr>()) ||
8434 FD->hasAttr<GNUInlineAttr>()) {
8459 if (D->hasAttr<DLLImportAttr>()) {
8462 }
else if (D->hasAttr<DLLExportAttr>()) {
8466 D->hasAttr<CUDAGlobalAttr>()) {
8487 const DeclContext *LexicalContext = VD->getParentFunctionOrMethod();
8488 while (LexicalContext && !isa<FunctionDecl>(LexicalContext))
8494 StaticLocalLinkage =
8501 : StaticLocalLinkage;
8528 return StrongLinkage;
8546 llvm_unreachable(
"Invalid Linkage!");
8555 if (
const VarDecl *VD = dyn_cast<VarDecl>(D)) {
8556 if (!VD->isFileVarDecl())
8561 if (VD->getDescribedVarTemplate() ||
8562 isa<VarTemplatePartialSpecializationDecl>(VD))
8564 }
else if (
const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
8568 }
else if (isa<PragmaCommentDecl>(D))
8570 else if (isa<OMPThreadPrivateDecl>(D) ||
8571 D->hasAttr<OMPDeclareTargetDeclAttr>())
8573 else if (isa<PragmaDetectMismatchDecl>(D))
8575 else if (isa<OMPThreadPrivateDecl>(D))
8576 return !D->getDeclContext()->isDependentContext();
8577 else if (isa<OMPDeclareReductionDecl>(D))
8578 return !D->getDeclContext()->isDependentContext();
8583 if (D->getDeclContext()->isDependentContext())
8587 if (D->hasAttr<WeakRefAttr>())
8591 if (D->hasAttr<AliasAttr>() || D->hasAttr<UsedAttr>())
8594 if (
const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
8596 if (!FD->doesThisDeclarationHaveABody())
8597 return FD->doesDeclarationForceExternallyVisibleDefinition();
8600 if (FD->hasAttr<ConstructorAttr>() || FD->hasAttr<DestructorAttr>())
8606 if (
const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
8627 const VarDecl *VD = cast<VarDecl>(D);
8653 bool IsCXXMethod)
const {
8656 return ABI->getDefaultMethodCallConv(IsVariadic);
8658 switch (LangOpts.getDefaultCallingConv()) {
8682 return ABI->isNearlyEmpty(RD);
8686 if (!VTContext.get()) {
8692 return VTContext.get();
8709 llvm_unreachable(
"Unsupported ABI");
8715 return ASTRecordLayouts.getMemorySize() +
8716 llvm::capacity_in_bytes(ObjCLayouts) +
8717 llvm::capacity_in_bytes(KeyFunctions) +
8718 llvm::capacity_in_bytes(ObjCImpls) +
8719 llvm::capacity_in_bytes(BlockVarCopyInits) +
8720 llvm::capacity_in_bytes(DeclAttrs) +
8721 llvm::capacity_in_bytes(TemplateOrInstantiation) +
8722 llvm::capacity_in_bytes(InstantiatedFromUsingDecl) +
8723 llvm::capacity_in_bytes(InstantiatedFromUsingShadowDecl) +
8724 llvm::capacity_in_bytes(InstantiatedFromUnnamedFieldDecl) +
8725 llvm::capacity_in_bytes(OverriddenMethods) +
8726 llvm::capacity_in_bytes(Types) +
8727 llvm::capacity_in_bytes(VariableArrayTypes) +
8728 llvm::capacity_in_bytes(ClassScopeSpecializationPattern);
8736 unsigned Signed)
const {
8739 if (!QualTy && DestWidth == 128)
8762 llvm_unreachable(
"Unhandled TargetInfo::RealType value");
8767 MangleNumbers[ND] = Number;
8771 auto I = MangleNumbers.find(ND);
8772 return I != MangleNumbers.end() ?
I->second : 1;
8777 StaticLocalNumbers[VD] = Number;
8781 auto I = StaticLocalNumbers.find(VD);
8782 return I != StaticLocalNumbers.end() ?
I->second : 1;
8787 assert(LangOpts.CPlusPlus);
8795 return ABI->createMangleNumberingContext();
8800 return ABI->getCopyConstructorForExceptionObject(
8806 return ABI->addCopyConstructorForExceptionObject(
8812 unsigned ParmIdx,
Expr *DAE) {
8813 ABI->addDefaultArgExprForConstructor(
8814 cast<CXXConstructorDecl>(CD->
getFirstDecl()), ParmIdx, DAE);
8819 return ABI->getDefaultArgExprForConstructor(
8820 cast<CXXConstructorDecl>(CD->
getFirstDecl()), ParmIdx);
8825 return ABI->addTypedefNameForUnnamedTagDecl(TD, DD);
8830 return ABI->getTypedefNameForUnnamedTagDecl(TD);
8835 return ABI->addDeclaratorForUnnamedTagDecl(TD, DD);
8839 return ABI->getDeclaratorForUnnamedTagDecl(TD);
8843 ParamIndices[D] = index;
8847 ParameterIndexTable::const_iterator
I = ParamIndices.find(D);
8848 assert(I != ParamIndices.end() &&
8849 "ParmIndices lacks entry set by ParmVarDecl");
8857 "don't need to cache the computed value for this temporary");
8859 APValue *&MTVI = MaterializedTemporaryValues[
E];
8865 return MaterializedTemporaryValues.lookup(E);
8870 if (!T.isOSDarwin())
8873 if (!(T.isiOS() && T.isOSVersionLT(7)) &&
8874 !(T.isMacOSX() && T.isOSVersionLT(10, 9)))
8883 return (Size != Align ||
toBits(sizeChars) > MaxInlineWidthInBits);
8889 ASTContext::ParentMapPointers::mapped_type U) {
8890 if (
const auto *D = U.dyn_cast<
const Decl *>())
8892 if (
const auto *S = U.dyn_cast<
const Stmt *>())
8899 template <
typename T>
8932 Visitor.TraverseDecl(&TU);
8933 return std::make_pair(Visitor.Parents, Visitor.OtherParents);
8941 : Parents(Parents), OtherParents(OtherParents) {}
8943 bool shouldVisitTemplateInstantiations()
const {
8946 bool shouldVisitImplicitCode()
const {
8950 template <
typename T,
typename MapNodeTy,
typename BaseTraverseFn,
8952 bool TraverseNode(T
Node, MapNodeTy MapNode,
8953 BaseTraverseFn BaseTraverse,
MapTy *Parents) {
8956 if (ParentStack.size() > 0) {
8967 auto &NodeOrVector = (*Parents)[MapNode];
8968 if (NodeOrVector.isNull()) {
8969 if (
const auto *D = ParentStack.back().get<Decl>())
8971 else if (
const auto *S = ParentStack.back().get<
Stmt>())
8977 if (!NodeOrVector.template is<ASTContext::ParentVector *>()) {
8979 1, getSingleDynTypedNodeFromParentMap(NodeOrVector));
8982 .
template dyn_cast<ast_type_traits::DynTypedNode *>())
8984 NodeOrVector = Vector;
8988 NodeOrVector.template get<ASTContext::ParentVector *>();
8994 std::find(Vector->begin(), Vector->end(),
8995 ParentStack.back()) != Vector->end();
8997 Vector->push_back(ParentStack.back());
9000 ParentStack.push_back(createDynTypedNode(Node));
9001 bool Result = BaseTraverse();
9002 ParentStack.pop_back();
9006 bool TraverseDecl(Decl *DeclNode) {
9007 return TraverseNode(DeclNode, DeclNode,
9008 [&] {
return VisitorBase::TraverseDecl(DeclNode); },
9012 bool TraverseStmt(
Stmt *StmtNode) {
9013 return TraverseNode(StmtNode, StmtNode,
9014 [&] {
return VisitorBase::TraverseStmt(StmtNode); },
9018 bool TraverseTypeLoc(
TypeLoc TypeLocNode) {
9019 return TraverseNode(
9021 [&] {
return VisitorBase::TraverseTypeLoc(TypeLocNode); },
9026 return TraverseNode(
9029 return VisitorBase::TraverseNestedNameSpecifierLoc(NNSLocNode);
9043 template <
typename NodeTy,
typename MapTy>
9046 auto I = Map.find(Node);
9047 if (
I == Map.end()) {
9050 if (
auto *V =
I->second.template dyn_cast<ASTContext::ParentVector *>()) {
9051 return llvm::makeArrayRef(*V);
9053 return getSingleDynTypedNodeFromParentMap(
I->second);
9058 if (!PointerParents) {
9062 PointerParents.reset(Maps.first);
9063 OtherParents.reset(Maps.second);
9074 if (MethodDecl->hasAttr<UnavailableAttr>()
9075 || MethodDecl->hasAttr<DeprecatedAttr>())
9089 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.
static const Decl * getCanonicalDecl(const Decl *D)
RealType getRealTypeByWidth(unsigned BitWidth) const
Return floating point type with specified width.
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.
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.
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.
InlineVariableDefinitionKind
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.
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
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
bool hasExtParameterInfos() const
Is there any interesting extra information for any of the parameters of this function type...
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...
The parameter is covariant, e.g., X<T> is a subtype of X<U> when the type parameter is covariant and ...
QualType getRecordType(const RecordDecl *Decl) const
std::unique_ptr< llvm::MemoryBuffer > Buffer
DependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, ArrayRef< TemplateArgument > Args, QualType Canon)
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
unsigned getFloat128Align() 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.
unsigned getFloat128Width() const
getFloat128Width/Align/Format - Return the size/align/format of '__float128'.
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...
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 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 and other b...
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.
bool doFunctionTypesMatchOnExtParameterInfos(const FunctionProtoType *FromFunctionType, const FunctionProtoType *ToFunctionType)
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...
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. ...
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.
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.
InlineVariableDefinitionKind getInlineVariableDefinitionKind(const VarDecl *VD) const
Determine whether a definition of this inline variable should be treated as a weak or strong definiti...
void Profile(llvm::FoldingSetNodeID &ID)
QualType getCanonicalTemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args) const
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
unsigned getCVRQualifiers() const
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
ArrayRef< ExtParameterInfo > getExtParameterInfos() const
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...
static bool hasAnyPackExpansions(ArrayRef< TemplateArgument > Args)
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)
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.
IdentifierInfo * getTypePackElementName() const
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)
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 preordor or postorder depth-first traversal on the entire Clang AST and visits each...
Represents an ObjC class declaration.
propimpl_range property_impls() const
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
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
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...
CanQualType Float128ComplexTy
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)
ArrayRef< TemplateArgument > asArray() const
Produce this as an array ref.
QualType getAtomicType(QualType T) const
Return the uniqued reference to the atomic type for the specified type.
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)
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)
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
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
char __ovld __cnfn min(char x, char y)
Returns y if y < x, otherwise it returns x.
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.
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.
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.
bool isExternallyVisible() const
ArrayRef< ParmVarDecl * > parameters() 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
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)
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.
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
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
QualType getTemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon=QualType()) 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...
Weak for now, might become strong later in this TU.
void Profile(llvm::FoldingSetNodeID &ID)
DiagnosticsEngine & getDiagnostics() const
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
ArrayRef< ParmVarDecl * > parameters() const
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...
virtual bool allowsLargerPreferedTypeAlignment() const
Whether target allows to overalign ABI-specified prefered alignment.
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.
TypedefNameDecl * getDecl() const
__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)
static void PrintTemplateArgumentList(raw_ostream &OS, ArrayRef< TemplateArgument > Args, const PrintingPolicy &Policy, bool SkipBrackets=false)
Print a template argument list, including the '<' and '>' enclosing the template arguments...
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.
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
const llvm::fltSemantics & getLongDoubleFormat() const
void * getAsVoidPointer() const
Retrieve the template name as a void pointer.
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;
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.
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.
static GVALinkage adjustGVALinkageForAttributes(const ASTContext &Context, GVALinkage L, const Decl *D)
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.
virtual ~ASTMutationListener()
This names the __type_pack_element BuiltinTemplateDecl.
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)
BuiltinTemplateDecl * getTypePackElementDecl() const
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.
Location wrapper for a TemplateArgument.
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
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...
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
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...
const llvm::fltSemantics & getFloat128Format() const
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...
char __ovld __cnfn max(char x, char y)
Returns y if x < y, otherwise it returns x.
QualType getPointeeType() const
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...
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.
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
bool isInline() const
Whether this variable is (C++1z) inline.
overridden_method_range overridden_methods(const CXXMethodDecl *Method) 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
Weak definition of inline variable.
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.
TypedefDecl * getCFConstantStringDecl() const
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
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
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...
RecordDecl * getCFConstantStringTagDecl() const
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.
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".
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)
llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range
TemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon, QualType Aliased)
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
bool isAddressSpaceSupersetOf(Qualifiers other) const
Returns true if this address space is a superset of the other one.
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 ...