-/* llcontext -> lltype */
-CAMLprim LLVMTypeRef llvm_opaque_type(LLVMContextRef Context) {
- return LLVMOpaqueTypeInContext(Context);
-}
-
-/*--... Operations on type handles .........................................--*/
-
-#define Typehandle_val(v) (*(LLVMTypeHandleRef *)(Data_custom_val(v)))
-
-static void llvm_finalize_handle(value TH) {
- LLVMDisposeTypeHandle(Typehandle_val(TH));
-}
-
-static struct custom_operations typehandle_ops = {
- (char *) "LLVMTypeHandle",
- llvm_finalize_handle,
- custom_compare_default,
- custom_hash_default,
- custom_serialize_default,
- custom_deserialize_default
-};
-
-CAMLprim value llvm_handle_to_type(LLVMTypeRef PATy) {
- value TH = alloc_custom(&typehandle_ops, sizeof(LLVMBuilderRef), 0, 1);
- Typehandle_val(TH) = LLVMCreateTypeHandle(PATy);
- return TH;
-}
-
-CAMLprim LLVMTypeRef llvm_type_of_handle(value TH) {
- return LLVMResolveTypeHandle(Typehandle_val(TH));
-}
-
-CAMLprim value llvm_refine_type(LLVMTypeRef AbstractTy, LLVMTypeRef ConcreteTy){
- LLVMRefineType(AbstractTy, ConcreteTy);
- return Val_unit;
-}
-
-