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:
@@ -345,6 +345,7 @@ ValueEnumerator::ValueEnumerator(const Module &M,
|
||||
|
||||
SmallVector<std::pair<unsigned, MDNode *>, 8> MDs;
|
||||
for (const GlobalVariable &GV : M.globals()) {
|
||||
MDs.clear();
|
||||
GV.getAllMetadata(MDs);
|
||||
for (const auto &I : MDs)
|
||||
EnumerateMetadata(&GV, I.second);
|
||||
@@ -356,6 +357,7 @@ ValueEnumerator::ValueEnumerator(const Module &M,
|
||||
EnumerateType(A.getType());
|
||||
|
||||
// Enumerate metadata attached to this function.
|
||||
MDs.clear();
|
||||
F.getAllMetadata(MDs);
|
||||
for (const auto &I : MDs)
|
||||
EnumerateMetadata(&F, I.second);
|
||||
|
||||
Reference in New Issue
Block a user