[cfe-commits] r115527 - /cfe/trunk/lib/Serialization/ASTWriter.cpp

Douglas Gregor dgregor at apple.com
Mon Oct 4 11:21:45 PDT 2010


Author: dgregor
Date: Mon Oct  4 13:21:45 2010
New Revision: 115527

URL: http://llvm.org/viewvc/llvm-project?rev=115527&view=rev
Log:
When a type comes from a previously-loaded PCH/AST file, don't try to write it into a chained PCH file.

Modified:
    cfe/trunk/lib/Serialization/ASTWriter.cpp

Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=115527&r1=115526&r2=115527&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Mon Oct  4 13:21:45 2010
@@ -1419,6 +1419,11 @@
   if (Idx.getIndex() == 0) // we haven't seen this type before.
     Idx = TypeIdx(NextTypeID++);
 
+  // If this type comes from a previously-loaded PCH/AST file, don't try to
+  // write the type again.
+  if (Idx.getIndex() < FirstTypeID)
+    return;
+
   // Record the offset for this type.
   unsigned Index = Idx.getIndex() - FirstTypeID;
   if (TypeOffsets.size() == Index)





More information about the cfe-commits mailing list