Added C and Ocaml bindings for functions, basic blocks, and
[oota-llvm.git] / include / llvm / CHelpers.h
index d00aba383f9a5d1db6ea3284fb1fa57db919fe0a..0ae7503ab079fc075ab932e2868d8cc061be7a53 100644 (file)
@@ -89,6 +89,16 @@ namespace llvm {
   inline LLVMValueRef *wrap(const Value **Vals) {
     return reinterpret_cast<LLVMValueRef*>(const_cast<Value**>(Vals));
   }
+  
+  /// Basic block conversions
+  /// 
+  inline BasicBlock *unwrap(LLVMBasicBlockRef BBRef) {
+    return reinterpret_cast<BasicBlock*>(BBRef);
+  }
+  
+  inline LLVMBasicBlockRef wrap(const BasicBlock *BB) {
+    return reinterpret_cast<LLVMBasicBlockRef>(const_cast<BasicBlock*>(BB));
+  }
 }
 
 #endif