diff options
author | Micah Villmow <villmow@gmail.com> | 2012-10-08 16:39:34 +0000 |
---|---|---|
committer | Micah Villmow <villmow@gmail.com> | 2012-10-08 16:39:34 +0000 |
commit | 791cfc211a9801002bfda6b3eb4de7e041f04f53 (patch) | |
tree | 6cd0d628596726a82ceecfad41e0d747aecea7fa /bindings | |
parent | 3574eca1b02600bac4e625297f4ecf745f4c4f32 (diff) |
Move TargetData to DataLayout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165403 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/ocaml/executionengine/llvm_executionengine.ml | 4 | ||||
-rw-r--r-- | bindings/ocaml/executionengine/llvm_executionengine.mli | 2 | ||||
-rw-r--r-- | bindings/ocaml/llvm/llvm.mli | 2 | ||||
-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 | 68 |
6 files changed, 79 insertions, 79 deletions
diff --git a/bindings/ocaml/executionengine/llvm_executionengine.ml b/bindings/ocaml/executionengine/llvm_executionengine.ml index a8535b2464..b6178dc055 100644 --- a/bindings/ocaml/executionengine/llvm_executionengine.ml +++ b/bindings/ocaml/executionengine/llvm_executionengine.ml @@ -83,8 +83,8 @@ module ExecutionEngine = struct external free_machine_code: Llvm.llvalue -> t -> unit = "llvm_ee_free_machine_code" - external target_data: t -> Llvm_target.TargetData.t - = "LLVMGetExecutionEngineTargetData" + external target_data: t -> Llvm_target.DataLayout.t + = "LLVMGetExecutionEngineDataLayout" (* 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 166b7bcddc..0b06078bad 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 96448ccd96..eb6c88355a 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/target/llvm_target.ml b/bindings/ocaml/target/llvm_target.ml index 49940eec48..f4891e2b83 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 c288b9ac2d..ab9c5e49ea 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 ca01e7786b..c9d0b8771b 100644 --- a/bindings/ocaml/target/target_ocaml.c +++ b/bindings/ocaml/target/target_ocaml.c @@ -18,85 +18,85 @@ #include "llvm-c/Target.h" #include "caml/alloc.h" -/* string -> TargetData.t */ -CAMLprim LLVMTargetDataRef llvm_targetdata_create(value StringRep) { - return LLVMCreateTargetData(String_val(StringRep)); +/* string -> DataLayout.t */ +CAMLprim LLVMDataLayoutRef llvm_targetdata_create(value StringRep) { + return LLVMCreateDataLayout(String_val(StringRep)); } -/* TargetData.t -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ -CAMLprim value llvm_targetdata_add(LLVMTargetDataRef TD, LLVMPassManagerRef PM){ - LLVMAddTargetData(TD, PM); +/* DataLayout.t -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_targetdata_add(LLVMDataLayoutRef TD, LLVMPassManagerRef PM){ + LLVMAddDataLayout(TD, PM); return Val_unit; } -/* TargetData.t -> string */ -CAMLprim value llvm_targetdata_as_string(LLVMTargetDataRef TD) { - char *StringRep = LLVMCopyStringRepOfTargetData(TD); +/* DataLayout.t -> string */ +CAMLprim value llvm_targetdata_as_string(LLVMDataLayoutRef TD) { + char *StringRep = LLVMCopyStringRepOfDataLayout(TD); value Copy = copy_string(StringRep); LLVMDisposeMessage(StringRep); return Copy; } -/* TargetData.t -> unit */ -CAMLprim value llvm_targetdata_dispose(LLVMTargetDataRef TD) { - LLVMDisposeTargetData(TD); +/* DataLayout.t -> unit */ +CAMLprim value llvm_targetdata_dispose(LLVMDataLayoutRef TD) { + LLVMDisposeDataLayout(TD); return Val_unit; } -/* TargetData.t -> Endian.t */ -CAMLprim value llvm_byte_order(LLVMTargetDataRef TD) { +/* DataLayout.t -> Endian.t */ +CAMLprim value llvm_byte_order(LLVMDataLayoutRef TD) { return Val_int(LLVMByteOrder(TD)); } -/* TargetData.t -> int */ -CAMLprim value llvm_pointer_size(LLVMTargetDataRef TD) { +/* DataLayout.t -> int */ +CAMLprim value llvm_pointer_size(LLVMDataLayoutRef TD) { return Val_int(LLVMPointerSize(TD)); } -/* TargetData.t -> Llvm.lltype -> Int64.t */ -CAMLprim value llvm_size_in_bits(LLVMTargetDataRef TD, LLVMTypeRef Ty) { +/* DataLayout.t -> Llvm.lltype -> Int64.t */ +CAMLprim value llvm_size_in_bits(LLVMDataLayoutRef TD, LLVMTypeRef Ty) { return caml_copy_int64(LLVMSizeOfTypeInBits(TD, Ty)); } -/* TargetData.t -> Llvm.lltype -> Int64.t */ -CAMLprim value llvm_store_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) { +/* DataLayout.t -> Llvm.lltype -> Int64.t */ +CAMLprim value llvm_store_size(LLVMDataLayoutRef TD, LLVMTypeRef Ty) { return caml_copy_int64(LLVMStoreSizeOfType(TD, Ty)); } -/* TargetData.t -> Llvm.lltype -> Int64.t */ -CAMLprim value llvm_abi_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) { +/* DataLayout.t -> Llvm.lltype -> Int64.t */ +CAMLprim value llvm_abi_size(LLVMDataLayoutRef TD, LLVMTypeRef Ty) { return caml_copy_int64(LLVMABISizeOfType(TD, Ty)); } -/* TargetData.t -> Llvm.lltype -> int */ -CAMLprim value llvm_abi_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) { +/* DataLayout.t -> Llvm.lltype -> int */ +CAMLprim value llvm_abi_align(LLVMDataLayoutRef TD, LLVMTypeRef Ty) { return Val_int(LLVMABIAlignmentOfType(TD, Ty)); } -/* TargetData.t -> Llvm.lltype -> int */ -CAMLprim value llvm_stack_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) { +/* DataLayout.t -> Llvm.lltype -> int */ +CAMLprim value llvm_stack_align(LLVMDataLayoutRef TD, LLVMTypeRef Ty) { return Val_int(LLVMCallFrameAlignmentOfType(TD, Ty)); } -/* TargetData.t -> Llvm.lltype -> int */ -CAMLprim value llvm_preferred_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) { +/* DataLayout.t -> Llvm.lltype -> int */ +CAMLprim value llvm_preferred_align(LLVMDataLayoutRef TD, LLVMTypeRef Ty) { return Val_int(LLVMPreferredAlignmentOfType(TD, Ty)); } -/* TargetData.t -> Llvm.llvalue -> int */ -CAMLprim value llvm_preferred_align_of_global(LLVMTargetDataRef TD, +/* DataLayout.t -> Llvm.llvalue -> int */ +CAMLprim value llvm_preferred_align_of_global(LLVMDataLayoutRef TD, LLVMValueRef GlobalVar) { return Val_int(LLVMPreferredAlignmentOfGlobal(TD, GlobalVar)); } -/* TargetData.t -> Llvm.lltype -> Int64.t -> int */ -CAMLprim value llvm_element_at_offset(LLVMTargetDataRef TD, LLVMTypeRef Ty, +/* DataLayout.t -> Llvm.lltype -> Int64.t -> int */ +CAMLprim value llvm_element_at_offset(LLVMDataLayoutRef TD, LLVMTypeRef Ty, value Offset) { return Val_int(LLVMElementAtOffset(TD, Ty, Int_val(Offset))); } -/* TargetData.t -> Llvm.lltype -> int -> Int64.t */ -CAMLprim value llvm_offset_of_element(LLVMTargetDataRef TD, LLVMTypeRef Ty, +/* DataLayout.t -> Llvm.lltype -> int -> Int64.t */ +CAMLprim value llvm_offset_of_element(LLVMDataLayoutRef TD, LLVMTypeRef Ty, value Index) { return caml_copy_int64(LLVMOffsetOfElement(TD, Ty, Int_val(Index))); } |