DI: Disallow uniquable DICompileUnits

Since r241097, `DIBuilder` has only created distinct `DICompileUnit`s.
The backend is liable to start relying on that (if it hasn't already),
so make uniquable `DICompileUnit`s illegal and automatically upgrade old
bitcode.  This is a nice cleanup, since we can remove an unnecessary
`DenseSet` (and the associated uniquing info) from `LLVMContextImpl`.

Almost all the testcases were updated with this script:

    git grep -e '= !DICompileUnit' -l -- test |
    grep -v test/Bitcode |
    xargs sed -i '' -e 's,= !DICompileUnit,= distinct !DICompileUnit,'

I imagine something similar should work for out-of-tree testcases.

llvm-svn: 243885
This commit is contained in:
Duncan P. N. Exon Smith
2015-08-03 17:26:41 +00:00
parent 910dde7ab2
commit 55ca964e94
421 changed files with 610 additions and 674 deletions

View File

@@ -1872,15 +1872,16 @@ std::error_code BitcodeReader::parseMetadata() {
if (Record.size() < 14 || Record.size() > 15)
return error("Invalid record");
// Ignore Record[1], which indicates whether this compile unit is
// distinct. It's always distinct.
MDValueList.assignValue(
GET_OR_DISTINCT(
DICompileUnit, Record[0],
(Context, Record[1], getMDOrNull(Record[2]),
getMDString(Record[3]), Record[4], getMDString(Record[5]),
Record[6], getMDString(Record[7]), Record[8],
getMDOrNull(Record[9]), getMDOrNull(Record[10]),
getMDOrNull(Record[11]), getMDOrNull(Record[12]),
getMDOrNull(Record[13]), Record.size() == 14 ? 0 : Record[14])),
DICompileUnit::getDistinct(
Context, Record[1], getMDOrNull(Record[2]),
getMDString(Record[3]), Record[4], getMDString(Record[5]),
Record[6], getMDString(Record[7]), Record[8],
getMDOrNull(Record[9]), getMDOrNull(Record[10]),
getMDOrNull(Record[11]), getMDOrNull(Record[12]),
getMDOrNull(Record[13]), Record.size() == 14 ? 0 : Record[14]),
NextMDValueNo++);
break;
}