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
This commit is contained in:
Douglas Gregor 2010-10-04 18:21:45 +00:00
parent 0d4224ef04
commit dc72caa6de
1 changed files with 5 additions and 0 deletions

View File

@ -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)