ocaml bindings: add getopcode for constant and instruction, and int64_of_const.
[oota-llvm.git] / lib / VMCore / Core.cpp
index 77d2e74cd223428d8305a948393bda9e2609141b..a505e4b4f5e5dafc4ddbd51ef3fc6bc5308b1f51 100644 (file)
@@ -1591,6 +1591,12 @@ LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst) {
   return (LLVMIntPredicate)0;
 }
 
+LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst) {
+  if (Instruction *C = dyn_cast<Instruction>(unwrap(Inst)))
+    return map_to_llvmopcode(C->getOpcode());
+  return (LLVMOpcode)0;
+}
+
 /*--.. Call and invoke instructions ........................................--*/
 
 unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr) {