[modules] Write out identifiers if the ID is local, too.
authorVassil Vassilev <v.g.vassilev@gmail.com>
Wed, 30 Mar 2016 20:16:03 +0000 (20:16 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Wed, 30 Mar 2016 20:16:03 +0000 (20:16 +0000)
commit262f41e91c4a23358de94f9bbaac806c4266bf1a
tree4ab2d7f087b221cd85911408eb28412d2832c398
parent750e76d24561f833c9329a22b2de98b81c3f4724
[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
clang/lib/Serialization/ASTWriter.cpp
clang/test/Modules/Inputs/PR27041/Rtypes.h [new file with mode: 0644]
clang/test/Modules/Inputs/PR27041/TGenericClassInfo.h [new file with mode: 0644]
clang/test/Modules/Inputs/PR27041/TSchemaHelper.h [new file with mode: 0644]
clang/test/Modules/Inputs/PR27041/module.modulemap [new file with mode: 0644]
clang/test/Modules/pr27041.cpp [new file with mode: 0644]