From 55f48de5f6b10b50f4d88a9f7235f4532f799550 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 4 Oct 2010 18:21:45 +0000 Subject: [PATCH] When a type comes from a previously-loaded PCH/AST file, don't try to write it into a chained PCH file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115527 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Serialization/ASTWriter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index c89680e2a6..7e0cdf41d7 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -1419,6 +1419,11 @@ void ASTWriter::WriteType(QualType T) { 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) -- 2.50.1