mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Fix the ocaml binding breakage from TargetData -> DataLayout changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165406 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5b7c42c26e
commit
e2c207db1d
@ -19,84 +19,84 @@
|
||||
#include "caml/alloc.h"
|
||||
|
||||
/* string -> DataLayout.t */
|
||||
CAMLprim LLVMDataLayoutRef llvm_targetdata_create(value StringRep) {
|
||||
return LLVMCreateDataLayout(String_val(StringRep));
|
||||
CAMLprim LLVMTargetDataRef llvm_targetdata_create(value StringRep) {
|
||||
return LLVMCreateTargetData(String_val(StringRep));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
|
||||
CAMLprim value llvm_targetdata_add(LLVMDataLayoutRef TD, LLVMPassManagerRef PM){
|
||||
LLVMAddDataLayout(TD, PM);
|
||||
CAMLprim value llvm_targetdata_add(LLVMTargetDataRef TD, LLVMPassManagerRef PM){
|
||||
LLVMAddTargetData(TD, PM);
|
||||
return Val_unit;
|
||||
}
|
||||
|
||||
/* DataLayout.t -> string */
|
||||
CAMLprim value llvm_targetdata_as_string(LLVMDataLayoutRef TD) {
|
||||
char *StringRep = LLVMCopyStringRepOfDataLayout(TD);
|
||||
CAMLprim value llvm_targetdata_as_string(LLVMTargetDataRef TD) {
|
||||
char *StringRep = LLVMCopyStringRepOfTargetData(TD);
|
||||
value Copy = copy_string(StringRep);
|
||||
LLVMDisposeMessage(StringRep);
|
||||
return Copy;
|
||||
}
|
||||
|
||||
/* DataLayout.t -> unit */
|
||||
CAMLprim value llvm_targetdata_dispose(LLVMDataLayoutRef TD) {
|
||||
LLVMDisposeDataLayout(TD);
|
||||
CAMLprim value llvm_targetdata_dispose(LLVMTargetDataRef TD) {
|
||||
LLVMDisposeTargetData(TD);
|
||||
return Val_unit;
|
||||
}
|
||||
|
||||
/* DataLayout.t -> Endian.t */
|
||||
CAMLprim value llvm_byte_order(LLVMDataLayoutRef TD) {
|
||||
CAMLprim value llvm_byte_order(LLVMTargetDataRef TD) {
|
||||
return Val_int(LLVMByteOrder(TD));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> int */
|
||||
CAMLprim value llvm_pointer_size(LLVMDataLayoutRef TD) {
|
||||
CAMLprim value llvm_pointer_size(LLVMTargetDataRef TD) {
|
||||
return Val_int(LLVMPointerSize(TD));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> Llvm.lltype -> Int64.t */
|
||||
CAMLprim value llvm_size_in_bits(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
|
||||
CAMLprim value llvm_size_in_bits(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
|
||||
return caml_copy_int64(LLVMSizeOfTypeInBits(TD, Ty));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> Llvm.lltype -> Int64.t */
|
||||
CAMLprim value llvm_store_size(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
|
||||
CAMLprim value llvm_store_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
|
||||
return caml_copy_int64(LLVMStoreSizeOfType(TD, Ty));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> Llvm.lltype -> Int64.t */
|
||||
CAMLprim value llvm_abi_size(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
|
||||
CAMLprim value llvm_abi_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
|
||||
return caml_copy_int64(LLVMABISizeOfType(TD, Ty));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> Llvm.lltype -> int */
|
||||
CAMLprim value llvm_abi_align(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
|
||||
CAMLprim value llvm_abi_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
|
||||
return Val_int(LLVMABIAlignmentOfType(TD, Ty));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> Llvm.lltype -> int */
|
||||
CAMLprim value llvm_stack_align(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
|
||||
CAMLprim value llvm_stack_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
|
||||
return Val_int(LLVMCallFrameAlignmentOfType(TD, Ty));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> Llvm.lltype -> int */
|
||||
CAMLprim value llvm_preferred_align(LLVMDataLayoutRef TD, LLVMTypeRef Ty) {
|
||||
CAMLprim value llvm_preferred_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
|
||||
return Val_int(LLVMPreferredAlignmentOfType(TD, Ty));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> Llvm.llvalue -> int */
|
||||
CAMLprim value llvm_preferred_align_of_global(LLVMDataLayoutRef TD,
|
||||
CAMLprim value llvm_preferred_align_of_global(LLVMTargetDataRef TD,
|
||||
LLVMValueRef GlobalVar) {
|
||||
return Val_int(LLVMPreferredAlignmentOfGlobal(TD, GlobalVar));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> Llvm.lltype -> Int64.t -> int */
|
||||
CAMLprim value llvm_element_at_offset(LLVMDataLayoutRef TD, LLVMTypeRef Ty,
|
||||
CAMLprim value llvm_element_at_offset(LLVMTargetDataRef TD, LLVMTypeRef Ty,
|
||||
value Offset) {
|
||||
return Val_int(LLVMElementAtOffset(TD, Ty, Int_val(Offset)));
|
||||
}
|
||||
|
||||
/* DataLayout.t -> Llvm.lltype -> int -> Int64.t */
|
||||
CAMLprim value llvm_offset_of_element(LLVMDataLayoutRef TD, LLVMTypeRef Ty,
|
||||
CAMLprim value llvm_offset_of_element(LLVMTargetDataRef TD, LLVMTypeRef Ty,
|
||||
value Index) {
|
||||
return caml_copy_int64(LLVMOffsetOfElement(TD, Ty, Int_val(Index)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user