1 (*===-- llvm_target.ml - LLVM Ocaml Interface ------------------*- OCaml -*-===* 2 * 3 * The LLVM Compiler Infrastructure 4 * 5 * This file is distributed under the University of Illinois Open Source 6 * License. See LICENSE.TXT for details. 7 * 8 *===----------------------------------------------------------------------===*) 9 10 module Endian = struct 11 type t = 12 | Big 13 | Little 14 end 15 16 module TargetData = struct 17 type t 18 19 external create : string -> t = "llvm_targetdata_create" 20 external add : t -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit 21 = "llvm_targetdata_add" 22 external as_string : t -> string = "llvm_targetdata_as_string" 23 external dispose : t -> unit = "llvm_targetdata_dispose" 24 end 25 26 external byte_order : TargetData.t -> Endian.t = "llvm_byte_order" 27 external pointer_size : TargetData.t -> int = "llvm_pointer_size" 28 external intptr_type : TargetData.t -> Llvm.lltype = "LLVMIntPtrType" 29 external size_in_bits : TargetData.t -> Llvm.lltype -> Int64.t 30 = "llvm_size_in_bits" 31 external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size" 32 external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size" 33 external abi_align : TargetData.t -> Llvm.lltype -> int = "llvm_abi_align" 34 external stack_align : TargetData.t -> Llvm.lltype -> int = "llvm_stack_align" 35 external preferred_align : TargetData.t -> Llvm.lltype -> int 36 = "llvm_preferred_align" 37 external preferred_align_of_global : TargetData.t -> Llvm.llvalue -> int 38 = "llvm_preferred_align_of_global" 39 external element_at_offset : TargetData.t -> Llvm.lltype -> Int64.t -> int 40 = "llvm_element_at_offset" 41 external offset_of_element : TargetData.t -> Llvm.lltype -> int -> Int64.t 42 = "llvm_offset_of_element" 43