From 084679e70a6462bd56aed8ebf48feec7065f122f Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 22 Oct 2009 18:25:28 +0000 Subject: Using TrackingVH instead of WeakVH or WeakMetadataVH. llvm-svn: 84884 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp') 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(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) { -- cgit v1.2.3