summaryrefslogtreecommitdiff
path: root/lib/VMCore/Instruction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-14 18:57:51 +0000
committerChris Lattner <sabre@nondot.org>2011-07-14 18:57:51 +0000
commit4baa510f48000308251a0d7c6be491d11c20d30b (patch)
tree23bea02aa731aae484804d1d10e52b3f1841417f /lib/VMCore/Instruction.cpp
parent4692be11a9ecee983760b0420ef2775a4c3706dc (diff)
downloadllvm-4baa510f48000308251a0d7c6be491d11c20d30b.tar.gz
llvm-4baa510f48000308251a0d7c6be491d11c20d30b.tar.bz2
llvm-4baa510f48000308251a0d7c6be491d11c20d30b.tar.xz
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
Diffstat (limited to 'lib/VMCore/Instruction.cpp')
-rw-r--r--lib/VMCore/Instruction.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index d8959cc492..02c0757439 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<std::pair<unsigned, MDNode*>, 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;
}