Switch the __int128_t and __uint128_t types over to predefined types
in the AST format, which are built lazily by the ASTContext when
requested.
llvm-svn: 137437
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index c048f58..53790fb 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -3075,9 +3075,6 @@
Context->ObjCSelRedefinitionType = GetType(ObjCSelRedef);
}
- if (SpecialTypes[SPECIAL_TYPE_INT128_INSTALLED])
- Context->setInt128Installed();
-
ReadPragmaDiagnosticMappings(Context->getDiagnostics());
// If there were any CUDA special declarations, deserialize them.
@@ -4222,6 +4219,14 @@
case PREDEF_DECL_OBJC_CLASS_ID:
assert(Context && "No context available?");
return Context->getObjCClassDecl();
+
+ case PREDEF_DECL_INT_128_ID:
+ assert(Context && "No context available?");
+ return Context->getInt128Decl();
+
+ case PREDEF_DECL_UNSIGNED_INT_128_ID:
+ assert(Context && "No context available?");
+ return Context->getUInt128Decl();
}
return 0;
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 47bcd6f..3af8fd7 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -2814,6 +2814,10 @@
DeclIDs[Context.ObjCSelDecl] = PREDEF_DECL_OBJC_SEL_ID;
if (Context.ObjCClassDecl)
DeclIDs[Context.ObjCClassDecl] = PREDEF_DECL_OBJC_CLASS_ID;
+ if (Context.Int128Decl)
+ DeclIDs[Context.Int128Decl] = PREDEF_DECL_INT_128_ID;
+ if (Context.UInt128Decl)
+ DeclIDs[Context.UInt128Decl] = PREDEF_DECL_UNSIGNED_INT_128_ID;
if (!Chain) {
// Make sure that we emit IdentifierInfos (and any attached
@@ -3029,7 +3033,6 @@
AddTypeRef(Context.ObjCIdRedefinitionType, SpecialTypes);
AddTypeRef(Context.ObjCClassRedefinitionType, SpecialTypes);
AddTypeRef(Context.ObjCSelRedefinitionType, SpecialTypes);
- SpecialTypes.push_back(Context.isInt128Installed());
// Keep writing types and declarations until all types and
// declarations have been written.