diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-06-01 01:17:57 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-06-01 01:17:57 +0000 |
commit | 382d81cacf066452b98128b680f0988e5bda89a8 (patch) | |
tree | 1d50935b001bb7b52b70a6a9d87e0b3139b82292 /llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | |
parent | 09ec5756dc7d92c3a2f91313736c157bf3ffd848 (diff) | |
download | bcm5719-llvm-382d81cacf066452b98128b680f0988e5bda89a8.tar.gz bcm5719-llvm-382d81cacf066452b98128b680f0988e5bda89a8.zip |
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
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp index 6051173eed6..98eb7faf224 100644 --- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -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); |