diff options
| author | Devang Patel <dpatel@apple.com> | 2009-10-22 18:25:28 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2009-10-22 18:25:28 +0000 |
| commit | 084679e70a6462bd56aed8ebf48feec7065f122f (patch) | |
| tree | f2b391c026aaec836ec57cd3eb6bff88298eeab1 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
| parent | 6a573fe543121bcfa3f84ec71a39ddabf22dc7d9 (diff) | |
| download | bcm5719-llvm-084679e70a6462bd56aed8ebf48feec7065f122f.tar.gz bcm5719-llvm-084679e70a6462bd56aed8ebf48feec7065f122f.zip | |
Using TrackingVH instead of WeakVH or WeakMetadataVH.
llvm-svn: 84884
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
| -rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 947b8958a12..c8cb59527d3 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -569,14 +569,12 @@ static void WriteMetadataAttachment(const Function &F, bool RecordedInstruction = false; for (MetadataContext::MDMapTy::const_iterator PI = P->begin(), PE = P->end(); PI != PE; ++PI) { - if (MDNode *ND = dyn_cast_or_null<MDNode>(PI->second)) { - if (RecordedInstruction == false) { - Record.push_back(VE.getInstructionID(I)); - RecordedInstruction = true; - } - Record.push_back(PI->first); - Record.push_back(VE.getValueID(ND)); + if (RecordedInstruction == false) { + Record.push_back(VE.getInstructionID(I)); + RecordedInstruction = true; } + Record.push_back(PI->first); + Record.push_back(VE.getValueID(PI->second)); } if (!Record.empty()) { if (!StartedMetadataBlock) { |

