[LLVM-C] Expose User::getOperandUse as LLVMGetOperandUse.
authorPeter Zotov <whitequark@whitequark.org>
Tue, 12 Aug 2014 02:55:40 +0000 (02:55 +0000)
committerPeter Zotov <whitequark@whitequark.org>
Tue, 12 Aug 2014 02:55:40 +0000 (02:55 +0000)
Patch by Gabriel Radanne <drupyog@zoho.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215419 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm-c/Core.h
lib/IR/Core.cpp

index 69ed08d..e5d5f3f 100644 (file)
@@ -1377,6 +1377,13 @@ LLVMValueRef LLVMGetUsedValue(LLVMUseRef U);
  */
 LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index);
 
  */
 LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index);
 
+/**
+ * Obtain the use of an operand at a specific index in a llvm::User value.
+ *
+ * @see llvm::User::getOperandUse()
+ */
+LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index);
+
 /**
  * Set an operand at a specific index in a llvm::User value.
  *
 /**
  * Set an operand at a specific index in a llvm::User value.
  *
index 8bc0bb9..2b2ccb9 100644 (file)
@@ -603,6 +603,11 @@ LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index) {
   return wrap(cast<User>(V)->getOperand(Index));
 }
 
   return wrap(cast<User>(V)->getOperand(Index));
 }
 
+LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index) {
+  Value *V = unwrap(Val);
+  return wrap(&cast<User>(V)->getOperandUse(Index));
+}
+
 void LLVMSetOperand(LLVMValueRef Val, unsigned Index, LLVMValueRef Op) {
   unwrap<User>(Val)->setOperand(Index, unwrap(Op));
 }
 void LLVMSetOperand(LLVMValueRef Val, unsigned Index, LLVMValueRef Op) {
   unwrap<User>(Val)->setOperand(Index, unwrap(Op));
 }