diff options
author | Devang Patel <dpatel@apple.com> | 2009-10-22 18:55:16 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-10-22 18:55:16 +0000 |
commit | f61b2371c8ec6e0ff2da8f2bd2a606ba755bb2fe (patch) | |
tree | 4e70cd3cb36311326f54ad5a9d293bfc33590a89 /lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | b5681b22937440dcb8007f4b125f3325d6341fe0 (diff) |
Fix getMDs() interface such that it does not expose implementation details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | lib/Bitcode/Writer/BitcodeWriter.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index c8cb59527d..037854e26f 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -561,14 +561,16 @@ static void WriteMetadataAttachment(const Function &F, // Write metadata attachments // METADATA_ATTACHMENT - [m x [value, [n x [id, mdnode]]] MetadataContext &TheMetadata = F.getContext().getMetadata(); + typedef SmallVector<std::pair<unsigned, TrackingVH<MDNode> >, 2> MDMapTy; + MDMapTy MDs; for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) { - const MetadataContext::MDMapTy *P = TheMetadata.getMDs(I); - if (!P) continue; + MDs.clear(); + TheMetadata.getMDs(I, MDs); bool RecordedInstruction = false; - for (MetadataContext::MDMapTy::const_iterator PI = P->begin(), - PE = P->end(); PI != PE; ++PI) { + for (MDMapTy::const_iterator PI = MDs.begin(), PE = MDs.end(); + PI != PE; ++PI) { if (RecordedInstruction == false) { Record.push_back(VE.getInstructionID(I)); RecordedInstruction = true; |