forked from OSchip/llvm-project
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:
parent
0d4224ef04
commit
dc72caa6de
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue