]> granicus.if.org Git - clang/commitdiff
Make the new Objective-C "id" and "Class" redefinition types special
authorDouglas Gregor <dgregor@apple.com>
Fri, 21 Aug 2009 00:27:50 +0000 (00:27 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 21 Aug 2009 00:27:50 +0000 (00:27 +0000)
types that are preloaded by the PCH file. Fixes PCH breakage
introduced in r79248.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79583 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/PCHBitCodes.h
lib/Frontend/PCHReader.cpp
lib/Frontend/PCHWriter.cpp

index 6e2e8c451196a4529331019bab5630f5691ffb77..a0adfd4cf93d4717b782ccf4ada17afde0e5be37 100644 (file)
@@ -427,7 +427,11 @@ namespace clang {
       /// \brief C jmp_buf typedef type
       SPECIAL_TYPE_jmp_buf                     = 8,
       /// \brief C sigjmp_buf typedef type
-      SPECIAL_TYPE_sigjmp_buf                  = 9
+      SPECIAL_TYPE_sigjmp_buf                  = 9,
+      /// \brief Objective-C "id" redefinition type
+      SPECIAL_TYPE_OBJC_ID_REDEFINITION        = 10,
+      /// \brief Objective-C "Class" redefinition type
+      SPECIAL_TYPE_OBJC_CLASS_REDEFINITION     = 11,
     };
 
     /// \brief Record codes for each kind of declaration.
index aab5dd8783ff158cc543f4d8d1af5f5098cbd63b..b368124f4f6647c3604ee9668e0ca64b213a2e30 100644 (file)
@@ -1562,6 +1562,12 @@ void PCHReader::InitializeContext(ASTContext &Ctx) {
       Context->setsigjmp_bufDecl(Tag->getDecl());
     }
   }
+  if (unsigned ObjCIdRedef 
+        = SpecialTypes[pch::SPECIAL_TYPE_OBJC_ID_REDEFINITION])
+    Context->ObjCIdRedefinitionType = GetType(ObjCIdRedef);
+  if (unsigned ObjCClassRedef 
+      = SpecialTypes[pch::SPECIAL_TYPE_OBJC_CLASS_REDEFINITION])
+    Context->ObjCClassRedefinitionType = GetType(ObjCClassRedef);
 }
 
 /// \brief Retrieve the name of the original source file name
index d9c6b1bb7d8b8b9838b752a7b4513f5e8157e05e..48a1c9d5e3a363df7430ebc8893c1dae318c6e61 100644 (file)
@@ -1846,6 +1846,8 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls,
   AddTypeRef(Context.getFILEType(), Record);
   AddTypeRef(Context.getjmp_bufType(), Record);
   AddTypeRef(Context.getsigjmp_bufType(), Record);
+  AddTypeRef(Context.ObjCIdRedefinitionType, Record);
+  AddTypeRef(Context.ObjCClassRedefinitionType, Record);
   Stream.EmitRecord(pch::SPECIAL_TYPES, Record);
   
   // Keep writing types and declarations until all types and