27 #include "llvm/Support/SaveAndRestore.h"
29 using namespace clang;
30 using namespace clang::serialization;
47 unsigned AnonymousDeclNumber;
56 bool IsDeclMarkedUsed;
58 uint64_t GetCurrentCursorOffset();
60 uint64_t ReadLocalOffset(
const RecordData &R,
unsigned &
I) {
61 uint64_t LocalOffset = R[I++];
62 assert(LocalOffset <
Offset &&
"offset point after current record");
63 return LocalOffset ?
Offset - LocalOffset : 0;
66 uint64_t ReadGlobalOffset(ModuleFile &F,
const RecordData &R,
unsigned &I) {
67 uint64_t Local = ReadLocalOffset(R, I);
68 return Local ? Reader.getGlobalBitOffset(F, Local) : 0;
72 return Reader.ReadSourceLocation(F, R, I);
76 return Reader.ReadSourceRange(F, R, I);
80 return Reader.GetTypeSourceInfo(F, R, I);
84 return Reader.ReadDeclID(F, R, I);
87 std::string ReadString(
const RecordData &R,
unsigned &I) {
88 return Reader.ReadString(R, I);
92 for (
unsigned I = 0, Size = Record[Idx++]; I != Size; ++
I)
93 IDs.push_back(ReadDeclID(Record, Idx));
97 return Reader.ReadDecl(F, R, I);
101 T *ReadDeclAs(
const RecordData &R,
unsigned &I) {
102 return Reader.ReadDeclAs<T>(F, R,
I);
107 Reader.ReadQualifierInfo(F, Info, R, I);
112 Reader.ReadDeclarationNameLoc(F, DNLoc, Name, R, I);
117 Reader.ReadDeclarationNameInfo(F, NameInfo, R, I);
125 return Reader.getGlobalSubmoduleID(F, R[I++]);
129 return Reader.getSubmodule(readSubmoduleID(R, I));
133 void ReadCXXDefinitionData(
struct CXXRecordDecl::DefinitionData &Data,
136 struct CXXRecordDecl::DefinitionData &&NewDD);
145 class RedeclarableResult {
152 : FirstID(FirstID), MergeWith(MergeWith), IsKeyDecl(IsKeyDecl) {}
158 bool isKeyDecl()
const {
return IsKeyDecl; }
162 Decl *getKnownMergeTarget()
const {
return MergeWith; }
170 class FindExistingResult {
174 mutable bool AddResult;
176 unsigned AnonymousDeclNumber;
179 void operator=(FindExistingResult&) =
delete;
183 : Reader(Reader), New(
nullptr), Existing(
nullptr), AddResult(
false),
184 AnonymousDeclNumber(0), TypedefNameForLinkage(
nullptr) {}
187 unsigned AnonymousDeclNumber,
189 : Reader(Reader), New(New), Existing(Existing), AddResult(
true),
190 AnonymousDeclNumber(AnonymousDeclNumber),
191 TypedefNameForLinkage(TypedefNameForLinkage) {}
193 FindExistingResult(
const FindExistingResult &Other)
194 : Reader(Other.Reader), New(Other.New), Existing(Other.Existing),
195 AddResult(Other.AddResult),
196 AnonymousDeclNumber(Other.AnonymousDeclNumber),
197 TypedefNameForLinkage(Other.TypedefNameForLinkage) {
198 Other.AddResult =
false;
201 ~FindExistingResult();
205 void suppress() { AddResult =
false; }
207 operator NamedDecl*()
const {
return Existing; }
210 operator T*()
const {
return dyn_cast_or_null<T>(Existing); }
215 FindExistingResult findExisting(
NamedDecl *D);
221 : Reader(Reader), F(*Loc.F),
Offset(Loc.
Offset), ThisDeclID(thisDeclID),
222 ThisDeclLoc(ThisDeclLoc), Record(Record), Idx(Idx),
223 TypeIDForTypeDecl(0), NamedDeclForTagDecl(0),
224 TypedefNameForLinkage(nullptr), HasPendingBody(
false),
225 IsDeclMarkedUsed(
false) {}
227 template <
typename DeclT>
229 static Decl *getMostRecentDeclImpl(...);
230 static Decl *getMostRecentDecl(
Decl *D);
232 template <
typename DeclT>
233 static void attachPreviousDeclImpl(
ASTReader &Reader,
236 static void attachPreviousDeclImpl(
ASTReader &Reader, ...);
240 template <
typename DeclT>
242 static void attachLatestDeclImpl(...);
243 static void attachLatestDecl(
Decl *D,
Decl *latest);
245 template <
typename DeclT>
247 static void markIncompleteDeclChainImpl(...);
254 void UpdateDecl(
Decl *D, ModuleFile &ModuleFile,
255 const RecordData &Record);
259 Cat->NextClassCategory =
Next;
262 void VisitDecl(
Decl *D);
276 RedeclarableResult VisitTagDecl(
TagDecl *TD);
278 RedeclarableResult VisitRecordDeclImpl(
RecordDecl *RD);
282 RedeclarableResult VisitClassTemplateSpecializationDeclImpl(
286 VisitClassTemplateSpecializationDeclImpl(D);
288 void VisitClassTemplatePartialSpecializationDecl(
290 void VisitClassScopeFunctionSpecializationDecl(
295 VisitVarTemplateSpecializationDeclImpl(D);
297 void VisitVarTemplatePartialSpecializationDecl(
312 RedeclarableResult VisitVarDeclImpl(
VarDecl *D);
339 std::pair<uint64_t, uint64_t> VisitDeclContext(
DeclContext *DC);
346 DeclID TemplatePatternID = 0);
350 RedeclarableResult &Redecl,
351 DeclID TemplatePatternID = 0);
358 DeclID DsID,
bool IsKeyDecl);
391 Def, MergedDef->getImportedOwningModule(),
393 Reader.PendingMergedDefinitionsToDeduplicate.insert(Def);
396 assert(
SubmoduleID &&
"hidden definition in no module");
407 template<
typename DeclT>
408 class MergedRedeclIterator {
409 DeclT *Start, *Canonical, *
Current;
411 MergedRedeclIterator() :
Current(nullptr) {}
412 MergedRedeclIterator(DeclT *Start)
413 : Start(Start), Canonical(nullptr),
Current(Start) {}
417 MergedRedeclIterator &operator++() {
433 friend bool operator!=(
const MergedRedeclIterator &A,
434 const MergedRedeclIterator &B) {
435 return A.Current != B.Current;
440 template<
typename DeclT>
442 return llvm::make_range(MergedRedeclIterator<DeclT>(D),
443 MergedRedeclIterator<DeclT>());
446 uint64_t ASTDeclReader::GetCurrentCursorOffset() {
447 return F.DeclsCursor.GetCurrentBitNo() + F.GlobalBitOffset;
455 D->getCanonicalDecl()->Used |= IsDeclMarkedUsed;
456 IsDeclMarkedUsed =
false;
463 GetTypeSourceInfo(Record, Idx);
466 DD->DeclInfo = GetTypeSourceInfo(Record, Idx);
470 if (
TypeDecl *TD = dyn_cast<TypeDecl>(D)) {
472 TD->setTypeForDecl(Reader.GetType(TypeIDForTypeDecl).getTypePtrOrNull());
476 if (NamedDeclForTagDecl)
477 cast<TagDecl>(D)->TypedefNameDeclOrQualifier =
478 cast<TypedefNameDecl>(Reader.GetDecl(NamedDeclForTagDecl));
481 ID->TypeForDecl = Reader.GetType(TypeIDForTypeDecl).getTypePtrOrNull();
482 }
else if (
FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
488 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
489 CD->NumCtorInitializers = Record[Idx++];
490 if (CD->NumCtorInitializers)
491 CD->CtorInitializers = ReadGlobalOffset(F, Record, Idx);
493 Reader.PendingBodies[FD] = GetCurrentCursorOffset();
494 HasPendingBody =
true;
500 if (D->isTemplateParameter() || D->isTemplateParameterPack() ||
501 isa<ParmVarDecl>(D)) {
508 GlobalDeclID SemaDCIDForTemplateParmDecl = ReadDeclID(Record, Idx);
509 GlobalDeclID LexicalDCIDForTemplateParmDecl = ReadDeclID(Record, Idx);
510 if (!LexicalDCIDForTemplateParmDecl)
511 LexicalDCIDForTemplateParmDecl = SemaDCIDForTemplateParmDecl;
512 Reader.addPendingDeclContextInfo(D,
513 SemaDCIDForTemplateParmDecl,
514 LexicalDCIDForTemplateParmDecl);
515 D->setDeclContext(Reader.getContext().getTranslationUnitDecl());
517 DeclContext *SemaDC = ReadDeclAs<DeclContext>(Record, Idx);
518 DeclContext *LexicalDC = ReadDeclAs<DeclContext>(Record, Idx);
524 D->setDeclContextsImpl(MergedSemaDC ? MergedSemaDC : SemaDC, LexicalDC,
525 Reader.getContext());
527 D->setLocation(ThisDeclLoc);
528 D->setInvalidDecl(Record[Idx++]);
531 Reader.ReadAttributes(F, Attrs, Record, Idx);
534 D->setAttrsImpl(Attrs, Reader.getContext());
536 D->setImplicit(Record[Idx++]);
537 D->Used = Record[Idx++];
538 IsDeclMarkedUsed |= D->Used;
539 D->setReferenced(Record[Idx++]);
540 D->setTopLevelDeclInObjCContainer(Record[Idx++]);
542 D->FromASTFile =
true;
543 D->setModulePrivate(Record[Idx++]);
544 D->Hidden = D->isModulePrivate();
548 if (
unsigned SubmoduleID = readSubmoduleID(Record, Idx)) {
554 }
else if (Reader.getContext().getLangOpts().ModulesLocalVisibility) {
566 Reader.HiddenNamesMap[Owner].push_back(D);
574 D->setLocation(ReadSourceLocation(Record, Idx));
576 std::string Arg = ReadString(Record, Idx);
577 memcpy(D->getTrailingObjects<
char>(), Arg.data(), Arg.size());
578 D->getTrailingObjects<
char>()[Arg.size()] =
'\0';
583 D->setLocation(ReadSourceLocation(Record, Idx));
584 std::string
Name = ReadString(Record, Idx);
585 memcpy(D->getTrailingObjects<
char>(), Name.data(), Name.size());
586 D->getTrailingObjects<
char>()[Name.size()] =
'\0';
588 D->ValueStart = Name.size() + 1;
589 std::string
Value = ReadString(Record, Idx);
590 memcpy(D->getTrailingObjects<
char>() + D->ValueStart, Value.data(),
592 D->getTrailingObjects<
char>()[D->ValueStart + Value.size()] =
'\0';
596 llvm_unreachable(
"Translation units are not serialized");
601 ND->
setDeclName(Reader.ReadDeclarationName(F, Record, Idx));
602 AnonymousDeclNumber = Record[Idx++];
609 TypeIDForTypeDecl = Reader.getGlobalTypeID(F, Record[Idx++]);
612 ASTDeclReader::RedeclarableResult
614 RedeclarableResult Redecl = VisitRedeclarable(TD);
618 QualType modedT = Reader.readType(F, Record, Idx);
626 RedeclarableResult Redecl = VisitTypedefNameDecl(TD);
627 mergeRedeclarable(TD, Redecl);
631 RedeclarableResult Redecl = VisitTypedefNameDecl(TD);
632 if (
auto *Template = ReadDeclAs<TypeAliasTemplateDecl>(Record, Idx))
636 mergeRedeclarable(TD, Redecl);
640 RedeclarableResult Redecl = VisitRedeclarable(TD);
643 TD->IdentifierNamespace = Record[Idx++];
645 if (!isa<CXXRecordDecl>(TD))
652 switch (Record[Idx++]) {
657 ReadQualifierInfo(*Info, Record, Idx);
658 TD->TypedefNameDeclOrQualifier = Info;
662 NamedDeclForTagDecl = ReadDeclID(Record, Idx);
663 TypedefNameForLinkage = Reader.GetIdentifierInfo(F, Record, Idx);
666 llvm_unreachable(
"unexpected tag info kind");
669 if (!isa<CXXRecordDecl>(TD))
670 mergeRedeclarable(TD, Redecl);
676 if (
TypeSourceInfo *TI = Reader.GetTypeSourceInfo(F, Record, Idx))
689 if (ED->IsCompleteDefinition &&
690 Reader.getContext().getLangOpts().Modules &&
691 Reader.getContext().getLangOpts().CPlusPlus) {
697 if (!D->isFromASTFile() && D->isCompleteDefinition()) {
704 Reader.MergedDeclContexts.insert(std::make_pair(ED, OldDef));
705 ED->IsCompleteDefinition =
false;
706 mergeDefinitionVisibility(OldDef, ED);
712 if (
EnumDecl *InstED = ReadDeclAs<EnumDecl>(Record, Idx)) {
715 ED->setInstantiationOfMemberEnum(Reader.getContext(), InstED, TSK);
720 ASTDeclReader::RedeclarableResult
722 RedeclarableResult Redecl = VisitTagDecl(RD);
732 VD->
setType(Reader.readType(F, Record, Idx));
739 ECD->
setInitVal(Reader.ReadAPSInt(Record, Idx));
749 ReadQualifierInfo(*Info, Record, Idx);
755 RedeclarableResult Redecl = VisitRedeclarable(FD);
756 VisitDeclaratorDecl(FD);
758 ReadDeclarationNameLoc(FD->DNLoc, FD->
getDeclName(), Record, Idx);
759 FD->IdentifierNamespace = Record[Idx++];
765 FD->IsInline = Record[Idx++];
766 FD->IsInlineSpecified = Record[Idx++];
767 FD->IsVirtualAsWritten = Record[Idx++];
768 FD->IsPure = Record[Idx++];
769 FD->HasInheritedPrototype = Record[Idx++];
770 FD->HasWrittenPrototype = Record[Idx++];
771 FD->IsDeleted = Record[Idx++];
772 FD->IsTrivial = Record[Idx++];
773 FD->IsDefaulted = Record[Idx++];
774 FD->IsExplicitlyDefaulted = Record[Idx++];
775 FD->HasImplicitReturnZero = Record[Idx++];
776 FD->IsConstexpr = Record[Idx++];
777 FD->HasSkippedBody = Record[Idx++];
778 FD->IsLateTemplateParsed = Record[Idx++];
779 FD->setCachedLinkage(
Linkage(Record[Idx++]));
780 FD->EndRangeLoc = ReadSourceLocation(Record, Idx);
784 mergeRedeclarable(FD, Redecl);
792 FunctionDecl *InstFD = ReadDeclAs<FunctionDecl>(Record, Idx);
795 FD->setInstantiationOfMemberFunction(Reader.getContext(), InstFD, TSK);
797 mergeRedeclarable(FD, Redecl);
807 Reader.ReadTemplateArgumentList(TemplArgs, F, Record, Idx,
813 bool HasTemplateArgumentsAsWritten = Record[Idx++];
814 if (HasTemplateArgumentsAsWritten) {
815 unsigned NumTemplateArgLocs = Record[Idx++];
816 TemplArgLocs.reserve(NumTemplateArgLocs);
817 for (
unsigned i=0; i != NumTemplateArgLocs; ++i)
818 TemplArgLocs.push_back(
819 Reader.ReadTemplateArgumentLoc(F, Record, Idx));
821 LAngleLoc = ReadSourceLocation(Record, Idx);
822 RAngleLoc = ReadSourceLocation(Record, Idx);
831 for (
unsigned i=0, e = TemplArgLocs.size(); i != e; ++i)
836 HasTemplateArgumentsAsWritten ? &TemplArgsInfo
839 FD->TemplateOrSpecialization = FTInfo;
841 if (FD->isCanonicalDecl()) {
845 = ReadDeclAs<FunctionTemplateDecl>(Record, Idx);
851 llvm::FoldingSetNodeID
ID;
853 void *InsertPos =
nullptr;
860 assert(Reader.getContext().getLangOpts().Modules &&
861 "already deserialized this template specialization");
862 mergeRedeclarable(FD, ExistingInfo->
Function, Redecl);
870 unsigned NumTemplates = Record[Idx++];
871 while (NumTemplates--)
872 TemplDecls.
addDecl(ReadDeclAs<NamedDecl>(Record, Idx));
876 unsigned NumArgs = Record[Idx++];
878 TemplArgs.
addArgument(Reader.ReadTemplateArgumentLoc(F, Record, Idx));
879 TemplArgs.
setLAngleLoc(ReadSourceLocation(Record, Idx));
880 TemplArgs.
setRAngleLoc(ReadSourceLocation(Record, Idx));
883 TemplDecls, TemplArgs);
891 unsigned NumParams = Record[Idx++];
893 Params.reserve(NumParams);
894 for (
unsigned I = 0;
I != NumParams; ++
I)
895 Params.push_back(ReadDeclAs<ParmVarDecl>(Record, Idx));
896 FD->setParams(Reader.getContext(), Params);
904 Reader.PendingBodies[MD] = GetCurrentCursorOffset();
905 HasPendingBody =
true;
906 MD->
setSelfDecl(ReadDeclAs<ImplicitParamDecl>(Record, Idx));
907 MD->
setCmdDecl(ReadDeclAs<ImplicitParamDecl>(Record, Idx));
913 MD->IsOverriding = Record[Idx++];
914 MD->HasSkippedBody = Record[Idx++];
916 MD->IsRedeclaration = Record[Idx++];
917 MD->HasRedeclaration = Record[Idx++];
918 if (MD->HasRedeclaration)
919 Reader.getContext().setObjCMethodRedeclaration(MD,
920 ReadDeclAs<ObjCMethodDecl>(Record, Idx));
927 MD->DeclEndLoc = ReadSourceLocation(Record, Idx);
928 unsigned NumParams = Record[Idx++];
930 Params.reserve(NumParams);
931 for (
unsigned I = 0;
I != NumParams; ++
I)
932 Params.push_back(ReadDeclAs<ParmVarDecl>(Record, Idx));
934 MD->SelLocsKind = Record[Idx++];
935 unsigned NumStoredSelLocs = Record[Idx++];
937 SelLocs.reserve(NumStoredSelLocs);
938 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
939 SelLocs.push_back(ReadSourceLocation(Record, Idx));
941 MD->setParamsAndSelLocs(Reader.getContext(), Params, SelLocs);
945 VisitTypedefNameDecl(D);
947 D->Variance = Record[Idx++];
948 D->Index = Record[Idx++];
949 D->VarianceLoc = ReadSourceLocation(Record, Idx);
950 D->ColonLoc = ReadSourceLocation(Record, Idx);
960 unsigned numParams = Record[Idx++];
965 typeParams.reserve(numParams);
966 for (
unsigned i = 0; i != numParams; ++i) {
967 auto typeParam = ReadDeclAs<ObjCTypeParamDecl>(Record, Idx);
971 typeParams.push_back(typeParam);
978 typeParams, rAngleLoc);
982 RedeclarableResult Redecl = VisitRedeclarable(ID);
983 VisitObjCContainerDecl(ID);
984 TypeIDForTypeDecl = Reader.getGlobalTypeID(F, Record[Idx++]);
985 mergeRedeclarable(ID, Redecl);
987 ID->TypeParamList = ReadObjCTypeParamList();
990 ID->allocateDefinitionData();
996 ObjCInterfaceDecl::DefinitionData &Data = ID->data();
999 Data.SuperClassTInfo = GetTypeSourceInfo(Record, Idx);
1001 Data.EndLoc = ReadSourceLocation(Record, Idx);
1002 Data.HasDesignatedInitializers = Record[Idx++];
1005 unsigned NumProtocols = Record[Idx++];
1007 Protocols.reserve(NumProtocols);
1008 for (
unsigned I = 0;
I != NumProtocols; ++
I)
1009 Protocols.push_back(ReadDeclAs<ObjCProtocolDecl>(Record, Idx));
1011 ProtoLocs.reserve(NumProtocols);
1012 for (
unsigned I = 0;
I != NumProtocols; ++
I)
1013 ProtoLocs.push_back(ReadSourceLocation(Record, Idx));
1015 Reader.getContext());
1018 NumProtocols = Record[Idx++];
1020 Protocols.reserve(NumProtocols);
1021 for (
unsigned I = 0;
I != NumProtocols; ++
I)
1022 Protocols.push_back(ReadDeclAs<ObjCProtocolDecl>(Record, Idx));
1023 ID->data().AllReferencedProtocols.set(Protocols.data(), NumProtocols,
1024 Reader.getContext());
1030 Reader.PendingDefinitions.insert(ID);
1033 Reader.ObjCClassesLoaded.push_back(ID);
1040 VisitFieldDecl(IVD);
1044 bool synth = Record[Idx++];
1049 RedeclarableResult Redecl = VisitRedeclarable(PD);
1050 VisitObjCContainerDecl(PD);
1051 mergeRedeclarable(PD, Redecl);
1053 if (Record[Idx++]) {
1055 PD->allocateDefinitionData();
1061 unsigned NumProtoRefs = Record[Idx++];
1063 ProtoRefs.reserve(NumProtoRefs);
1064 for (
unsigned I = 0;
I != NumProtoRefs; ++
I)
1065 ProtoRefs.push_back(ReadDeclAs<ObjCProtocolDecl>(Record, Idx));
1067 ProtoLocs.reserve(NumProtoRefs);
1068 for (
unsigned I = 0;
I != NumProtoRefs; ++
I)
1069 ProtoLocs.push_back(ReadSourceLocation(Record, Idx));
1071 Reader.getContext());
1074 Reader.PendingDefinitions.insert(PD);
1085 VisitObjCContainerDecl(CD);
1093 Reader.CategoriesDeserialized.insert(CD);
1095 CD->ClassInterface = ReadDeclAs<ObjCInterfaceDecl>(Record, Idx);
1096 CD->TypeParamList = ReadObjCTypeParamList();
1097 unsigned NumProtoRefs = Record[Idx++];
1099 ProtoRefs.reserve(NumProtoRefs);
1100 for (
unsigned I = 0;
I != NumProtoRefs; ++
I)
1101 ProtoRefs.push_back(ReadDeclAs<ObjCProtocolDecl>(Record, Idx));
1103 ProtoLocs.reserve(NumProtoRefs);
1104 for (
unsigned I = 0;
I != NumProtoRefs; ++
I)
1105 ProtoLocs.push_back(ReadSourceLocation(Record, Idx));
1107 Reader.getContext());
1111 VisitNamedDecl(CAD);
1117 D->
setAtLoc(ReadSourceLocation(Record, Idx));
1119 QualType T = Reader.readType(F, Record, Idx);
1128 D->
setGetterName(Reader.ReadDeclarationName(F,Record, Idx).getObjCSelector());
1129 D->
setSetterName(Reader.ReadDeclarationName(F,Record, Idx).getObjCSelector());
1136 VisitObjCContainerDecl(D);
1141 VisitObjCImplDecl(D);
1143 D->CategoryNameLoc = ReadSourceLocation(Record, Idx);
1147 VisitObjCImplDecl(D);
1148 D->
setSuperClass(ReadDeclAs<ObjCInterfaceDecl>(Record, Idx));
1149 D->SuperLoc = ReadSourceLocation(Record, Idx);
1154 D->NumIvarInitializers = Record[Idx++];
1155 if (D->NumIvarInitializers)
1156 D->IvarInitializers = ReadGlobalOffset(F, Record, Idx);
1161 D->
setAtLoc(ReadSourceLocation(Record, Idx));
1163 D->PropertyIvarDecl = ReadDeclAs<ObjCIvarDecl>(Record, Idx);
1164 D->IvarLoc = ReadSourceLocation(Record, Idx);
1170 VisitDeclaratorDecl(FD);
1171 FD->Mutable = Record[Idx++];
1172 if (
int BitWidthOrInitializer = Record[Idx++]) {
1173 FD->InitStorage.setInt(
1174 static_cast<FieldDecl::InitStorageKind>(BitWidthOrInitializer - 1));
1175 if (FD->InitStorage.getInt() == FieldDecl::ISK_CapturedVLAType) {
1177 FD->InitStorage.setPointer(
1178 Reader.readType(F, Record, Idx).getAsOpaquePtr());
1180 FD->InitStorage.setPointer(Reader.ReadExpr(F));
1184 if (
FieldDecl *Tmpl = ReadDeclAs<FieldDecl>(Record, Idx))
1185 Reader.getContext().setInstantiatedFromUnnamedFieldDecl(FD, Tmpl);
1191 VisitDeclaratorDecl(PD);
1192 PD->GetterId = Reader.GetIdentifierInfo(F, Record, Idx);
1193 PD->SetterId = Reader.GetIdentifierInfo(F, Record, Idx);
1199 FD->ChainingSize = Record[Idx++];
1200 assert(FD->ChainingSize >= 2 &&
"Anonymous chaining must be >= 2");
1201 FD->Chaining =
new (Reader.getContext())
NamedDecl*[FD->ChainingSize];
1203 for (
unsigned I = 0;
I != FD->ChainingSize; ++
I)
1204 FD->Chaining[
I] = ReadDeclAs<NamedDecl>(Record, Idx);
1210 RedeclarableResult Redecl = VisitRedeclarable(VD);
1211 VisitDeclaratorDecl(VD);
1216 if (!isa<ParmVarDecl>(VD)) {
1228 VD->setCachedLinkage(VarLinkage);
1232 VD->getLexicalDeclContext()->isFunctionOrMethod())
1233 VD->setLocalExternDecl();
1235 if (uint64_t Val = Record[Idx++]) {
1236 VD->
setInit(Reader.ReadExpr(F));
1240 Eval->
IsICE = Val == 3;
1245 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
1247 switch ((VarKind)Record[Idx++]) {
1248 case VarNotTemplate:
1251 if (!isa<ParmVarDecl>(VD) && !isa<ImplicitParamDecl>(VD) &&
1252 !isa<VarTemplateSpecializationDecl>(VD))
1253 mergeRedeclarable(VD, Redecl);
1259 case StaticDataMemberSpecialization: {
1260 VarDecl *Tmpl = ReadDeclAs<VarDecl>(Record, Idx);
1263 Reader.getContext().setInstantiatedFromStaticDataMember(VD, Tmpl, TSK,POI);
1264 mergeRedeclarable(VD, Redecl);
1278 unsigned isObjCMethodParam = Record[Idx++];
1279 unsigned scopeDepth = Record[Idx++];
1280 unsigned scopeIndex = Record[Idx++];
1281 unsigned declQualifier = Record[Idx++];
1282 if (isObjCMethodParam) {
1283 assert(scopeDepth == 0);
1300 AD->
setAsmString(cast<StringLiteral>(Reader.ReadExpr(F)));
1306 BD->
setBody(cast_or_null<CompoundStmt>(Reader.ReadStmt(F)));
1308 unsigned NumParams = Record[Idx++];
1310 Params.reserve(NumParams);
1311 for (
unsigned I = 0;
I != NumParams; ++
I)
1312 Params.push_back(ReadDeclAs<ParmVarDecl>(Record, Idx));
1319 bool capturesCXXThis = Record[Idx++];
1320 unsigned numCaptures = Record[Idx++];
1322 captures.reserve(numCaptures);
1323 for (
unsigned i = 0; i != numCaptures; ++i) {
1325 unsigned flags = Record[Idx++];
1326 bool byRef = (flags & 1);
1327 bool nested = (flags & 2);
1328 Expr *copyExpr = ((flags & 4) ? Reader.ReadExpr(F) :
nullptr);
1332 BD->
setCaptures(Reader.getContext(), captures, capturesCXXThis);
1337 unsigned ContextParamPos = Record[Idx++];
1340 for (
unsigned I = 0;
I < CD->NumParams; ++
I) {
1341 if (
I != ContextParamPos)
1342 CD->
setParam(
I, ReadDeclAs<ImplicitParamDecl>(Record, Idx));
1361 RedeclarableResult Redecl = VisitRedeclarable(D);
1364 D->LocStart = ReadSourceLocation(Record, Idx);
1365 D->RBraceLoc = ReadSourceLocation(Record, Idx);
1372 if (Redecl.getFirstID() == ThisDeclID) {
1373 AnonNamespace = ReadDeclID(Record, Idx);
1377 D->AnonOrFirstNamespaceAndInline.setPointer(D->
getFirstDecl());
1380 mergeRedeclarable(D, Redecl);
1382 if (AnonNamespace) {
1386 NamespaceDecl *Anon = cast<NamespaceDecl>(Reader.GetDecl(AnonNamespace));
1393 RedeclarableResult Redecl = VisitRedeclarable(D);
1395 D->NamespaceLoc = ReadSourceLocation(Record, Idx);
1396 D->IdentLoc = ReadSourceLocation(Record, Idx);
1397 D->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
1398 D->Namespace = ReadDeclAs<NamedDecl>(Record, Idx);
1399 mergeRedeclarable(D, Redecl);
1405 D->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
1406 ReadDeclarationNameLoc(D->DNLoc, D->
getDeclName(), Record, Idx);
1407 D->FirstUsingShadow.setPointer(ReadDeclAs<UsingShadowDecl>(Record, Idx));
1409 if (
NamedDecl *Pattern = ReadDeclAs<NamedDecl>(Record, Idx))
1410 Reader.getContext().setInstantiatedFromUsingDecl(D, Pattern);
1415 RedeclarableResult Redecl = VisitRedeclarable(D);
1418 D->UsingOrNextShadow = ReadDeclAs<NamedDecl>(Record, Idx);
1421 Reader.getContext().setInstantiatedFromUsingShadowDecl(D, Pattern);
1422 mergeRedeclarable(D, Redecl);
1427 VisitUsingShadowDecl(D);
1428 D->NominatedBaseClassShadowDecl =
1429 ReadDeclAs<ConstructorUsingShadowDecl>(Record, Idx);
1430 D->ConstructedBaseClassShadowDecl =
1431 ReadDeclAs<ConstructorUsingShadowDecl>(Record, Idx);
1432 D->IsVirtual = Record[Idx++];
1437 D->UsingLoc = ReadSourceLocation(Record, Idx);
1438 D->NamespaceLoc = ReadSourceLocation(Record, Idx);
1439 D->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
1440 D->NominatedNamespace = ReadDeclAs<NamedDecl>(Record, Idx);
1441 D->CommonAncestor = ReadDeclAs<DeclContext>(Record, Idx);
1447 D->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
1448 ReadDeclarationNameLoc(D->DNLoc, D->
getDeclName(), Record, Idx);
1455 D->TypenameLocation = ReadSourceLocation(Record, Idx);
1456 D->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
1460 void ASTDeclReader::ReadCXXDefinitionData(
1461 struct CXXRecordDecl::DefinitionData &Data,
1462 const RecordData &Record,
unsigned &Idx) {
1464 Data.UserDeclaredConstructor = Record[Idx++];
1465 Data.UserDeclaredSpecialMembers = Record[Idx++];
1466 Data.Aggregate = Record[Idx++];
1467 Data.PlainOldData = Record[Idx++];
1468 Data.Empty = Record[Idx++];
1469 Data.Polymorphic = Record[Idx++];
1470 Data.Abstract = Record[Idx++];
1471 Data.IsStandardLayout = Record[Idx++];
1472 Data.HasNoNonEmptyBases = Record[Idx++];
1473 Data.HasPrivateFields = Record[Idx++];
1474 Data.HasProtectedFields = Record[Idx++];
1475 Data.HasPublicFields = Record[Idx++];
1476 Data.HasMutableFields = Record[Idx++];
1477 Data.HasVariantMembers = Record[Idx++];
1478 Data.HasOnlyCMembers = Record[Idx++];
1479 Data.HasInClassInitializer = Record[Idx++];
1480 Data.HasUninitializedReferenceMember = Record[Idx++];
1481 Data.HasUninitializedFields = Record[Idx++];
1482 Data.HasInheritedConstructor = Record[Idx++];
1483 Data.HasInheritedAssignment = Record[Idx++];
1484 Data.NeedOverloadResolutionForMoveConstructor = Record[Idx++];
1485 Data.NeedOverloadResolutionForMoveAssignment = Record[Idx++];
1486 Data.NeedOverloadResolutionForDestructor = Record[Idx++];
1487 Data.DefaultedMoveConstructorIsDeleted = Record[Idx++];
1488 Data.DefaultedMoveAssignmentIsDeleted = Record[Idx++];
1489 Data.DefaultedDestructorIsDeleted = Record[Idx++];
1490 Data.HasTrivialSpecialMembers = Record[Idx++];
1491 Data.DeclaredNonTrivialSpecialMembers = Record[Idx++];
1492 Data.HasIrrelevantDestructor = Record[Idx++];
1493 Data.HasConstexprNonCopyMoveConstructor = Record[Idx++];
1494 Data.HasDefaultedDefaultConstructor = Record[Idx++];
1495 Data.DefaultedDefaultConstructorIsConstexpr = Record[Idx++];
1496 Data.HasConstexprDefaultConstructor = Record[Idx++];
1497 Data.HasNonLiteralTypeFieldsOrBases = Record[Idx++];
1498 Data.ComputedVisibleConversions = Record[Idx++];
1499 Data.UserProvidedDefaultConstructor = Record[Idx++];
1500 Data.DeclaredSpecialMembers = Record[Idx++];
1501 Data.ImplicitCopyConstructorHasConstParam = Record[Idx++];
1502 Data.ImplicitCopyAssignmentHasConstParam = Record[Idx++];
1503 Data.HasDeclaredCopyConstructorWithConstParam = Record[Idx++];
1504 Data.HasDeclaredCopyAssignmentWithConstParam = Record[Idx++];
1506 Data.NumBases = Record[Idx++];
1508 Data.Bases = ReadGlobalOffset(F, Record, Idx);
1509 Data.NumVBases = Record[Idx++];
1511 Data.VBases = ReadGlobalOffset(F, Record, Idx);
1513 Reader.ReadUnresolvedSet(F, Data.Conversions, Record, Idx);
1514 Reader.ReadUnresolvedSet(F, Data.VisibleConversions, Record, Idx);
1515 assert(Data.Definition &&
"Data.Definition should be already set!");
1516 Data.FirstFriend = ReadDeclID(Record, Idx);
1518 if (Data.IsLambda) {
1520 CXXRecordDecl::LambdaDefinitionData &Lambda
1521 =
static_cast<CXXRecordDecl::LambdaDefinitionData &
>(Data);
1522 Lambda.Dependent = Record[Idx++];
1523 Lambda.IsGenericLambda = Record[Idx++];
1524 Lambda.CaptureDefault = Record[Idx++];
1525 Lambda.NumCaptures = Record[Idx++];
1526 Lambda.NumExplicitCaptures = Record[Idx++];
1527 Lambda.ManglingNumber = Record[Idx++];
1528 Lambda.ContextDecl = ReadDecl(Record, Idx);
1530 = (Capture*)Reader.Context.Allocate(
sizeof(Capture)*Lambda.NumCaptures);
1531 Capture *ToCapture = Lambda.Captures;
1532 Lambda.MethodTyInfo = GetTypeSourceInfo(Record, Idx);
1533 for (
unsigned I = 0, N = Lambda.NumCaptures;
I != N; ++
I) {
1535 bool IsImplicit = Record[Idx++];
1541 *ToCapture++ = Capture(Loc, IsImplicit, Kind,
nullptr,
SourceLocation());
1545 VarDecl *Var = ReadDeclAs<VarDecl>(Record, Idx);
1547 *ToCapture++ = Capture(Loc, IsImplicit, Kind, Var, EllipsisLoc);
1554 void ASTDeclReader::MergeDefinitionData(
1555 CXXRecordDecl *D,
struct CXXRecordDecl::DefinitionData &&MergeDD) {
1556 assert(D->DefinitionData &&
1557 "merging class definition into non-definition");
1558 auto &DD = *D->DefinitionData;
1560 if (DD.Definition != MergeDD.Definition) {
1562 Reader.MergedDeclContexts.insert(std::make_pair(MergeDD.Definition,
1564 Reader.PendingDefinitions.erase(MergeDD.Definition);
1565 MergeDD.Definition->IsCompleteDefinition =
false;
1566 mergeDefinitionVisibility(DD.Definition, MergeDD.Definition);
1567 assert(Reader.Lookups.find(MergeDD.Definition) == Reader.Lookups.end() &&
1568 "already loaded pending lookups for merged definition");
1571 auto PFDI = Reader.PendingFakeDefinitionData.find(&DD);
1572 if (PFDI != Reader.PendingFakeDefinitionData.end() &&
1576 assert(!DD.IsLambda && !MergeDD.IsLambda &&
"faked up lambda definition?");
1581 auto *Def = DD.Definition;
1582 DD = std::move(MergeDD);
1583 DD.Definition = Def;
1588 bool DetectedOdrViolation =
false;
1589 #define OR_FIELD(Field) DD.Field |= MergeDD.Field;
1590 #define MATCH_FIELD(Field) \
1591 DetectedOdrViolation |= DD.Field != MergeDD.Field; \
1613 MATCH_FIELD(NeedOverloadResolutionForMoveConstructor)
1614 MATCH_FIELD(NeedOverloadResolutionForMoveAssignment)
1620 OR_FIELD(DeclaredNonTrivialSpecialMembers)
1622 OR_FIELD(HasConstexprNonCopyMoveConstructor)
1623 OR_FIELD(HasDefaultedDefaultConstructor)
1624 MATCH_FIELD(DefaultedDefaultConstructorIsConstexpr)
1625 OR_FIELD(HasConstexprDefaultConstructor)
1632 OR_FIELD(HasDeclaredCopyConstructorWithConstParam)
1633 OR_FIELD(HasDeclaredCopyAssignmentWithConstParam)
1638 if (DD.NumBases != MergeDD.NumBases || DD.NumVBases != MergeDD.NumVBases)
1639 DetectedOdrViolation =
true;
1645 if (MergeDD.ComputedVisibleConversions && !DD.ComputedVisibleConversions) {
1646 DD.VisibleConversions = std::move(MergeDD.VisibleConversions);
1647 DD.ComputedVisibleConversions =
true;
1658 if (DetectedOdrViolation)
1659 Reader.PendingOdrMergeFailures[DD.Definition].push_back(MergeDD.Definition);
1662 void ASTDeclReader::ReadCXXRecordDefinition(
CXXRecordDecl *D,
bool Update) {
1663 struct CXXRecordDecl::DefinitionData *DD;
1668 bool IsLambda = Record[Idx++];
1670 DD =
new (
C) CXXRecordDecl::LambdaDefinitionData(D,
nullptr,
false,
false,
1673 DD =
new (
C)
struct CXXRecordDecl::DefinitionData(D);
1675 ReadCXXDefinitionData(*DD, Record, Idx);
1681 if (Canon->DefinitionData) {
1682 MergeDefinitionData(Canon, std::move(*DD));
1683 D->DefinitionData = Canon->DefinitionData;
1688 D->IsCompleteDefinition =
true;
1689 D->DefinitionData = DD;
1694 if (Update || Canon != D) {
1695 Canon->DefinitionData = D->DefinitionData;
1696 Reader.PendingDefinitions.insert(D);
1700 ASTDeclReader::RedeclarableResult
1702 RedeclarableResult Redecl = VisitRecordDeclImpl(D);
1707 CXXRecNotTemplate = 0, CXXRecTemplate, CXXRecMemberSpecialization
1709 switch ((CXXRecKind)Record[Idx++]) {
1710 case CXXRecNotTemplate:
1712 if (!isa<ClassTemplateSpecializationDecl>(D))
1713 mergeRedeclarable(D, Redecl);
1715 case CXXRecTemplate: {
1718 D->TemplateOrInstantiation = Template;
1726 TypeIDForTypeDecl = 0;
1730 case CXXRecMemberSpecialization: {
1736 D->TemplateOrInstantiation = MSI;
1737 mergeRedeclarable(D, Redecl);
1742 bool WasDefinition = Record[Idx++];
1744 ReadCXXRecordDefinition(D,
false);
1751 if (WasDefinition) {
1752 DeclID KeyFn = ReadDeclID(Record, Idx);
1753 if (KeyFn && D->IsCompleteDefinition)
1757 C.KeyFunctions[D] = KeyFn;
1764 VisitFunctionDecl(D);
1766 unsigned NumOverridenMethods = Record[Idx++];
1767 if (D->isCanonicalDecl()) {
1768 while (NumOverridenMethods--) {
1771 if (
CXXMethodDecl *MD = ReadDeclAs<CXXMethodDecl>(Record, Idx))
1777 Idx += NumOverridenMethods;
1785 auto *Shadow = ReadDeclAs<ConstructorUsingShadowDecl>(Record, Idx);
1786 auto *Ctor = ReadDeclAs<CXXConstructorDecl>(Record, Idx);
1791 VisitCXXMethodDecl(D);
1793 D->IsExplicitSpecified = Record[Idx++];
1797 VisitCXXMethodDecl(D);
1799 if (
auto *OperatorDelete = ReadDeclAs<FunctionDecl>(Record, Idx)) {
1802 if (!Canon->OperatorDelete)
1803 Canon->OperatorDelete = OperatorDelete;
1808 VisitCXXMethodDecl(D);
1809 D->IsExplicitSpecified = Record[Idx++];
1814 D->ImportedAndComplete.setPointer(readModule(Record, Idx));
1815 D->ImportedAndComplete.setInt(Record[Idx++]);
1817 for (
unsigned I = 0, N = Record.back();
I != N; ++
I)
1818 StoredLocs[
I] = ReadSourceLocation(Record, Idx);
1830 D->Friend = ReadDeclAs<NamedDecl>(Record, Idx);
1832 D->Friend = GetTypeSourceInfo(Record, Idx);
1833 for (
unsigned i = 0; i != D->NumTPLists; ++i)
1835 Reader.ReadTemplateParameterList(F, Record, Idx);
1836 D->NextFriend = ReadDeclID(Record, Idx);
1837 D->UnsupportedFriend = (Record[Idx++] != 0);
1838 D->FriendLoc = ReadSourceLocation(Record, Idx);
1843 unsigned NumParams = Record[Idx++];
1844 D->NumParams = NumParams;
1846 for (
unsigned i = 0; i != NumParams; ++i)
1847 D->Params[i] = Reader.ReadTemplateParameterList(F, Record, Idx);
1849 D->Friend = ReadDeclAs<NamedDecl>(Record, Idx);
1851 D->Friend = GetTypeSourceInfo(Record, Idx);
1852 D->FriendLoc = ReadSourceLocation(Record, Idx);
1858 DeclID PatternID = ReadDeclID(Record, Idx);
1859 NamedDecl *TemplatedDecl = cast_or_null<NamedDecl>(Reader.GetDecl(PatternID));
1861 = Reader.ReadTemplateParameterList(F, Record, Idx);
1862 D->
init(TemplatedDecl, TemplateParams);
1867 ASTDeclReader::RedeclarableResult
1869 RedeclarableResult Redecl = VisitRedeclarable(D);
1876 Reader.PendingDefinitions.insert(CanonD);
1882 if (ThisDeclID == Redecl.getFirstID()) {
1884 = ReadDeclAs<RedeclarableTemplateDecl>(Record, Idx)) {
1885 assert(RTD->getKind() == D->getKind() &&
1886 "InstantiatedFromMemberTemplate kind mismatch");
1893 DeclID PatternID = VisitTemplateDecl(D);
1894 D->IdentifierNamespace = Record[Idx++];
1896 mergeRedeclarable(D, Redecl, PatternID);
1908 assert(!IDs.empty() &&
"no IDs to add to list");
1910 IDs.insert(IDs.end(), Old + 1, Old + 1 + Old[0]);
1911 std::sort(IDs.begin(), IDs.end());
1912 IDs.erase(std::unique(IDs.begin(), IDs.end()), IDs.end());
1917 std::copy(IDs.begin(), IDs.end(),
Result + 1);
1922 RedeclarableResult Redecl = VisitRedeclarableTemplateDecl(D);
1924 if (ThisDeclID == Redecl.getFirstID()) {
1928 ReadDeclIDList(SpecIDs);
1930 if (!SpecIDs.empty()) {
1933 Reader.getContext(), CommonPtr->LazySpecializations, SpecIDs);
1941 Reader.Context.getInjectedClassNameType(
1947 llvm_unreachable(
"BuiltinTemplates are not serialized");
1954 RedeclarableResult Redecl = VisitRedeclarableTemplateDecl(D);
1956 if (ThisDeclID == Redecl.getFirstID()) {
1960 ReadDeclIDList(SpecIDs);
1962 if (!SpecIDs.empty()) {
1965 Reader.getContext(), CommonPtr->LazySpecializations, SpecIDs);
1970 ASTDeclReader::RedeclarableResult
1973 RedeclarableResult Redecl = VisitCXXRecordDeclImpl(D);
1976 if (
Decl *InstD = ReadDecl(Record, Idx)) {
1978 D->SpecializedTemplate = CTD;
1981 Reader.ReadTemplateArgumentList(TemplArgs, F, Record, Idx);
1984 ClassTemplateSpecializationDecl::SpecializedPartialSpecialization *PS
1986 SpecializedPartialSpecialization();
1987 PS->PartialSpecialization
1988 = cast<ClassTemplatePartialSpecializationDecl>(InstD);
1989 PS->TemplateArgs = ArgList;
1990 D->SpecializedTemplate = PS;
1995 Reader.ReadTemplateArgumentList(TemplArgs, F, Record, Idx,
1998 D->PointOfInstantiation = ReadSourceLocation(Record, Idx);
2001 bool writtenAsCanonicalDecl = Record[Idx++];
2002 if (writtenAsCanonicalDecl) {
2004 if (D->isCanonicalDecl()) {
2008 dyn_cast<ClassTemplatePartialSpecializationDecl>(D)) {
2010 .GetOrInsertNode(Partial);
2016 if (CanonSpec != D) {
2017 mergeRedeclarable<TagDecl>(D, CanonSpec, Redecl);
2021 if (
auto *DDD = D->DefinitionData) {
2022 if (CanonSpec->DefinitionData)
2023 MergeDefinitionData(CanonSpec, std::move(*DDD));
2025 CanonSpec->DefinitionData = D->DefinitionData;
2027 D->DefinitionData = CanonSpec->DefinitionData;
2034 ClassTemplateSpecializationDecl::ExplicitSpecializationInfo *ExplicitInfo
2035 =
new (
C) ClassTemplateSpecializationDecl::ExplicitSpecializationInfo;
2036 ExplicitInfo->TypeAsWritten = TyInfo;
2037 ExplicitInfo->ExternLoc = ReadSourceLocation(Record, Idx);
2038 ExplicitInfo->TemplateKeywordLoc = ReadSourceLocation(Record, Idx);
2039 D->ExplicitInfo = ExplicitInfo;
2047 RedeclarableResult Redecl = VisitClassTemplateSpecializationDeclImpl(D);
2049 D->TemplateParams = Reader.ReadTemplateParameterList(F, Record, Idx);
2050 D->ArgsAsWritten = Reader.ReadASTTemplateArgumentListInfo(F, Record, Idx);
2053 if (ThisDeclID == Redecl.getFirstID()) {
2054 D->InstantiatedFromMember.setPointer(
2055 ReadDeclAs<ClassTemplatePartialSpecializationDecl>(Record, Idx));
2056 D->InstantiatedFromMember.setInt(Record[Idx++]);
2063 D->Specialization = ReadDeclAs<CXXMethodDecl>(Record, Idx);
2067 RedeclarableResult Redecl = VisitRedeclarableTemplateDecl(D);
2069 if (ThisDeclID == Redecl.getFirstID()) {
2072 ReadDeclIDList(SpecIDs);
2074 if (!SpecIDs.empty()) {
2077 Reader.getContext(), CommonPtr->LazySpecializations, SpecIDs);
2087 ASTDeclReader::RedeclarableResult
2090 RedeclarableResult Redecl = VisitVarDeclImpl(D);
2093 if (
Decl *InstD = ReadDecl(Record, Idx)) {
2095 D->SpecializedTemplate = VTD;
2098 Reader.ReadTemplateArgumentList(TemplArgs, F, Record, Idx);
2101 VarTemplateSpecializationDecl::SpecializedPartialSpecialization *PS =
2103 VarTemplateSpecializationDecl::SpecializedPartialSpecialization();
2104 PS->PartialSpecialization =
2105 cast<VarTemplatePartialSpecializationDecl>(InstD);
2106 PS->TemplateArgs = ArgList;
2107 D->SpecializedTemplate = PS;
2113 VarTemplateSpecializationDecl::ExplicitSpecializationInfo *ExplicitInfo =
2114 new (
C) VarTemplateSpecializationDecl::ExplicitSpecializationInfo;
2115 ExplicitInfo->TypeAsWritten = TyInfo;
2116 ExplicitInfo->ExternLoc = ReadSourceLocation(Record, Idx);
2117 ExplicitInfo->TemplateKeywordLoc = ReadSourceLocation(Record, Idx);
2118 D->ExplicitInfo = ExplicitInfo;
2122 Reader.ReadTemplateArgumentList(TemplArgs, F, Record, Idx,
2125 D->PointOfInstantiation = ReadSourceLocation(Record, Idx);
2128 bool writtenAsCanonicalDecl = Record[Idx++];
2129 if (writtenAsCanonicalDecl) {
2130 VarTemplateDecl *CanonPattern = ReadDeclAs<VarTemplateDecl>(Record, Idx);
2131 if (D->isCanonicalDecl()) {
2134 dyn_cast<VarTemplatePartialSpecializationDecl>(D)) {
2136 .GetOrInsertNode(Partial);
2153 RedeclarableResult Redecl = VisitVarTemplateSpecializationDeclImpl(D);
2155 D->TemplateParams = Reader.ReadTemplateParameterList(F, Record, Idx);
2156 D->ArgsAsWritten = Reader.ReadASTTemplateArgumentListInfo(F, Record, Idx);
2159 if (ThisDeclID == Redecl.getFirstID()) {
2160 D->InstantiatedFromMember.setPointer(
2161 ReadDeclAs<VarTemplatePartialSpecializationDecl>(Record, Idx));
2162 D->InstantiatedFromMember.setInt(Record[Idx++]);
2176 VisitDeclaratorDecl(D);
2181 auto TypesAndInfos =
2182 D->getTrailingObjects<std::pair<QualType, TypeSourceInfo *>>();
2184 new (&TypesAndInfos[
I].first)
QualType(Reader.readType(F, Record, Idx));
2185 TypesAndInfos[
I].second = GetTypeSourceInfo(Record, Idx);
2189 D->ParameterPack = Record[Idx++];
2196 VisitTemplateDecl(D);
2205 Data[
I] = Reader.ReadTemplateParameterList(F, Record, Idx);
2208 D->ParameterPack = Record[Idx++];
2211 Reader.ReadTemplateArgumentLoc(F, Record, Idx));
2216 VisitRedeclarableTemplateDecl(D);
2221 D->AssertExprAndFailed.setPointer(Reader.ReadExpr(F));
2222 D->AssertExprAndFailed.setInt(Record[Idx++]);
2223 D->Message = cast<StringLiteral>(Reader.ReadExpr(F));
2224 D->RParenLoc = ReadSourceLocation(Record, Idx);
2231 std::pair<uint64_t, uint64_t>
2233 uint64_t LexicalOffset = ReadLocalOffset(Record, Idx);
2234 uint64_t VisibleOffset = ReadLocalOffset(Record, Idx);
2235 return std::make_pair(LexicalOffset, VisibleOffset);
2238 template <
typename T>
2239 ASTDeclReader::RedeclarableResult
2241 DeclID FirstDeclID = ReadDeclID(Record, Idx);
2242 Decl *MergeWith =
nullptr;
2244 bool IsKeyDecl = ThisDeclID == FirstDeclID;
2245 bool IsFirstLocalDecl =
false;
2247 uint64_t RedeclOffset = 0;
2251 if (FirstDeclID == 0) {
2252 FirstDeclID = ThisDeclID;
2254 IsFirstLocalDecl =
true;
2255 }
else if (
unsigned N = Record[Idx++]) {
2259 IsFirstLocalDecl =
true;
2266 for (
unsigned I = 0;
I != N - 1; ++
I)
2267 MergeWith = ReadDecl(Record, Idx);
2269 RedeclOffset = ReadLocalOffset(Record, Idx);
2273 (void)ReadDecl(Record, Idx);
2276 T *FirstDecl = cast_or_null<T>(Reader.GetDecl(FirstDeclID));
2277 if (FirstDecl != D) {
2283 D->
First = FirstDecl->getCanonicalDecl();
2286 T *DAsT =
static_cast<T*
>(D);
2292 if (IsFirstLocalDecl)
2293 Reader.PendingDeclChains.push_back(std::make_pair(DAsT, RedeclOffset));
2295 return RedeclarableResult(FirstDeclID, MergeWith, IsKeyDecl);
2300 template<
typename T>
2302 RedeclarableResult &Redecl,
2303 DeclID TemplatePatternID) {
2304 T *D =
static_cast<T*
>(DBase);
2307 if (!Reader.getContext().getLangOpts().Modules)
2314 if (
auto *Existing = Redecl.getKnownMergeTarget())
2316 mergeRedeclarable(D, cast<T>(Existing), Redecl, TemplatePatternID);
2317 else if (FindExistingResult ExistingRes = findExisting(D))
2318 if (T *Existing = ExistingRes)
2319 mergeRedeclarable(D, Existing, Redecl, TemplatePatternID);
2327 llvm_unreachable(
"bad assert_cast");
2334 DeclID DsID,
bool IsKeyDecl) {
2337 RedeclarableResult
Result(DPattern->getCanonicalDecl()->getGlobalID(),
2338 ExistingPattern, IsKeyDecl);
2340 if (
auto *DClass = dyn_cast<CXXRecordDecl>(DPattern)) {
2343 auto *ExistingClass =
2345 if (
auto *DDD = DClass->DefinitionData) {
2346 if (ExistingClass->DefinitionData) {
2347 MergeDefinitionData(ExistingClass, std::move(*DDD));
2349 ExistingClass->DefinitionData = DClass->DefinitionData;
2352 Reader.PendingDefinitions.insert(DClass);
2355 DClass->DefinitionData = ExistingClass->DefinitionData;
2357 return mergeRedeclarable(DClass, cast<TagDecl>(ExistingPattern),
2360 if (
auto *DFunction = dyn_cast<FunctionDecl>(DPattern))
2361 return mergeRedeclarable(DFunction, cast<FunctionDecl>(ExistingPattern),
2363 if (
auto *DVar = dyn_cast<VarDecl>(DPattern))
2364 return mergeRedeclarable(DVar, cast<VarDecl>(ExistingPattern),
Result);
2365 if (
auto *DAlias = dyn_cast<TypeAliasDecl>(DPattern))
2366 return mergeRedeclarable(DAlias, cast<TypedefNameDecl>(ExistingPattern),
2368 llvm_unreachable(
"merged an unknown kind of redeclarable template");
2373 template<
typename T>
2375 RedeclarableResult &Redecl,
2376 DeclID TemplatePatternID) {
2377 T *D =
static_cast<T*
>(DBase);
2380 if (ExistingCanon != DCanon) {
2381 assert(DCanon->getGlobalID() == Redecl.getFirstID() &&
2382 "already merged this declaration");
2388 D->First = ExistingCanon;
2389 ExistingCanon->Used |= D->Used;
2395 if (
auto *Namespace = dyn_cast<NamespaceDecl>(D))
2396 Namespace->AnonOrFirstNamespaceAndInline.setPointer(
2397 assert_cast<NamespaceDecl*>(ExistingCanon));
2400 if (
auto *DTemplate = dyn_cast<RedeclarableTemplateDecl>(D))
2401 mergeTemplatePattern(
2402 DTemplate, assert_cast<RedeclarableTemplateDecl*>(ExistingCanon),
2403 TemplatePatternID, Redecl.isKeyDecl());
2406 if (Redecl.isKeyDecl())
2407 Reader.KeyDecls[ExistingCanon].push_back(Redecl.getFirstID());
2415 template<
typename T>
2418 if (!Reader.getContext().getLangOpts().Modules)
2424 if (!Reader.getContext().getLangOpts().CPlusPlus)
2427 if (FindExistingResult ExistingRes = findExisting(static_cast<T*>(D)))
2428 if (T *Existing = ExistingRes)
2429 Reader.Context.setPrimaryMergedDecl(static_cast<T*>(D),
2430 Existing->getCanonicalDecl());
2437 Vars.reserve(NumVars);
2438 for (
unsigned i = 0; i != NumVars; ++i) {
2439 Vars.push_back(Reader.ReadExpr(F));
2446 D->setLocation(Reader.ReadSourceLocation(F, Record, Idx));
2449 D->PrevDeclInScope = Reader.ReadDeclID(F, Record, Idx);
2463 for (
unsigned i = 0, e = Record[Idx++]; i != e; ++i) {
2464 Attr *New =
nullptr;
2466 SourceRange Range = ReadSourceRange(F, Record, Idx);
2468 #include "clang/Serialization/AttrPCHRead.inc"
2470 assert(New &&
"Unable to decode attribute?");
2471 Attrs.push_back(New);
2485 inline void ASTReader::LoadedDecl(
unsigned Index,
Decl *D) {
2486 assert(!DeclsLoaded[Index] &&
"Decl loaded twice?");
2487 DeclsLoaded[Index] = D;
2501 if (isa<FileScopeAsmDecl>(D) ||
2502 isa<ObjCProtocolDecl>(D) ||
2503 isa<ObjCImplDecl>(D) ||
2504 isa<ImportDecl>(D) ||
2505 isa<PragmaCommentDecl>(D) ||
2506 isa<PragmaDetectMismatchDecl>(D))
2508 if (isa<OMPThreadPrivateDecl>(D) || isa<OMPDeclareReductionDecl>(D))
2509 return !D->getDeclContext()->isFunctionOrMethod();
2510 if (
VarDecl *Var = dyn_cast<VarDecl>(D))
2511 return Var->isFileVarDecl() &&
2514 return Func->doesThisDeclarationHaveABody() || HasBody;
2520 ASTReader::RecordLocation
2523 assert(I != GlobalDeclMap.end() &&
"Corrupted global declaration map");
2527 Loc = TranslateSourceLocation(*M, DOffs.
getLocation());
2528 return RecordLocation(M, DOffs.
BitOffset);
2531 ASTReader::RecordLocation ASTReader::getLocalBitOffset(uint64_t GlobalOffset) {
2533 = GlobalBitOffsetsMap.find(GlobalOffset);
2535 assert(I != GlobalBitOffsetsMap.
end() &&
"Corrupted global bit offsets map");
2536 return RecordLocation(I->second, GlobalOffset - I->second->GlobalBitOffset);
2539 uint64_t ASTReader::getGlobalBitOffset(
ModuleFile &M, uint32_t LocalOffset) {
2550 if (X->getKind() != Y->getKind())
2561 TX->getASTContext().hasSameType(TX->getType(), TY->
getType());
2568 TY->getTemplateParameters());
2575 return NAS->getNamespace();
2583 if (!NSY || NSX->getCanonicalDecl() != NSY->getCanonicalDecl())
2625 for (
unsigned I = 0, N = X->
size(); I != N; ++
I)
2640 if (!X->getDeclContext()->getRedeclContext()->Equals(
2641 Y->getDeclContext()->getRedeclContext()))
2648 return X->getASTContext().hasSameType(TypedefX->getUnderlyingType(),
2649 TypedefY->getUnderlyingType());
2652 if (X->getKind() != Y->getKind())
2656 if (isa<ObjCInterfaceDecl>(X) || isa<ObjCProtocolDecl>(
X))
2659 if (isa<ClassTemplateSpecializationDecl>(X)) {
2666 if (
TagDecl *TagX = dyn_cast<TagDecl>(X)) {
2667 TagDecl *TagY = cast<TagDecl>(Y);
2668 return (TagX->getTagKind() == TagY->
getTagKind()) ||
2682 if (CtorX->getInheritedConstructor() &&
2683 !
isSameEntity(CtorX->getInheritedConstructor().getConstructor(),
2688 FuncX->getASTContext().hasSameType(FuncX->getType(), FuncY->
getType());
2692 if (
VarDecl *VarX = dyn_cast<VarDecl>(X)) {
2693 VarDecl *VarY = cast<VarDecl>(Y);
2706 if (!VarXTy || !VarYTy)
2715 if (
NamespaceDecl *NamespaceX = dyn_cast<NamespaceDecl>(X)) {
2722 if (
TemplateDecl *TemplateX = dyn_cast<TemplateDecl>(X)) {
2731 if (
FieldDecl *FDX = dyn_cast<FieldDecl>(X)) {
2734 return X->getASTContext().hasSameType(FDX->getType(), FDY->
getType());
2738 if (
auto *IFDX = dyn_cast<IndirectFieldDecl>(X)) {
2739 auto *IFDY = cast<IndirectFieldDecl>(Y);
2740 return IFDX->getAnonField()->getCanonicalDecl() ==
2741 IFDY->getAnonField()->getCanonicalDecl();
2745 if (isa<EnumConstantDecl>(X))
2757 if (
auto *UX = dyn_cast<UsingDecl>(X)) {
2758 auto *UY = cast<UsingDecl>(Y);
2760 UX->hasTypename() == UY->hasTypename() &&
2761 UX->isAccessDeclaration() == UY->isAccessDeclaration();
2763 if (
auto *UX = dyn_cast<UnresolvedUsingValueDecl>(X)) {
2764 auto *UY = cast<UnresolvedUsingValueDecl>(Y);
2766 UX->isAccessDeclaration() == UY->isAccessDeclaration();
2768 if (
auto *UX = dyn_cast<UnresolvedUsingTypenameDecl>(X))
2774 if (
auto *NAX = dyn_cast<NamespaceAliasDecl>(X)) {
2775 auto *NAY = cast<NamespaceAliasDecl>(Y);
2776 return NAX->getNamespace()->Equals(NAY->getNamespace());
2787 return ND->getOriginalNamespace();
2791 auto *DD = RD->DefinitionData;
2793 DD = RD->getCanonicalDecl()->DefinitionData;
2800 DD =
new (Reader.Context)
struct CXXRecordDecl::DefinitionData(RD);
2801 RD->IsCompleteDefinition =
true;
2802 RD->DefinitionData = DD;
2803 RD->getCanonicalDecl()->DefinitionData = DD;
2806 Reader.PendingFakeDefinitionData.insert(
2810 return DD->Definition;
2813 if (
EnumDecl *ED = dyn_cast<EnumDecl>(DC))
2814 return ED->getASTContext().getLangOpts().CPlusPlus? ED->getDefinition()
2819 if (
auto *TU = dyn_cast<TranslationUnitDecl>(DC))
2825 ASTDeclReader::FindExistingResult::~FindExistingResult() {
2828 if (TypedefNameForLinkage) {
2830 Reader.ImportedTypedefNamesForLinkage.insert(
2831 std::make_pair(std::make_pair(DC, TypedefNameForLinkage), New));
2835 if (!AddResult || Existing)
2841 setAnonymousDeclForMerging(Reader, New->getLexicalDeclContext(),
2842 AnonymousDeclNumber, New);
2848 }
else if (
DeclContext *MergeDC = getPrimaryContextForMerging(Reader, DC)) {
2851 MergeDC->makeDeclVisibleInContextImpl(New,
true);
2859 bool IsTypedefNameForLinkage) {
2860 if (!IsTypedefNameForLinkage)
2866 if (Found->isFromASTFile())
2869 if (
auto *TND = dyn_cast<TypedefNameDecl>(Found))
2870 return TND->getAnonDeclWithTypedefName();
2880 if (
auto *Merged = Reader.MergedDeclContexts.lookup(DC))
2884 auto &
Previous = Reader.AnonymousDeclarationsForMerging[DC];
2890 if (!cast<Decl>(DC)->isFromASTFile()) {
2893 Previous.push_back(cast<NamedDecl>(ND->getCanonicalDecl()));
2895 Previous[Number] = cast<NamedDecl>(ND->getCanonicalDecl());
2902 void ASTDeclReader::setAnonymousDeclForMerging(
ASTReader &Reader,
2905 if (
auto *Merged = Reader.MergedDeclContexts.lookup(DC))
2908 auto &
Previous = Reader.AnonymousDeclarationsForMerging[DC];
2915 ASTDeclReader::FindExistingResult ASTDeclReader::findExisting(
NamedDecl *D) {
2922 FindExistingResult
Result(Reader, D,
nullptr,
2923 AnonymousDeclNumber, TypedefNameForLinkage);
2928 DeclContext *DC = D->getDeclContext()->getRedeclContext();
2929 if (TypedefNameForLinkage) {
2930 auto It = Reader.ImportedTypedefNamesForLinkage.find(
2931 std::make_pair(DC, TypedefNameForLinkage));
2932 if (It != Reader.ImportedTypedefNamesForLinkage.end())
2934 return FindExistingResult(Reader, D, It->second, AnonymousDeclNumber,
2935 TypedefNameForLinkage);
2943 if (
auto *Existing = getAnonymousDeclForMerging(
2944 Reader, D->getLexicalDeclContext(), AnonymousDeclNumber))
2946 return FindExistingResult(Reader, D, Existing, AnonymousDeclNumber,
2947 TypedefNameForLinkage);
2954 class UpToDateIdentifierRAII {
2960 : II(II), WasOutToDate(
false)
2969 ~UpToDateIdentifierRAII() {
2976 IEnd = IdResolver.
end();
2980 return FindExistingResult(Reader, D, Existing, AnonymousDeclNumber,
2981 TypedefNameForLinkage);
2983 }
else if (
DeclContext *MergeDC = getPrimaryContextForMerging(Reader, DC)) {
2988 return FindExistingResult(Reader, D, Existing, AnonymousDeclNumber,
2989 TypedefNameForLinkage);
2993 return FindExistingResult(Reader);
3001 auto MergedDCIt = Reader.MergedDeclContexts.find(D->getLexicalDeclContext());
3002 if (MergedDCIt != Reader.MergedDeclContexts.end() &&
3003 MergedDCIt->second == D->getDeclContext())
3004 Reader.PendingOdrMergeChecks.push_back(D);
3006 return FindExistingResult(Reader, D,
nullptr,
3007 AnonymousDeclNumber, TypedefNameForLinkage);
3010 template<
typename DeclT>
3015 llvm_unreachable(
"getMostRecentDecl on non-redeclarable declaration");
3021 switch (D->getKind()) {
3022 #define ABSTRACT_DECL(TYPE)
3023 #define DECL(TYPE, BASE) \
3025 return getMostRecentDeclImpl(cast<TYPE##Decl>(D));
3026 #include "clang/AST/DeclNodes.inc"
3028 llvm_unreachable(
"unknown decl kind");
3031 Decl *ASTReader::getMostRecentExistingDecl(
Decl *D) {
3035 template<
typename DeclT>
3039 D->
RedeclLink.setPrevious(cast<DeclT>(Previous));
3056 if (PrevFD->IsInline != FD->IsInline) {
3072 FD->IsInline =
true;
3079 if (FPT && PrevFPT) {
3081 bool WasUnresolved =
3083 if (IsUnresolved != WasUnresolved)
3084 Reader.PendingExceptionSpecUpdates.insert(
3085 std::make_pair(Canon, IsUnresolved ? PrevFD : FD));
3091 llvm_unreachable(
"attachPreviousDecl on non-redeclarable declaration");
3096 template <
typename ParmDecl>
3099 auto *To = cast<ParmDecl>(ToD);
3100 if (!From->hasDefaultArgument())
3102 To->setInheritedDefaultArgument(Context, From);
3111 assert(FromTP->size() == ToTP->size() &&
"merged mismatched templates?");
3113 for (
unsigned I = 0, N = FromTP->size(); I != N; ++
I) {
3114 NamedDecl *FromParam = FromTP->getParam(N - I - 1);
3115 if (FromParam->isParameterPack())
3117 NamedDecl *ToParam = ToTP->getParam(N - I - 1);
3119 if (
auto *FTTP = dyn_cast<TemplateTypeParmDecl>(FromParam)) {
3122 }
else if (
auto *FNTTP = dyn_cast<NonTypeTemplateParmDecl>(FromParam)) {
3127 Context, cast<TemplateTemplateParmDecl>(FromParam), ToParam))
3135 assert(D && Previous);
3137 switch (D->getKind()) {
3138 #define ABSTRACT_DECL(TYPE)
3139 #define DECL(TYPE, BASE) \
3141 attachPreviousDeclImpl(Reader, cast<TYPE##Decl>(D), Previous, Canon); \
3143 #include "clang/AST/DeclNodes.inc"
3151 D->IdentifierNamespace |=
3152 Previous->IdentifierNamespace &
3153 (Decl::IDNS_Ordinary | Decl::IDNS_Tag | Decl::IDNS_Type);
3162 template<
typename DeclT>
3164 D->
RedeclLink.setLatest(cast<DeclT>(Latest));
3167 llvm_unreachable(
"attachLatestDecl on non-redeclarable declaration");
3171 assert(D && Latest);
3173 switch (D->getKind()) {
3174 #define ABSTRACT_DECL(TYPE)
3175 #define DECL(TYPE, BASE) \
3177 attachLatestDeclImpl(cast<TYPE##Decl>(D), Latest); \
3179 #include "clang/AST/DeclNodes.inc"
3183 template<
typename DeclT>
3188 llvm_unreachable(
"markIncompleteDeclChain on non-redeclarable declaration");
3191 void ASTReader::markIncompleteDeclChain(
Decl *D) {
3192 switch (D->getKind()) {
3193 #define ABSTRACT_DECL(TYPE)
3194 #define DECL(TYPE, BASE) \
3196 ASTDeclReader::markIncompleteDeclChainImpl(cast<TYPE##Decl>(D)); \
3198 #include "clang/AST/DeclNodes.inc"
3206 RecordLocation Loc = DeclCursorForID(ID, DeclLoc);
3207 llvm::BitstreamCursor &DeclsCursor = Loc.F->DeclsCursor;
3212 ReadingKindTracker ReadingKind(Read_Decl, *
this);
3215 Deserializing ADecl(
this);
3217 DeclsCursor.JumpToBit(Loc.Offset);
3219 unsigned Code = DeclsCursor.ReadCode();
3224 switch ((
DeclCode)DeclsCursor.readRecord(Code, Record)) {
3227 llvm_unreachable(
"Record cannot be de-serialized with ReadDeclRecord");
3410 Error(
"attempt to read a C++ base-specifier record as a declaration");
3413 Error(
"attempt to read a C++ ctor initializer record as a declaration");
3444 assert(D &&
"Unknown declaration reading AST file");
3445 LoadedDecl(Index, D);
3455 std::pair<uint64_t, uint64_t> Offsets = Reader.VisitDeclContext(DC);
3456 if (Offsets.first &&
3457 ReadLexicalDeclContextStorage(*Loc.F, DeclsCursor, Offsets.first, DC))
3459 if (Offsets.second &&
3460 ReadVisibleDeclContextStorage(*Loc.F, DeclsCursor, Offsets.second, ID))
3463 assert(Idx == Record.size());
3466 PendingUpdateRecords.push_back(std::make_pair(ID, D));
3470 if (
Class->isThisDeclarationADefinition())
3471 loadObjCCategories(ID, Class);
3478 InterestingDecls.push_back(D);
3487 ProcessingUpdatesRAIIObj ProcessingUpdates(*
this);
3489 if (UpdI != DeclUpdateOffsets.end()) {
3490 auto UpdateOffsets = std::move(UpdI->second);
3491 DeclUpdateOffsets.erase(UpdI);
3494 for (
auto &FileAndOffset : UpdateOffsets) {
3496 uint64_t
Offset = FileAndOffset.second;
3499 Cursor.JumpToBit(Offset);
3501 unsigned Code = Cursor.ReadCode();
3502 unsigned RecCode = Cursor.readRecord(Code, Record);
3504 assert(RecCode ==
DECL_UPDATES &&
"Expected DECL_UPDATES record!");
3509 Reader.UpdateDecl(D, *F, Record);
3513 if (!WasInteresting &&
3515 InterestingDecls.push_back(D);
3516 WasInteresting =
true;
3522 auto I = PendingVisibleUpdates.
find(ID);
3523 if (I != PendingVisibleUpdates.
end()) {
3524 auto VisibleUpdates = std::move(I->second);
3525 PendingVisibleUpdates.erase(I);
3527 auto *DC = cast<DeclContext>(D)->getPrimaryContext();
3528 for (
const PendingVisibleUpdate &Update : VisibleUpdates)
3529 Lookups[DC].Table.add(
3530 Update.Mod, Update.Data,
3536 void ASTReader::loadPendingDeclChain(
Decl *FirstLocal, uint64_t LocalOffset) {
3538 Decl *CanonDecl = FirstLocal->getCanonicalDecl();
3539 if (FirstLocal != CanonDecl) {
3542 *
this, FirstLocal, PrevMostRecent ? PrevMostRecent : CanonDecl,
3552 ModuleFile *M = getOwningModuleFile(FirstLocal);
3553 assert(M &&
"imported decl from no module file");
3557 Cursor.JumpToBit(LocalOffset);
3560 unsigned Code = Cursor.ReadCode();
3561 unsigned RecCode = Cursor.readRecord(Code, Record);
3567 Decl *MostRecent = FirstLocal;
3568 for (
unsigned I = 0, N = Record.size(); I != N; ++
I) {
3569 auto *D = GetLocalDecl(*M, Record[N - I - 1]);
3579 class ObjCCategoriesVisitor {
3583 llvm::SmallPtrSetImpl<ObjCCategoryDecl *> &Deserialized;
3584 unsigned PreviousGeneration;
3586 llvm::DenseMap<DeclarationName, ObjCCategoryDecl *> NameCategoryMap;
3590 if (!Deserialized.erase(Cat))
3610 Reader.
Diag(Cat->getLocation(), diag::warn_dup_category_def)
3611 << Interface->getDeclName() << Cat->
getDeclName();
3612 Reader.
Diag(Existing->getLocation(), diag::note_previous_definition);
3613 }
else if (!Existing) {
3623 Interface->setCategoryListRaw(Cat);
3628 ObjCCategoriesVisitor(
ASTReader &Reader,
3631 llvm::SmallPtrSetImpl<ObjCCategoryDecl *> &Deserialized,
3632 unsigned PreviousGeneration)
3633 : Reader(Reader), InterfaceID(InterfaceID), Interface(Interface),
3634 Deserialized(Deserialized), PreviousGeneration(PreviousGeneration),
3676 unsigned Offset = Result->
Offset;
3679 for (
unsigned I = 0; I != N; ++
I)
3680 add(cast_or_null<ObjCCategoryDecl>(
3689 unsigned PreviousGeneration) {
3690 ObjCCategoriesVisitor Visitor(*
this, ID, D, CategoriesDeserialized,
3691 PreviousGeneration);
3692 ModuleMgr.visit(Visitor);
3695 template<
typename DeclT,
typename Fn>
3702 auto *MostRecent = D->getMostRecentDecl();
3704 for (
auto *Redecl = MostRecent; Redecl && !Found;
3705 Redecl = Redecl->getPreviousDecl())
3706 Found = (Redecl == D);
3710 for (
auto *Redecl = MostRecent; Redecl != D;
3711 Redecl = Redecl->getPreviousDecl())
3718 while (Idx < Record.size()) {
3721 auto *RD = cast<CXXRecordDecl>(D);
3725 assert(MD &&
"couldn't read decl from update record");
3728 RD->addedMember(MD);
3734 (void)Reader.
ReadDecl(ModuleFile, Record, Idx);
3749 cast<NamespaceDecl>(D)->setAnonymousNamespace(Anon);
3755 cast<VarDecl>(D)->getMemberSpecializationInfo()->setPointOfInstantiation(
3760 auto Param = cast<ParmVarDecl>(D);
3765 auto DefaultArg = Reader.
ReadExpr(F);
3769 if (Param->hasUninstantiatedDefaultArg())
3770 Param->setDefaultArg(DefaultArg);
3776 if (Reader.PendingBodies[FD]) {
3782 if (Record[Idx++]) {
3791 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
3792 CD->NumCtorInitializers = Record[Idx++];
3793 if (CD->NumCtorInitializers)
3794 CD->CtorInitializers = ReadGlobalOffset(F, Record, Idx);
3797 Reader.PendingBodies[FD] = GetCurrentCursorOffset();
3798 HasPendingBody =
true;
3799 assert(Idx == Record.size() &&
"lazy body must be last");
3804 auto *RD = cast<CXXRecordDecl>(D);
3805 auto *OldDD = RD->getCanonicalDecl()->DefinitionData;
3806 bool HadRealDefinition =
3807 OldDD && (OldDD->Definition != RD ||
3808 !Reader.PendingFakeDefinitionData.count(OldDD));
3809 ReadCXXRecordDefinition(RD,
true);
3812 uint64_t LexicalOffset = ReadLocalOffset(Record, Idx);
3813 if (!HadRealDefinition && LexicalOffset) {
3814 Reader.ReadLexicalDeclContextStorage(ModuleFile, ModuleFile.DeclsCursor,
3816 Reader.PendingFakeDefinitionData.erase(OldDD);
3822 RD->getMemberSpecializationInfo()) {
3823 MSInfo->setTemplateSpecializationKind(TSK);
3824 MSInfo->setPointOfInstantiation(POI);
3827 cast<ClassTemplateSpecializationDecl>(RD);
3831 if (Record[Idx++]) {
3833 ReadDeclAs<ClassTemplatePartialSpecializationDecl>(Record, Idx);
3852 if (Record[Idx++]) {
3864 auto *First = cast<CXXDestructorDecl>(D->getCanonicalDecl());
3866 if (!First->OperatorDelete)
3867 First->OperatorDelete = Del;
3874 Reader.readExceptionSpec(ModuleFile, ExceptionStorage, ESI, Record, Idx);
3877 auto *FD = cast<FunctionDecl>(D);
3883 FPT->getReturnType(), FPT->getParamTypes(),
3884 FPT->getExtProtoInfo().withExceptionSpec(ESI)));
3888 Reader.PendingExceptionSpecUpdates.insert(
3889 std::make_pair(FD->getCanonicalDecl(), FD));
3907 D->markUsed(Reader.Context);
3920 D->addAttr(OMPThreadPrivateDeclAttr::CreateImplicit(
3921 Reader.Context, ReadSourceRange(Record, Idx)));
3925 unsigned SubmoduleID = readSubmoduleID(Record, Idx);
3926 auto *Exported = cast<NamedDecl>(D);
3927 if (
auto *TD = dyn_cast<TagDecl>(Exported))
3928 Exported = TD->getDefinition();
3933 Reader.PendingMergedDefinitionsToDeduplicate.insert(
3934 cast<NamedDecl>(Exported));
3938 Reader.HiddenNamesMap[Owner].push_back(Exported);
3941 Exported->Hidden =
false;
3950 assert(Attrs.size() == 1);
3951 D->addAttr(Attrs[0]);
RedeclarableResult VisitTypedefNameDecl(TypedefNameDecl *TD)
void VisitTypeDecl(TypeDecl *TD)
void setCategoryNameLoc(SourceLocation Loc)
A FriendTemplateDecl record.
Defines the clang::ASTContext interface.
A NonTypeTemplateParmDecl record.
void setScopeInfo(unsigned scopeDepth, unsigned parameterIndex)
Decl * GetLocalDecl(ModuleFile &F, uint32_t LocalID)
Reads a declaration with the given local ID in the given module.
bool hasPendingBody() const
Determine whether this declaration has a pending body.
void VisitClassScopeFunctionSpecializationDecl(ClassScopeFunctionSpecializationDecl *D)
static const Decl * getCanonicalDecl(const Decl *D)
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
void VisitVarDecl(VarDecl *VD)
#define MATCH_FIELD(Field)
void setAnonymousStructOrUnion(bool Anon)
A class which contains all the information about a particular captured value.
static ImportDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned NumLocations)
Create a new, deserialized module import declaration.
void VisitImportDecl(ImportDecl *D)
A (possibly-)qualified type.
void mergeMergeable(Mergeable< T > *D)
Attempts to merge the given declaration (D) with another declaration of the same entity, for the case where the entity is not actually redeclarable.
static ObjCIvarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
FunctionDecl * Function
The function template specialization that this structure describes.
void setDefaultArgument(TypeSourceInfo *DefArg)
Set the default argument for this template parameter.
void VisitUsingDecl(UsingDecl *D)
static UnresolvedUsingValueDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static VarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setLParenLoc(SourceLocation L)
bool tryAddTopLevelDecl(NamedDecl *D, DeclarationName Name)
Try to add the given declaration to the top level scope, if it (or a redeclaration of it) hasn't alre...
void VisitFieldDecl(FieldDecl *FD)
void VisitImplicitParamDecl(ImplicitParamDecl *PD)
An OMPThreadPrivateDecl record.
void VisitObjCIvarDecl(ObjCIvarDecl *D)
void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D)
bool isParameterPack() const
Returns whether this is a parameter pack.
static void setNextObjCCategory(ObjCCategoryDecl *Cat, ObjCCategoryDecl *Next)
bool IsICE
Whether this statement is an integral constant expression, or in C++11, whether the statement is a co...
RedeclarableResult VisitClassTemplateSpecializationDeclImpl(ClassTemplateSpecializationDecl *D)
EnumConstantDecl - An instance of this object exists for each enum constant that is defined...
void setEmbeddedInDeclarator(bool isInDeclarator)
No linkage, which means that the entity is unique and can only be referred to from within its scope...
unsigned Generation
The generation of which this module file is a part.
static AccessSpecDecl * CreateDeserialized(ASTContext &C, unsigned ID)
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
void setParam(unsigned i, ImplicitParamDecl *P)
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
An OMPDeclareReductionDecl record.
void VisitEnumConstantDecl(EnumConstantDecl *ECD)
static void attachLatestDeclImpl(Redeclarable< DeclT > *D, Decl *Latest)
CXXRecordDecl * getTemplatedDecl() const
Get the underlying class declarations of the template.
Module * getSubmodule(serialization::SubmoduleID GlobalID)
Retrieve the submodule that corresponds to a global submodule ID.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization, retrieves the member specialization information.
static NamedDecl * getDeclForMerging(NamedDecl *Found, bool IsTypedefNameForLinkage)
Find the declaration that should be merged into, given the declaration found by name lookup...
A VarTemplatePartialSpecializationDecl record.
void setDefaultArgument(const ASTContext &C, const TemplateArgumentLoc &DefArg)
Set the default argument for this template parameter, and whether that default argument was inherited...
Defines the C++ template declaration subclasses.
static Decl * getMostRecentDecl(Decl *D)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization...
void VisitCXXDestructorDecl(CXXDestructorDecl *D)
void VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D)
A record that stores the set of declarations that are lexically stored within a given DeclContext...
void VisitObjCCategoryDecl(ObjCCategoryDecl *D)
IdentifierInfo * getAsIdentifierInfo() const
getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in this declaration name, or NULL if this declaration name isn't a simple identifier.
Represents an empty-declaration.
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
unsigned LocalNumObjCCategoriesInMap
The number of redeclaration info entries in ObjCCategoriesMap.
Class that performs name lookup into a DeclContext stored in an AST file.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Declaration of a variable template.
NamespaceDecl - Represent a C++ namespace.
A ObjCPropertyDecl record.
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
void setPropertyImplementation(PropertyControl pc)
NamedDecl * getParam(unsigned Idx)
static FriendDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned FriendTypeNumTPLists)
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
A container of type source information.
uint64_t GlobalBitOffset
The global bit offset (or base) of this module.
void setPropertyAccessor(bool isAccessor)
static void inheritDefaultTemplateArguments(ASTContext &Context, TemplateDecl *From, TemplateDecl *To)
Describes the capture of a variable or of this, or of a C++1y init-capture.
Represents a C++ constructor within a class.
static CapturedDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned NumParams)
A ClassTemplateDecl record.
void VisitStaticAssertDecl(StaticAssertDecl *D)
A PragmaDetectMismatchDecl record.
An UnresolvedUsingTypenameDecl record.
An identifier, stored as an IdentifierInfo*.
void setNothrow(bool Nothrow=true)
void setRAngleLoc(SourceLocation Loc)
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
void VisitNamedDecl(NamedDecl *ND)
Declaration of a redeclarable template.
An OMPCapturedExprDecl record.
A UsingShadowDecl record.
const unsigned int NUM_PREDEF_DECL_IDS
The number of declaration IDs that are predefined.
The "__interface" keyword.
Represents a variable template specialization, which refers to a variable template with a given set o...
ObjCMethodDecl - Represents an instance or class method declaration.
A TemplateTemplateParmDecl record that stores an expanded template template parameter pack...
A namespace, stored as a NamespaceDecl*.
void VisitClassTemplateDecl(ClassTemplateDecl *D)
void setParams(ArrayRef< ParmVarDecl * > NewParamInfo)
Stores a list of template parameters for a TemplateDecl and its derived classes.
void setSelfDecl(ImplicitParamDecl *SD)
void VisitTypeAliasDecl(TypeAliasDecl *TD)
A TemplateTemplateParmDecl record.
ParmVarDecl - Represents a parameter to a function.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
A ObjCInterfaceDecl record.
T * ReadDeclAs(ModuleFile &F, const RecordData &R, unsigned &I)
Reads a declaration from the given position in a record in the given module.
void setHasExternalVisibleStorage(bool ES=true)
State whether this DeclContext has external storage for declarations visible in this context...
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
RedeclarableResult VisitTagDecl(TagDecl *TD)
EvaluatedStmt * ensureEvaluatedStmt() const
Convert the initializer for this declaration to the elaborated EvaluatedStmt form, which contains extra information on the evaluated value of the initializer.
iterator begin(DeclarationName Name)
begin - Returns an iterator for decls with the name 'Name'.
void setTemplateSpecializationKind(TemplateSpecializationKind TSK)
Set the kind of specialization or template instantiation this is.
static void attachPreviousDeclImpl(ASTReader &Reader, Redeclarable< DeclT > *D, Decl *Previous, Decl *Canon)
A CXXConstructorDecl record for an inherited constructor.
RecordDecl - Represents a struct/union/class.
Description of a constructor that was inherited from a base class.
Provides common interface for the Decls that can be redeclared.
ObjCProtocolDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C protocol.
Represents a class template specialization, which refers to a class template with a given set of temp...
One of these records is kept for each identifier that is lexed.
void setIntegerType(QualType T)
Set the underlying integer type.
void VisitBuiltinTemplateDecl(BuiltinTemplateDecl *D)
void mergeRedeclarable(Redeclarable< T > *D, RedeclarableResult &Redecl, DeclID TemplatePatternID=0)
Attempts to merge the given declaration (D) with another declaration of the same entity.
static OMPThreadPrivateDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned N)
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
void setManglingNumber(const NamedDecl *ND, unsigned Number)
void setCompleteDefinition(bool V)
void setUninstantiatedDefaultArg(Expr *arg)
static IndirectFieldDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
The results of name lookup within a DeclContext.
bool CheckedICE
Whether we already checked whether this statement was an integral constant expression.
void VisitFriendTemplateDecl(FriendTemplateDecl *D)
void setLanguage(LanguageIDs L)
Set the language specified by this linkage specification.
Common * getCommonPtr() const
LambdaCaptureKind
The different capture forms in a lambda introducer.
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
void setBlockMissingReturnType(bool val)
void setLocStart(SourceLocation L)
static CXXRecordDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
RedeclarableResult VisitVarTemplateSpecializationDeclImpl(VarTemplateSpecializationDecl *D)
TODO: Unify with ClassTemplateSpecializationDecl version? May require unifying ClassTemplate(Partial)...
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
void VisitPragmaDetectMismatchDecl(PragmaDetectMismatchDecl *D)
static TemplateArgumentList * CreateCopy(ASTContext &Context, ArrayRef< TemplateArgument > Args)
Create a new template argument list that copies the given set of template arguments.
CXXMethodDecl * getCanonicalDecl() override
Helper class that saves the current stream position and then restores it when destroyed.
bool isTranslationUnit() const
TagKind getTagKind() const
static NamespaceDecl * getNamespace(const NestedNameSpecifier *X)
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
void setStaticLocalNumber(const VarDecl *VD, unsigned Number)
void VisitFileScopeAsmDecl(FileScopeAsmDecl *AD)
This declaration is definitely a definition.
void Profile(llvm::FoldingSetNodeID &ID)
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, const clang::CharUnits &CU)
void setNumPositiveBits(unsigned Num)
Represents an access specifier followed by colon ':'.
void setReturnType(QualType T)
Declaration of a function specialization at template class scope.
static StaticAssertDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void VisitLabelDecl(LabelDecl *LD)
static NamespaceDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setDeclImplementation(ImplementationControl ic)
Describes a module or submodule.
void setDefaultArgument(Expr *DefArg)
Set the default argument for this template parameter, and whether that default argument was inherited...
StorageClass getStorageClass() const
Returns the storage class as written in the source.
A IndirectFieldDecl record.
static OMPCapturedExprDecl * CreateDeserialized(ASTContext &C, unsigned ID)
iterator end()
end - Returns an iterator that has 'finished'.
Provides information about a function template specialization, which is a FunctionDecl that has been ...
Represents a C++ using-declaration.
void setUsingLoc(SourceLocation L)
Set the source location of the 'using' keyword.
bool isInheritingConstructor() const
Determine whether this is an implicit constructor synthesized to model a call to a constructor inheri...
uint32_t SubmoduleID
An ID number that refers to a submodule in a module file.
void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D)
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
ObjCContainerDecl - Represents a container for method declarations.
void setAccessControl(AccessControl ac)
const LangOptions & getLangOpts() const
static void attachLatestDecl(Decl *D, Decl *latest)
< Capturing the *this object by copy
bool isInline() const
Returns true if this is an inline namespace declaration.
RedeclarableResult VisitVarDeclImpl(VarDecl *D)
DeclLink RedeclLink
Points to the next redeclaration in the chain.
An AccessSpecDecl record.
void setAtLoc(SourceLocation L)
A convenient class for passing around template argument information.
void setDepth(unsigned D)
uint32_t * LazySpecializations
If non-null, points to an array of specializations (including partial specializations) known ownly by...
A ConstructorUsingShadowDecl record.
A UsingDirecitveDecl record.
static UnresolvedUsingTypenameDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void mergeDefinitionVisibility(NamedDecl *Def, NamedDecl *MergedDef)
We've merged the definition MergedDef into the existing definition Def.
bool isOutOfDate() const
Determine whether the information for this identifier is out of date with respect to the external sou...
void VisitCXXRecordDecl(CXXRecordDecl *D)
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
static ClassTemplateSpecializationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setSuperClass(ObjCInterfaceDecl *superCls)
TypeDecl - Represents a declaration of a type.
void setHasObjectMember(bool val)
static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl * > typeParams, SourceLocation rAngleLoc)
Create a new Objective-C type parameter list.
void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D)
void VisitMSPropertyDecl(MSPropertyDecl *FD)
static ObjCCategoryImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D)
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
DeclID VisitTemplateDecl(TemplateDecl *D)
void setClassInterface(ObjCInterfaceDecl *D)
void setIdentifier(IdentifierInfo *II)
void setInstantiationOf(ClassTemplatePartialSpecializationDecl *PartialSpec, const TemplateArgumentList *TemplateArgs)
Note that this class template specialization is actually an instantiation of the given class template...
CXXRecordDecl * getCanonicalDecl() override
llvm::iterator_range< MergedRedeclIterator< DeclT > > merged_redecls(DeclT *D)
static FileScopeAsmDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void VisitCXXMethodDecl(CXXMethodDecl *D)
static TypeAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
A ClassTemplateSpecializationDecl record.
Represents an Objective-C protocol declaration.
void setNumNegativeBits(unsigned Num)
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
static bool isSameEntity(NamedDecl *X, NamedDecl *Y)
Determine whether the two declarations refer to the same entity.
static FunctionTemplateSpecializationInfo * Create(ASTContext &C, FunctionDecl *FD, FunctionTemplateDecl *Template, TemplateSpecializationKind TSK, const TemplateArgumentList *TemplateArgs, const TemplateArgumentListInfo *TemplateArgsAsWritten, SourceLocation POI)
This represents the body of a CapturedStmt, and serves as its DeclContext.
Represents an ObjC class declaration.
Represents a linkage specification.
static ParmVarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D)
detail::InMemoryDirectory::const_iterator I
void setInitVal(const llvm::APSInt &V)
known_categories_range known_categories() const
QualType getCanonicalTypeInternal() const
void setInitExpr(Expr *E)
void setLocStart(SourceLocation L)
void setGetterCXXConstructor(Expr *getterCXXConstructor)
CXXConstructorDecl * getConstructor() const
void setInline(bool Inline)
Set whether this is an inline namespace declaration.
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
unsigned getNumExpansionTemplateParameters() const
Retrieves the number of expansion template parameters in an expanded parameter pack.
llvm::FoldingSetVector< FunctionTemplateSpecializationInfo > Specializations
The function template specializations for this function template, including explicit specializations ...
void adjustDeducedFunctionResultType(FunctionDecl *FD, QualType ResultType)
Change the result type of a function type once it is deduced.
void setVariadic(bool isVar)
static TemplateTypeParmDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
TypeAliasDecl - Represents the declaration of a typedef-name via a C++0x alias-declaration.
llvm::PointerUnion< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the class template or class template partial specialization which was specialized by this...
Represents a prototype with parameter type info, e.g.
RedeclarableResult VisitRedeclarable(Redeclarable< T > *D)
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
void setHasDestructors(bool val)
void VisitObjCContainerDecl(ObjCContainerDecl *D)
static ObjCCompatibleAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D)
Represents a ValueDecl that came out of a declarator.
void VisitParmVarDecl(ParmVarDecl *PD)
void VisitLinkageSpecDecl(LinkageSpecDecl *D)
Decl * ReadDecl(ModuleFile &F, const RecordData &R, unsigned &I)
Reads a declaration from the given position in a record in the given module.
void setIvarRBraceLoc(SourceLocation Loc)
A StaticAssertDecl record.
llvm::FoldingSetVector< ClassTemplatePartialSpecializationDecl > PartialSpecializations
The class template partial specializations for this class template.
A VarTemplateSpecializationDecl record.
void VisitUsingShadowDecl(UsingShadowDecl *D)
void VisitVarTemplatePartialSpecializationDecl(VarTemplatePartialSpecializationDecl *D)
TODO: Unify with ClassTemplatePartialSpecializationDecl version? May require unifying ClassTemplate(P...
void setNextIvar(ObjCIvarDecl *ivar)
void setSynthesize(bool synth)
void VisitFriendDecl(FriendDecl *D)
An ObjCTypeParamDecl record.
A record containing CXXBaseSpecifiers.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
void setType(QualType T, TypeSourceInfo *TSI)
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
void setGetterMethodDecl(ObjCMethodDecl *gDecl)
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
A ObjCCategoryImplDecl record.
llvm::FoldingSetVector< VarTemplatePartialSpecializationDecl > PartialSpecializations
The variable template partial specializations for this variable template.
static LinkageSpecDecl * CreateDeserialized(ASTContext &C, unsigned ID)
DiagnosticBuilder Diag(unsigned DiagID)
Report a diagnostic.
A ObjCPropertyImplDecl record.
QualType readType(ModuleFile &F, const RecordData &Record, unsigned &Idx)
Read a type from the current position in the given record, which was read from the given AST file...
Declaration of a template type parameter.
void setSetterMethodDecl(ObjCMethodDecl *gDecl)
Represents a C++ destructor within a class.
TranslationUnitDecl * getTranslationUnitDecl() const
A CXXConstructorDecl record.
void VisitTypedefDecl(TypedefDecl *TD)
void setContextParam(unsigned i, ImplicitParamDecl *P)
void setAtEndRange(SourceRange atEnd)
void setRBraceLoc(SourceLocation L)
static DeclLink PreviousDeclLink(decl_type *D)
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
SourceRange ReadSourceRange(ModuleFile &F, const RecordData &Record, unsigned &Idx)
Read a source range.
A record containing CXXCtorInitializers.
A VarTemplateDecl record.
void setGetterName(Selector Sel)
IdentifierResolver - Keeps track of shadowed decls on enclosing scopes.
void setMemberSpecialization()
Note that this member template is a specialization.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
void setDefined(bool isDefined)
void setCompleteDefinitionRequired(bool V=true)
RedeclarableResult VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D)
Information about a module that has been loaded by the ASTReader.
A namespace alias, stored as a NamespaceAliasDecl*.
static void attachPreviousDecl(ASTReader &Reader, Decl *D, Decl *Previous, Decl *Canon)
A CXXDestructorDecl record.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
SmallVector< uint64_t, 1 > ObjCCategories
The Objective-C category lists for categories known to this module.
A NonTypeTemplateParmDecl record that stores an expanded non-type template parameter pack...
static NamespaceAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static CXXConstructorDecl * CreateDeserialized(ASTContext &C, unsigned ID, bool InheritsConstructor)
StorageClass
Storage classes.
A NamespaceAliasDecl record.
void setTypename(bool TN)
Sets whether the using declaration has 'typename'.
Declaration of an alias template.
unsigned IsScopedUsingClassTag
IsScopedUsingClassTag - If this tag declaration is a scoped enum, then this is true if the scoped enu...
void UpdateDecl(Decl *D, ModuleFile &ModuleFile, const RecordData &Record)
void setModedTypeSourceInfo(TypeSourceInfo *unmodedTSI, QualType modedTy)
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 VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D)
An ImplicitParamDecl record.
void setIvarRBraceLoc(SourceLocation Loc)
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
Linkage getLinkageInternal() const
Determine what kind of linkage this entity has.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
Represents a C++ conversion function within a class.
The result type of a method or function.
static UsingDirectiveDecl * CreateDeserialized(ASTContext &C, unsigned ID)
An EnumConstantDecl record.
static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, unsigned ID)
A type, stored as a Type*.
void VisitNamespaceAliasDecl(NamespaceAliasDecl *D)
An ImportDecl recording a module import.
A ObjCCategoryDecl record.
static ObjCMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
void VisitObjCTypeParamDecl(ObjCTypeParamDecl *D)
unsigned getNumExpansionTypes() const
Retrieves the number of expansion types in an expanded parameter pack.
void VisitObjCProtocolDecl(ObjCProtocolDecl *D)
A FileScopeAsmDecl record.
A ObjCCompatibleAliasDecl record.
void VisitPragmaCommentDecl(PragmaCommentDecl *D)
ASTDeclReader(ASTReader &Reader, ASTReader::RecordLocation Loc, DeclID thisDeclID, SourceLocation ThisDeclLoc, const RecordData &Record, unsigned &Idx)
static TypeAliasTemplateDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Create an empty alias template node.
void setIsVariadic(bool value)
static bool isSameQualifier(const NestedNameSpecifier *X, const NestedNameSpecifier *Y)
void VisitCXXConstructorDecl(CXXConstructorDecl *D)
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
static PragmaDetectMismatchDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned NameValueSize)
QualifierInfo - A struct with extended info about a syntactic name qualifier, to be used for the case...
void setColonLoc(SourceLocation CLoc)
Sets the location of the colon.
An UnresolvedUsingValueDecl record.
Representation::iterator iterator
void VisitDeclaratorDecl(DeclaratorDecl *DD)
static ObjCProtocolDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static EnumConstantDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static UsingShadowDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setIsConversionFromLambda(bool val)
static void markIncompleteDeclChainImpl(Redeclarable< DeclT > *D)
static CXXDestructorDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Encodes a location in the source.
static EmptyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static TemplateTemplateParmDecl * CreateDeserialized(ASTContext &C, unsigned ID)
const TemplateArgument * iterator
This represents '#pragma omp declare reduction ...' directive.
A record that stores the set of declarations that are visible from a given DeclContext.
Pseudo declaration for capturing expressions.
void setIvarLBraceLoc(SourceLocation Loc)
void setBraceRange(SourceRange R)
void setAtStartLoc(SourceLocation Loc)
void VisitEmptyDecl(EmptyDecl *D)
void setAnonymousNamespace(NamespaceDecl *D)
NameVisibilityKind NameVisibility
The visibility of names within this particular module.
void setFreeStanding(bool isFreeStanding=true)
void setObjCDeclQualifier(ObjCDeclQualifier QV)
TagDecl - Represents the declaration of a struct/union/class/enum.
File is an implicitly-loaded module.
LabelDecl - Represents the declaration of a label.
void mergeTemplatePattern(RedeclarableTemplateDecl *D, RedeclarableTemplateDecl *Existing, DeclID DsID, bool IsKeyDecl)
Merge together the pattern declarations from two template declarations.
void setPropertyAttributesAsWritten(PropertyAttributeKind PRVal)
Represents a dependent using declaration which was not marked with typename.
void setPosition(unsigned P)
void VisitObjCImplDecl(ObjCImplDecl *D)
bool isDeclIDFromModule(serialization::GlobalDeclID ID, ModuleFile &M) const
Returns true if global DeclID ID originated from module M.
Represents a static or instance method of a struct/union/class.
void setHasFlexibleArrayMember(bool V)
EnumDecl * getCanonicalDecl() override
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
A TemplateTypeParmDecl record.
Data that is common to all of the declarations of a given function template.
ObjCCategoryDecl - Represents a category declaration.
QualType getInjectedClassNameSpecialization()
Retrieve the template specialization type of the injected-class-name for this class template...
void addDecl(NamedDecl *D)
void setDeclName(DeclarationName N)
Set the name of this declaration.
static MSPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static ConstructorUsingShadowDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Describes the categories of an Objective-C class.
void init(NamedDecl *templatedDecl, TemplateParameterList *templateParams)
Initialize the underlying templated declaration and template parameters.
void setPointOfInstantiation(SourceLocation Loc)
void setTagKind(TagKind TK)
CommonBase * Common
Pointer to the common data shared by all declarations of this template.
static FunctionDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Represents one property declaration in an Objective-C interface.
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
A simple visitor class that helps create declaration visitors.
const unsigned int DECL_UPDATES
Record of updates for a declaration that was modified after being deserialized.
void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D)
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D)
void VisitRecordDecl(RecordDecl *RD)
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
static T assert_cast(T t)
"Cast" to type T, asserting if we don't have an implicit conversion.
static VarTemplateDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Create an empty variable template node.
Represents a C++11 static_assert declaration.
uint32_t BitOffset
Offset in the AST file.
void setLAngleLoc(SourceLocation Loc)
void addArgument(const TemplateArgumentLoc &Loc)
unsigned varlist_size() const
Describes a module import declaration, which makes the contents of the named module visible in the cu...
void VisitValueDecl(ValueDecl *VD)
A ObjCProtocolDecl record.
void setDeclaredWithTypename(bool withTypename)
Set whether this template type parameter was declared with the 'typename' or 'class' keyword...
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
DeclarationNameLoc - Additional source/type location info for a declaration name. ...
void setSetterCXXAssignment(Expr *setterCXXAssignment)
void VisitEnumDecl(EnumDecl *ED)
static TypedefDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Base class for declarations which introduce a typedef-name.
if(T->getSizeExpr()) TRY_TO(TraverseStmt(T-> getSizeExpr()))
void setPropertyDecl(ObjCPropertyDecl *Prop)
A CXXConversionDecl record.
TagTypeKind
The kind of a tag type.
ObjCTypeParamList * ReadObjCTypeParamList()
void VisitCXXConversionDecl(CXXConversionDecl *D)
void setDescribedAliasTemplate(TypeAliasTemplateDecl *TAT)
void setBody(CompoundStmt *B)
void setImplicitlyInline()
Flag that this function is implicitly inline.
static CXXConversionDecl * CreateDeserialized(ASTContext &C, unsigned ID)
llvm::BitstreamCursor DeclsCursor
DeclsCursor - This is a cursor to the start of the DECLS_BLOCK block.
static ClassScopeFunctionSpecializationDecl * CreateDeserialized(ASTContext &Context, unsigned ID)
static bool isSameTemplateParameterList(const TemplateParameterList *X, const TemplateParameterList *Y)
Determine whether two template parameter lists are similar enough that they may be used in declaratio...
void setHasVolatileMember(bool val)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
static ClassTemplateDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Create an empty class template node.
The base class of all kinds of template declarations (e.g., class, function, etc.).
void VisitFunctionDecl(FunctionDecl *FD)
Reads an AST files chain containing the contents of a translation unit.
File is an explicitly-loaded module.
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
Expr * ReadExpr(ModuleFile &F)
Reads an expression.
A ClassTemplatePartialSpecializationDecl record.
void setUsingLoc(SourceLocation L)
Set the source location of the 'using' keyword.
DeclCode
Record codes for each kind of declaration.
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
unsigned IsScoped
IsScoped - True if this tag declaration is a scoped enumeration.
RedeclarableResult VisitCXXRecordDeclImpl(CXXRecordDecl *D)
void setIvarList(ObjCIvarDecl *ivar)
static VarTemplatePartialSpecializationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Represents a dependent using declaration which was marked with typename.
A ClassScopeFunctionSpecializationDecl record a class scope function specialization.
DeclarationName - The name of a declaration.
Represents the declaration of an Objective-C type parameter.
void VisitObjCMethodDecl(ObjCMethodDecl *D)
void setDependentTemplateSpecialization(ASTContext &Context, const UnresolvedSetImpl &Templates, const TemplateArgumentListInfo &TemplateArgs)
Specifies that this function declaration is actually a dependent function template specialization...
A LinkageSpecDecl record.
RedeclarableResult VisitRecordDeclImpl(RecordDecl *RD)
static NonTypeTemplateParmDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ParmVarDeclBitfields ParmVarDeclBits
static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D)
void VisitObjCImplementationDecl(ObjCImplementationDecl *D)
EnumDecl - Represents an enum.
void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D)
detail::InMemoryDirectory::const_iterator E
for(auto typeArg:T->getTypeArgsAsWritten())
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
static void forAllLaterRedecls(DeclT *D, Fn F)
void setExternLoc(SourceLocation L)
static bool inheritDefaultTemplateArgument(ASTContext &Context, ParmDecl *From, Decl *ToD)
Inherit the default template argument from From to To.
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*.
static FriendTemplateDecl * CreateDeserialized(ASTContext &C, unsigned ID)
SourceLocation ReadSourceLocation(ModuleFile &ModuleFile, uint32_t Raw) const
Read a source location from raw form.
uint32_t * LazySpecializations
If non-null, points to an array of specializations (including partial specializations) known only by ...
static LabelDecl * CreateDeserialized(ASTContext &C, unsigned ID)
All of the names in this module are visible.
Capturing variable-length array type.
A PragmaCommentDecl record.
IdentifierResolver & getIdResolver()
Get the identifier resolver used for name lookup / updates in the translation unit scope...
static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Common * getCommonPtr() const
void VisitObjCPropertyDecl(ObjCPropertyDecl *D)
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
NonParmVarDeclBitfields NonParmVarDeclBits
const T * getAs() const
Member-template getAs<specific type>'.
void setInstantiatedFromMemberTemplate(RedeclarableTemplateDecl *TD)
void setHasNonZeroConstructors(bool val)
static ClassTemplatePartialSpecializationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
LanguageIDs
Represents the language in a linkage specification.
static ImplicitParamDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static RecordDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
void ReadTemplateArgumentList(SmallVectorImpl< TemplateArgument > &TemplArgs, ModuleFile &F, const RecordData &Record, unsigned &Idx, bool Canonicalize=false)
Read a template argument array.
void setCombiner(Expr *E)
Set combiner expression for the declare reduction construct.
void setInitializer(Expr *E)
Set initializer expression for the declare reduction construct.
static CXXMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
NestedNameSpecifier * getQualifier() const
RedeclarableTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
static EnumDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setSetterName(Selector Sel)
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
void VisitNamespaceDecl(NamespaceDecl *D)
static FunctionTemplateDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Create an empty function template node.
ObjCInterfaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C class.
Capturing the *this object by reference.
void VisitUsingDirectiveDecl(UsingDirectiveDecl *D)
void setInnerLocStart(SourceLocation L)
void setObjCMethodScopeInfo(unsigned parameterIndex)
void setSignatureAsWritten(TypeSourceInfo *Sig)
void setPromotionType(QualType T)
Set the promotion type.
static bool isSameTemplateParameter(const NamedDecl *X, const NamedDecl *Y)
Determine whether two template parameters are similar enough that they may be used in declarations of...
unsigned IsFixed
IsFixed - True if this is an enumeration with fixed underlying type.
void setAsmString(StringLiteral *Asm)
static VarTemplateSpecializationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setRParenLoc(SourceLocation L)
A template argument list.
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...
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
static bool isConsumerInterestedIn(Decl *D, bool HasBody)
Determine whether the consumer will be interested in seeing this declaration (via HandleTopLevelDecl)...
static FieldDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
void VisitCapturedDecl(CapturedDecl *CD)
Represents a field declaration created by an @defs(...).
static Decl * getMostRecentDeclImpl(Redeclarable< DeclT > *D)
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
Represents a C++ struct/union/class.
static OMPDeclareReductionDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Create deserialized declare reduction node.
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setDescribedVarTemplate(VarTemplateDecl *Template)
void setInstanceMethod(bool isInst)
void SetRelatedResultType(bool RRT=true)
Note whether this method has a related result type.
void setClassInterface(ObjCInterfaceDecl *IFace)
bool isExpandedParameterPack() const
Whether this parameter is a template template parameter pack that has a known list of different templ...
ObjCIvarDecl - Represents an ObjC instance variable.
bool operator!=(CanQual< T > x, CanQual< U > y)
bool needsAnonymousDeclarationNumber(const NamedDecl *D)
Determine whether the given declaration needs an anonymous declaration number.
Provides information a specialization of a member of a class template, which may be a member function...
A ObjCImplementationDecl record.
void setOutOfDate(bool OOD)
Set whether the information for this identifier is out of date with respect to the external source...
void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D)
void VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D)
void setReturnTypeSourceInfo(TypeSourceInfo *TInfo)
A ObjCAtDefsFieldDecl record.
Declaration of a class template.
void setIvarLBraceLoc(SourceLocation Loc)
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
void VisitAccessSpecDecl(AccessSpecDecl *D)
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
bool isExpandedParameterPack() const
Whether this parameter is a non-type template parameter pack that has a known list of different types...
void setPropertyAttributes(PropertyAttributeKind PRVal)
static BlockDecl * CreateDeserialized(ASTContext &C, unsigned ID)
const unsigned int LOCAL_REDECLARATIONS
Record code for a list of local redeclarations of a declaration.
void VisitClassTemplatePartialSpecializationDecl(ClassTemplatePartialSpecializationDecl *D)
uint32_t * LazySpecializations
If non-null, points to an array of specializations known only by their external declaration IDs...
static DeclID * newDeclIDList(ASTContext &Context, DeclID *Old, SmallVectorImpl< DeclID > &IDs)
void VisitBlockDecl(BlockDecl *BD)
llvm::FoldingSetVector< VarTemplateSpecializationDecl > Specializations
The variable template specializations for this variable template, including explicit specializations ...
void setDescribedFunctionTemplate(FunctionTemplateDecl *Template)
void ReadAttributes(ModuleFile &F, AttrVec &Attrs, const RecordData &Record, unsigned &Idx)
Reads attributes from the current stream position.
void VisitIndirectFieldDecl(IndirectFieldDecl *FD)
bool isIncompleteArrayType() const
Common * getCommonPtr() const
VarDeclBitfields VarDeclBits
llvm::FoldingSetVector< ClassTemplateSpecializationDecl > Specializations
The class template specializations for this class template, including explicit specializations and in...
virtual CommonBase * newCommon(ASTContext &C) const =0
TranslationUnitDecl - The top declaration context.
static ObjCInterfaceDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D)
void VisitConstructorUsingShadowDecl(ConstructorUsingShadowDecl *D)
QualType getElementType() const
SourceLocation getLocation() const
A FunctionTemplateDecl record.
std::pair< uint64_t, uint64_t > VisitDeclContext(DeclContext *DC)
static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ModuleFile * getOwningModuleFile(const Decl *D)
Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a mo...
A TypeAliasTemplateDecl record.
An instance of this class represents the declaration of a property member.
void setAtLoc(SourceLocation Loc)
void VisitFunctionTemplateDecl(FunctionTemplateDecl *D)
uint32_t TypeID
An ID number that refers to a type in an AST file.
bool isUnresolvedExceptionSpec(ExceptionSpecificationType ESpecType)
void setCaptures(ASTContext &Context, ArrayRef< Capture > Captures, bool CapturesCXXThis)
A trivial tuple used to represent a source range.
void setIntegerTypeSourceInfo(TypeSourceInfo *TInfo)
Set the underlying integer type source info.
NamedDecl - This represents a decl with a name.
void VisitVarTemplateDecl(VarTemplateDecl *D)
TODO: Unify with ClassTemplateDecl version? May require unifying ClassTemplateDecl and VarTemplateDec...
void setTypeSourceInfo(TypeSourceInfo *newType)
void numberAnonymousDeclsWithin(const DeclContext *DC, Fn Visit)
Visit each declaration within DC that needs an anonymous declaration number and call Visit with the d...
Represents a C++ namespace alias.
static UsingDecl * CreateDeserialized(ASTContext &C, unsigned ID)
serialization::DeclID mapGlobalIDToModuleFileGlobalID(ModuleFile &M, serialization::DeclID GlobalID)
Map a global declaration ID into the declaration ID used to refer to this declaration within the give...
Declaration of a friend template.
Represents C++ using-directive.
Represents a #pragma detect_mismatch line.
static ObjCPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setPointOfInstantiation(SourceLocation POI)
Set the first point of instantiation.
The global specifier '::'. There is no stored value.
void VisitTranslationUnitDecl(TranslationUnitDecl *TU)
void setType(QualType newType)
void setCmdDecl(ImplicitParamDecl *CD)
This represents '#pragma omp threadprivate ...' directive.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
Declaration of a template function.
iterator - Iterate over the decls of a specified declaration name.
void setTargetDecl(NamedDecl *ND)
Sets the underlying declaration which has been brought into the local scope.
void setPropertyIvarDecl(ObjCIvarDecl *Ivar)
Source range/offset of a preprocessed entity.
Attr - This represents one attribute.
const serialization::ObjCCategoriesInfo * ObjCCategoriesMap
Array of category list location information within this module file, sorted by the definition ID...
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
ObjCCompatibleAliasDecl - Represents alias of a class.
bool isHidden() const
Determine whether this declaration is hidden from name lookup.
Structure used to store a statement, the constant value to which it was evaluated (if any)...
void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D)
TemplatedKind
The kind of templated function a FunctionDecl can be.