aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-12 05:46:01 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-12 05:46:01 +0000
commit4dfd02a17c6d604c72e6936527c5e1c56d3ecb7a (patch)
tree6ebd102cd1758abea2391ca34f4fdc0de0675326 /lib/Serialization/ASTWriter.cpp
parent634a43c272a918f47cfc7dd07c7bd9481772f12e (diff)
Move the creation of the predefined typedef for Objective-C's 'id'
type over into the AST context, then make that declaration a predefined declaration in the AST format. This ensures that different AST files will at least agree on the (global) declaration ID for 'id', and eliminates one of the "special" types in the AST file format. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137429 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r--lib/Serialization/ASTWriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index 2654ae3fdf..2377369c74 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -2808,7 +2808,9 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
// Set up predefined declaration IDs.
DeclIDs[Context.getTranslationUnitDecl()] = PREDEF_DECL_TRANSLATION_UNIT_ID;
-
+ if (Context.ObjCIdDecl)
+ DeclIDs[Context.ObjCIdDecl] = PREDEF_DECL_OBJC_ID_ID;
+
if (!Chain) {
// Make sure that we emit IdentifierInfos (and any attached
// declarations) for builtins. We don't need to do this when we're
@@ -3015,7 +3017,6 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
// Form the record of special types.
RecordData SpecialTypes;
AddTypeRef(Context.getBuiltinVaListType(), SpecialTypes);
- AddTypeRef(Context.ObjCIdTypedefType, SpecialTypes);
AddTypeRef(Context.ObjCSelTypedefType, SpecialTypes);
AddTypeRef(Context.ObjCProtoType, SpecialTypes);
AddTypeRef(Context.ObjCClassTypedefType, SpecialTypes);