[llvm] r215419 - [LLVM-C] Expose User::getOperandUse as LLVMGetOperandUse.

Peter Zotov whitequark at whitequark.org
Mon Aug 11 19:55:41 PDT 2014


Author: whitequark
Date: Mon Aug 11 21:55:40 2014
New Revision: 215419

URL: http://llvm.org/viewvc/llvm-project?rev=215419&view=rev
Log:
[LLVM-C] Expose User::getOperandUse as LLVMGetOperandUse.

Patch by Gabriel Radanne <drupyog at zoho.com>

Modified:
    llvm/trunk/include/llvm-c/Core.h
    llvm/trunk/lib/IR/Core.cpp

Modified: llvm/trunk/include/llvm-c/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=215419&r1=215418&r2=215419&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Mon Aug 11 21:55:40 2014
@@ -1378,6 +1378,13 @@ LLVMValueRef LLVMGetUsedValue(LLVMUseRef
 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.
  *
  * @see llvm::User::setOperand()

Modified: llvm/trunk/lib/IR/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Core.cpp?rev=215419&r1=215418&r2=215419&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Core.cpp (original)
+++ llvm/trunk/lib/IR/Core.cpp Mon Aug 11 21:55:40 2014
@@ -603,6 +603,11 @@ LLVMValueRef LLVMGetOperand(LLVMValueRef
   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));
 }





More information about the llvm-commits mailing list