diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-10-04 18:21:45 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-10-04 18:21:45 +0000 |
commit | 55f48de5f6b10b50f4d88a9f7235f4532f799550 (patch) | |
tree | 95bf3d223b26919eb74520f9c3e2093ab149bf97 /lib/Serialization/ASTWriter.cpp | |
parent | 12423428fe9dc6337882233f4fb440435a920039 (diff) |
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
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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) |