summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Core.cpp
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2014-10-17 01:02:34 +0000
committerPeter Zotov <whitequark@whitequark.org>2014-10-17 01:02:34 +0000
commitaff492c6fd2f337d0811ed73fb9e266f16b79e8f (patch)
treed38e0f526579f973522fd3ffe6c96c9d7c57dc3b /llvm/lib/IR/Core.cpp
parent2213bfe35278af66c3423080ce12375afbaa9c10 (diff)
downloadbcm5719-llvm-aff492c6fd2f337d0811ed73fb9e266f16b79e8f.tar.gz
bcm5719-llvm-aff492c6fd2f337d0811ed73fb9e266f16b79e8f.zip
[LLVM-C] Add LLVMInstructionClone.
llvm-svn: 220007
Diffstat (limited to 'llvm/lib/IR/Core.cpp')
-rw-r--r--llvm/lib/IR/Core.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index acf63a36d26..f1e134233e6 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -1888,6 +1888,12 @@ LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst) {
return (LLVMOpcode)0;
}
+LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst) {
+ if (Instruction *C = dyn_cast<Instruction>(unwrap(Inst)))
+ return wrap(C->clone());
+ return nullptr;
+}
+
/*--.. Call and invoke instructions ........................................--*/
unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr) {
OpenPOWER on IntegriCloud