IR: Allow multiple global metadata attachments with the same type.

This will be necessary to allow the global merge pass to attach
multiple debug info metadata nodes to global variables once we reverse
the edge from DIGlobalVariable to GlobalVariable.

Differential Revision: http://reviews.llvm.org/D20414

llvm-svn: 271358
This commit is contained in:
Peter Collingbourne
2016-06-01 01:17:57 +00:00
parent b178b36ac6
commit 232f184d9b
12 changed files with 150 additions and 88 deletions
+1 -1
View File
@@ -4167,7 +4167,7 @@ std::error_code BitcodeReader::parseGlobalObjectAttachment(
MDNode *MD = MetadataList.getMDNodeFwdRefOrNull(Record[I + 1]);
if (!MD)
return error("Invalid metadata attachment");
GO.setMetadata(K->second, MD);
GO.addMetadata(K->second, *MD);
}
return std::error_code();
}