mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
[OCaml] Accept context explicitly in Llvm_target functions
Llvm_target.intptr_type used to implicitly use global context. As none of other functions in OCaml bindings do, it is changed to accept context explicitly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194381 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -24,7 +24,8 @@ end
|
||||
|
||||
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 = "llvm_intptr_type"
|
||||
external intptr_type : DataLayout.t -> Llvm.llcontext -> Llvm.lltype
|
||||
= "llvm_intptr_type"
|
||||
external size_in_bits : DataLayout.t -> Llvm.lltype -> Int64.t
|
||||
= "llvm_size_in_bits"
|
||||
external store_size : DataLayout.t -> Llvm.lltype -> Int64.t = "llvm_store_size"
|
||||
|
@@ -47,7 +47,8 @@ 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::DataLayout::getIntPtrType. *)
|
||||
external intptr_type : DataLayout.t -> Llvm.lltype = "llvm_intptr_type"
|
||||
external intptr_type : DataLayout.t -> Llvm.llcontext -> Llvm.lltype
|
||||
= "llvm_intptr_type"
|
||||
|
||||
(** Computes the size of a type in bits for a target.
|
||||
See the method llvm::DataLayout::getTypeSizeInBits. *)
|
||||
|
@@ -72,9 +72,9 @@ CAMLprim value llvm_pointer_size(value TD) {
|
||||
return Val_int(LLVMPointerSize(TargetData_val(TD)));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> int -> Llvm.lltype */
|
||||
CAMLprim LLVMTypeRef llvm_intptr_type(value TD) {
|
||||
return LLVMIntPtrType(TargetData_val(TD));;
|
||||
/* DataLayout.t -> Llvm.llcontext -> Llvm.lltype */
|
||||
CAMLprim LLVMTypeRef llvm_intptr_type(value TD, LLVMContextRef C) {
|
||||
return LLVMIntPtrTypeInContext(C, TargetData_val(TD));;
|
||||
}
|
||||
|
||||
/* DataLayout.t -> Llvm.lltype -> Int64.t */
|
||||
|
Reference in New Issue
Block a user