diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-14 18:57:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-14 18:57:51 +0000 |
commit | 8f29491ffd0e7393580c5b11869fc9666c895f71 (patch) | |
tree | ca66f2c370f6463609d2ee09f183ad421bd2d05d /llvm/lib/VMCore/Instruction.cpp | |
parent | 69eea727793a000a941760449f87fed9cb67a2a9 (diff) | |
download | bcm5719-llvm-8f29491ffd0e7393580c5b11869fc9666c895f71.tar.gz bcm5719-llvm-8f29491ffd0e7393580c5b11869fc9666c895f71.zip |
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.
llvm-svn: 135173
Diffstat (limited to 'llvm/lib/VMCore/Instruction.cpp')
-rw-r--r-- | llvm/lib/VMCore/Instruction.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp index d8959cc4929..02c07574395 100644 --- a/llvm/lib/VMCore/Instruction.cpp +++ b/llvm/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; } |