From 4baa510f48000308251a0d7c6be491d11c20d30b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 14 Jul 2011 18:57:51 +0000 Subject: [PATCH] manually copy debugloc over to a new instruction in clone() instead of calling getAllMetadata(). This is semantically identical, but doing it this way avoids unpacking the DebugLoc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135173 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Instruction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp index d8959cc4929..02c07574395 100644 --- a/lib/VMCore/Instruction.cpp +++ b/lib/VMCore/Instruction.cpp @@ -405,8 +405,10 @@ Instruction *Instruction::clone() const { // Otherwise, enumerate and copy over metadata from the old instruction to the // new one. SmallVector, 4> TheMDs; - getAllMetadata(TheMDs); + getAllMetadataOtherThanDebugLoc(TheMDs); for (unsigned i = 0, e = TheMDs.size(); i != e; ++i) New->setMetadata(TheMDs[i].first, TheMDs[i].second); + + New->setDebugLoc(getDebugLoc()); return New; } -- 2.34.1