From e9962ef77f3743f3b2bc8cff0a03387bfa3e09d8 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 14 Jul 2011 22:14:06 +0000 Subject: [PATCH] Undo r135191 (i.e. reapply Chris's patch. Now linker maps NamedMDNodes first, so there is not any need to map DebugLoc). llvm-svn: 135205 --- lib/Transforms/Utils/ValueMapper.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Utils/ValueMapper.cpp b/lib/Transforms/Utils/ValueMapper.cpp index 30fc60081d5..e728fd16a30 100644 --- a/lib/Transforms/Utils/ValueMapper.cpp +++ b/lib/Transforms/Utils/ValueMapper.cpp @@ -167,9 +167,10 @@ void llvm::RemapInstruction(Instruction *I, ValueToValueMapTy &VMap, } } - // Remap attached metadata. + // Remap attached metadata. Don't bother remapping DebugLoc, it can never + // have mappings to do. SmallVector, 4> MDs; - I->getAllMetadata(MDs); + I->getAllMetadataOtherThanDebugLoc(MDs); for (SmallVectorImpl >::iterator MI = MDs.begin(), ME = MDs.end(); MI != ME; ++MI) { MDNode *Old = MI->second;