diff options
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/ocaml/executionengine/executionengine_ocaml.c | 3 | ||||
-rw-r--r-- | bindings/ocaml/executionengine/llvm_executionengine.ml | 2 | ||||
-rw-r--r-- | bindings/ocaml/executionengine/llvm_executionengine.mli | 2 | ||||
-rw-r--r-- | bindings/ocaml/llvm/llvm.mli | 2 | ||||
-rw-r--r-- | bindings/ocaml/llvm/llvm_ocaml.c | 3 | ||||
-rw-r--r-- | bindings/ocaml/target/llvm_target.ml | 26 | ||||
-rw-r--r-- | bindings/ocaml/target/llvm_target.mli | 56 | ||||
-rw-r--r-- | bindings/ocaml/target/target_ocaml.c | 30 |
8 files changed, 65 insertions, 59 deletions
diff --git a/bindings/ocaml/executionengine/executionengine_ocaml.c b/bindings/ocaml/executionengine/executionengine_ocaml.c index 5b1e32efefcd..02e030605720 100644 --- a/bindings/ocaml/executionengine/executionengine_ocaml.c +++ b/bindings/ocaml/executionengine/executionengine_ocaml.c @@ -75,6 +75,9 @@ static struct custom_operations generic_value_ops = { custom_hash_default, custom_serialize_default, custom_deserialize_default +#ifdef custom_compare_ext_default + , custom_compare_ext_default +#endif }; static value alloc_generic_value(LLVMGenericValueRef Ref) { diff --git a/bindings/ocaml/executionengine/llvm_executionengine.ml b/bindings/ocaml/executionengine/llvm_executionengine.ml index a8535b246404..ddb53bbb5afd 100644 --- a/bindings/ocaml/executionengine/llvm_executionengine.ml +++ b/bindings/ocaml/executionengine/llvm_executionengine.ml @@ -83,7 +83,7 @@ module ExecutionEngine = struct external free_machine_code: Llvm.llvalue -> t -> unit = "llvm_ee_free_machine_code" - external target_data: t -> Llvm_target.TargetData.t + external target_data: t -> Llvm_target.DataLayout.t = "LLVMGetExecutionEngineTargetData" (* The following are not bound. Patches are welcome. diff --git a/bindings/ocaml/executionengine/llvm_executionengine.mli b/bindings/ocaml/executionengine/llvm_executionengine.mli index 166b7bcddca6..0b06078bad86 100644 --- a/bindings/ocaml/executionengine/llvm_executionengine.mli +++ b/bindings/ocaml/executionengine/llvm_executionengine.mli @@ -155,7 +155,7 @@ module ExecutionEngine: sig (** [target_data ee] is the target data owned by the execution engine [ee]. *) - val target_data : t -> Llvm_target.TargetData.t + val target_data : t -> Llvm_target.DataLayout.t end diff --git a/bindings/ocaml/llvm/llvm.mli b/bindings/ocaml/llvm/llvm.mli index 96448ccd960d..eb6c88355afb 100644 --- a/bindings/ocaml/llvm/llvm.mli +++ b/bindings/ocaml/llvm/llvm.mli @@ -375,7 +375,7 @@ val module_context : llmodule -> llcontext val classify_type : lltype -> TypeKind.t (** [type_is_sized ty] returns whether the type has a size or not. - * If it doesn't then it is not safe to call the [TargetData::] methods on it. + * If it doesn't then it is not safe to call the [DataLayout::] methods on it. * *) val type_is_sized : lltype -> bool diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c index a5985d9d2b04..c984bd154cc2 100644 --- a/bindings/ocaml/llvm/llvm_ocaml.c +++ b/bindings/ocaml/llvm/llvm_ocaml.c @@ -1277,6 +1277,9 @@ static struct custom_operations builder_ops = { custom_hash_default, custom_serialize_default, custom_deserialize_default +#ifdef custom_compare_ext_default + , custom_compare_ext_default +#endif }; static value alloc_builder(LLVMBuilderRef B) { diff --git a/bindings/ocaml/target/llvm_target.ml b/bindings/ocaml/target/llvm_target.ml index 49940eec4800..f4891e2b83bd 100644 --- a/bindings/ocaml/target/llvm_target.ml +++ b/bindings/ocaml/target/llvm_target.ml @@ -13,7 +13,7 @@ module Endian = struct | Little end -module TargetData = struct +module DataLayout = struct type t external create : string -> t = "llvm_targetdata_create" @@ -23,20 +23,20 @@ module TargetData = struct external dispose : t -> unit = "llvm_targetdata_dispose" end -external byte_order : TargetData.t -> Endian.t = "llvm_byte_order" -external pointer_size : TargetData.t -> int = "llvm_pointer_size" -external intptr_type : TargetData.t -> Llvm.lltype = "LLVMIntPtrType" -external size_in_bits : TargetData.t -> Llvm.lltype -> Int64.t +external byte_order : DataLayout.t -> Endian.t = "llvm_byte_order" +external pointer_size : DataLayout.t -> int = "llvm_pointer_size" +external intptr_type : DataLayout.t -> Llvm.lltype = "LLVMIntPtrType" +external size_in_bits : DataLayout.t -> Llvm.lltype -> Int64.t = "llvm_size_in_bits" -external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size" -external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size" -external abi_align : TargetData.t -> Llvm.lltype -> int = "llvm_abi_align" -external stack_align : TargetData.t -> Llvm.lltype -> int = "llvm_stack_align" -external preferred_align : TargetData.t -> Llvm.lltype -> int +external store_size : DataLayout.t -> Llvm.lltype -> Int64.t = "llvm_store_size" +external abi_size : DataLayout.t -> Llvm.lltype -> Int64.t = "llvm_abi_size" +external abi_align : DataLayout.t -> Llvm.lltype -> int = "llvm_abi_align" +external stack_align : DataLayout.t -> Llvm.lltype -> int = "llvm_stack_align" +external preferred_align : DataLayout.t -> Llvm.lltype -> int = "llvm_preferred_align" -external preferred_align_of_global : TargetData.t -> Llvm.llvalue -> int +external preferred_align_of_global : DataLayout.t -> Llvm.llvalue -> int = "llvm_preferred_align_of_global" -external element_at_offset : TargetData.t -> Llvm.lltype -> Int64.t -> int +external element_at_offset : DataLayout.t -> Llvm.lltype -> Int64.t -> int = "llvm_element_at_offset" -external offset_of_element : TargetData.t -> Llvm.lltype -> int -> Int64.t +external offset_of_element : DataLayout.t -> Llvm.lltype -> int -> Int64.t = "llvm_offset_of_element" diff --git a/bindings/ocaml/target/llvm_target.mli b/bindings/ocaml/target/llvm_target.mli index c288b9ac2d9c..ab9c5e49eab8 100644 --- a/bindings/ocaml/target/llvm_target.mli +++ b/bindings/ocaml/target/llvm_target.mli @@ -18,11 +18,11 @@ module Endian : sig | Little end -module TargetData : sig +module DataLayout : sig type t - (** [TargetData.create rep] parses the target data string representation [rep]. - See the constructor llvm::TargetData::TargetData. *) + (** [DataLayout.create rep] parses the target data string representation [rep]. + See the constructor llvm::DataLayout::DataLayout. *) external create : string -> t = "llvm_targetdata_create" (** [add_target_data td pm] adds the target data [td] to the pass manager [pm]. @@ -32,64 +32,64 @@ module TargetData : sig = "llvm_targetdata_add" (** [as_string td] is the string representation of the target data [td]. - See the constructor llvm::TargetData::TargetData. *) + See the constructor llvm::DataLayout::DataLayout. *) external as_string : t -> string = "llvm_targetdata_as_string" - (** Deallocates a TargetData. - See the destructor llvm::TargetData::~TargetData. *) + (** Deallocates a DataLayout. + See the destructor llvm::DataLayout::~DataLayout. *) external dispose : t -> unit = "llvm_targetdata_dispose" end (** Returns the byte order of a target, either LLVMBigEndian or LLVMLittleEndian. - See the method llvm::TargetData::isLittleEndian. *) -external byte_order : TargetData.t -> Endian.t = "llvm_byte_order" + See the method llvm::DataLayout::isLittleEndian. *) +external byte_order : DataLayout.t -> Endian.t = "llvm_byte_order" (** Returns the pointer size in bytes for a target. - See the method llvm::TargetData::getPointerSize. *) -external pointer_size : TargetData.t -> int = "llvm_pointer_size" + See the method llvm::DataLayout::getPointerSize. *) +external pointer_size : DataLayout.t -> int = "llvm_pointer_size" (** Returns the integer type that is the same size as a pointer on a target. - See the method llvm::TargetData::getIntPtrType. *) -external intptr_type : TargetData.t -> Llvm.lltype = "LLVMIntPtrType" + See the method llvm::DataLayout::getIntPtrType. *) +external intptr_type : DataLayout.t -> Llvm.lltype = "LLVMIntPtrType" (** Computes the size of a type in bytes for a target. - See the method llvm::TargetData::getTypeSizeInBits. *) -external size_in_bits : TargetData.t -> Llvm.lltype -> Int64.t + See the method llvm::DataLayout::getTypeSizeInBits. *) +external size_in_bits : DataLayout.t -> Llvm.lltype -> Int64.t = "llvm_size_in_bits" (** Computes the storage size of a type in bytes for a target. - See the method llvm::TargetData::getTypeStoreSize. *) -external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size" + See the method llvm::DataLayout::getTypeStoreSize. *) +external store_size : DataLayout.t -> Llvm.lltype -> Int64.t = "llvm_store_size" (** Computes the ABI size of a type in bytes for a target. - See the method llvm::TargetData::getTypeAllocSize. *) -external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size" + See the method llvm::DataLayout::getTypeAllocSize. *) +external abi_size : DataLayout.t -> Llvm.lltype -> Int64.t = "llvm_abi_size" (** Computes the ABI alignment of a type in bytes for a target. - See the method llvm::TargetData::getTypeABISize. *) -external abi_align : TargetData.t -> Llvm.lltype -> int = "llvm_abi_align" + See the method llvm::DataLayout::getTypeABISize. *) +external abi_align : DataLayout.t -> Llvm.lltype -> int = "llvm_abi_align" (** Computes the call frame alignment of a type in bytes for a target. - See the method llvm::TargetData::getTypeABISize. *) -external stack_align : TargetData.t -> Llvm.lltype -> int = "llvm_stack_align" + See the method llvm::DataLayout::getTypeABISize. *) +external stack_align : DataLayout.t -> Llvm.lltype -> int = "llvm_stack_align" (** Computes the preferred alignment of a type in bytes for a target. - See the method llvm::TargetData::getTypeABISize. *) -external preferred_align : TargetData.t -> Llvm.lltype -> int + See the method llvm::DataLayout::getTypeABISize. *) +external preferred_align : DataLayout.t -> Llvm.lltype -> int = "llvm_preferred_align" (** Computes the preferred alignment of a global variable in bytes for a target. - See the method llvm::TargetData::getPreferredAlignment. *) -external preferred_align_of_global : TargetData.t -> Llvm.llvalue -> int + See the method llvm::DataLayout::getPreferredAlignment. *) +external preferred_align_of_global : DataLayout.t -> Llvm.llvalue -> int = "llvm_preferred_align_of_global" (** Computes the structure element that contains the byte offset for a target. See the method llvm::StructLayout::getElementContainingOffset. *) -external element_at_offset : TargetData.t -> Llvm.lltype -> Int64.t -> int +external element_at_offset : DataLayout.t -> Llvm.lltype -> Int64.t -> int = "llvm_element_at_offset" (** Computes the byte offset of the indexed struct element for a target. See the method llvm::StructLayout::getElementContainingOffset. *) -external offset_of_element : TargetData.t -> Llvm.lltype -> int -> Int64.t +external offset_of_element : DataLayout.t -> Llvm.lltype -> int -> Int64.t = "llvm_offset_of_element" diff --git a/bindings/ocaml/target/target_ocaml.c b/bindings/ocaml/target/target_ocaml.c index ca01e7786b68..62fe789a52e2 100644 --- a/bindings/ocaml/target/target_ocaml.c +++ b/bindings/ocaml/target/target_ocaml.c @@ -18,18 +18,18 @@ #include "llvm-c/Target.h" #include "caml/alloc.h" -/* string -> TargetData.t */ +/* string -> DataLayout.t */ CAMLprim LLVMTargetDataRef llvm_targetdata_create(value StringRep) { return LLVMCreateTargetData(String_val(StringRep)); } -/* TargetData.t -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +/* DataLayout.t -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ CAMLprim value llvm_targetdata_add(LLVMTargetDataRef TD, LLVMPassManagerRef PM){ LLVMAddTargetData(TD, PM); return Val_unit; } -/* TargetData.t -> string */ +/* DataLayout.t -> string */ CAMLprim value llvm_targetdata_as_string(LLVMTargetDataRef TD) { char *StringRep = LLVMCopyStringRepOfTargetData(TD); value Copy = copy_string(StringRep); @@ -37,65 +37,65 @@ CAMLprim value llvm_targetdata_as_string(LLVMTargetDataRef TD) { return Copy; } -/* TargetData.t -> unit */ +/* DataLayout.t -> unit */ CAMLprim value llvm_targetdata_dispose(LLVMTargetDataRef TD) { LLVMDisposeTargetData(TD); return Val_unit; } -/* TargetData.t -> Endian.t */ +/* DataLayout.t -> Endian.t */ CAMLprim value llvm_byte_order(LLVMTargetDataRef TD) { return Val_int(LLVMByteOrder(TD)); } -/* TargetData.t -> int */ +/* DataLayout.t -> int */ CAMLprim value llvm_pointer_size(LLVMTargetDataRef TD) { return Val_int(LLVMPointerSize(TD)); } -/* TargetData.t -> Llvm.lltype -> Int64.t */ +/* DataLayout.t -> Llvm.lltype -> Int64.t */ CAMLprim value llvm_size_in_bits(LLVMTargetDataRef TD, LLVMTypeRef Ty) { return caml_copy_int64(LLVMSizeOfTypeInBits(TD, Ty)); } -/* TargetData.t -> Llvm.lltype -> Int64.t */ +/* DataLayout.t -> Llvm.lltype -> Int64.t */ CAMLprim value llvm_store_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) { return caml_copy_int64(LLVMStoreSizeOfType(TD, Ty)); } -/* TargetData.t -> Llvm.lltype -> Int64.t */ +/* DataLayout.t -> Llvm.lltype -> Int64.t */ CAMLprim value llvm_abi_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) { return caml_copy_int64(LLVMABISizeOfType(TD, Ty)); } -/* TargetData.t -> Llvm.lltype -> int */ +/* DataLayout.t -> Llvm.lltype -> int */ CAMLprim value llvm_abi_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) { return Val_int(LLVMABIAlignmentOfType(TD, Ty)); } -/* TargetData.t -> Llvm.lltype -> int */ +/* DataLayout.t -> Llvm.lltype -> int */ CAMLprim value llvm_stack_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) { return Val_int(LLVMCallFrameAlignmentOfType(TD, Ty)); } -/* TargetData.t -> Llvm.lltype -> int */ +/* DataLayout.t -> Llvm.lltype -> int */ CAMLprim value llvm_preferred_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) { return Val_int(LLVMPreferredAlignmentOfType(TD, Ty)); } -/* TargetData.t -> Llvm.llvalue -> int */ +/* DataLayout.t -> Llvm.llvalue -> int */ CAMLprim value llvm_preferred_align_of_global(LLVMTargetDataRef TD, LLVMValueRef GlobalVar) { return Val_int(LLVMPreferredAlignmentOfGlobal(TD, GlobalVar)); } -/* TargetData.t -> Llvm.lltype -> Int64.t -> int */ +/* DataLayout.t -> Llvm.lltype -> Int64.t -> int */ CAMLprim value llvm_element_at_offset(LLVMTargetDataRef TD, LLVMTypeRef Ty, value Offset) { return Val_int(LLVMElementAtOffset(TD, Ty, Int_val(Offset))); } -/* TargetData.t -> Llvm.lltype -> int -> Int64.t */ +/* DataLayout.t -> Llvm.lltype -> int -> Int64.t */ CAMLprim value llvm_offset_of_element(LLVMTargetDataRef TD, LLVMTypeRef Ty, value Index) { return caml_copy_int64(LLVMOffsetOfElement(TD, Ty, Int_val(Index))); |