aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Instruction.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-27 22:16:29 +0000
committerDevang Patel <dpatel@apple.com>2009-10-27 22:16:29 +0000
commit50b6e33584f4e4cf75c7795b1f1a90731861c825 (patch)
tree1ae76dc6ddfc8b31bfd97e7f273756780cb7cdb4 /lib/VMCore/Instruction.cpp
parenteef55dc3fdebf915128e5d3848f372c7db6c38e8 (diff)
Factor out redundancy from clone() implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85327 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instruction.cpp')
-rw-r--r--lib/VMCore/Instruction.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index 4dbb4020de..c48e75c445 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -492,3 +492,11 @@ bool Instruction::isSafeToSpeculativelyExecute() const {
return false; // Misc instructions which have effects
}
}
+
+Instruction *Instruction::clone() const {
+ Instruction *New = clone_impl();
+ New->SubclassOptionalData = SubclassOptionalData;
+ if (hasMetadata())
+ getContext().pImpl->TheMetadata.ValueIsCloned(this, New);
+ return New;
+}