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 | dc72caa6dec6a66a0806096e3b2d398915a31900 (patch) | |
tree | bc1f8203848daf1da6f5657bd350403e405cb58f /clang/lib/Serialization/ASTWriter.cpp | |
parent | 0d4224ef04efff920270a48fef6ddca6f8349703 (diff) | |
download | bcm5719-llvm-dc72caa6dec6a66a0806096e3b2d398915a31900.tar.gz bcm5719-llvm-dc72caa6dec6a66a0806096e3b2d398915a31900.zip |
When a type comes from a previously-loaded PCH/AST file, don't try to write it into a chained PCH file.
llvm-svn: 115527
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index c89680e2a6e..7e0cdf41d7e 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/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) |