diff options
| author | Vassil Vassilev <v.g.vassilev@gmail.com> | 2016-03-30 20:16:03 +0000 |
|---|---|---|
| committer | Vassil Vassilev <v.g.vassilev@gmail.com> | 2016-03-30 20:16:03 +0000 |
| commit | 262f41e91c4a23358de94f9bbaac806c4266bf1a (patch) | |
| tree | 4ab2d7f087b221cd85911408eb28412d2832c398 /clang/lib | |
| parent | 750e76d24561f833c9329a22b2de98b81c3f4724 (diff) | |
| download | bcm5719-llvm-262f41e91c4a23358de94f9bbaac806c4266bf1a.tar.gz bcm5719-llvm-262f41e91c4a23358de94f9bbaac806c4266bf1a.zip | |
[modules] Write out identifiers if the ID is local, too.
In some cases a slot for an identifier is requested but it gets written to
another module, causing an assertion.
At the point when we start serializing Rtypes, we have no imported IdentifierID
for float_round_style. We start serializing stuff and allocate an ID for it.
Then, during the serialization process, we pull in the identifier info for it
from TSchemaHelper. Finally, WriteIdentifierTable decides that the identifier
has not changed since it was deserialized, so doesn't emit it.
Fixes https://llvm.org/bugs/show_bug.cgi?id=27041
Discussed on IRC with Richard Smith. Agreed on post commit review if needed.
llvm-svn: 264913
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index a828d350c04..78fc6eb4baa 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -3340,7 +3340,10 @@ void ASTWriter::WriteIdentifierTable(Preprocessor &PP, auto *II = const_cast<IdentifierInfo *>(IdentIDPair.first); IdentID ID = IdentIDPair.second; assert(II && "NULL identifier in identifier table"); - if (!Chain || !II->isFromAST() || II->hasChangedSinceDeserialization() || + // Write out identifiers if either the ID is local or the identifier has + // changed since it was loaded. + if (ID >= FirstIdentID || !Chain || !II->isFromAST() + || II->hasChangedSinceDeserialization() || (Trait.needDecls() && II->hasFETokenInfoChangedSinceDeserialization())) Generator.insert(II, ID, Trait); |

