mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-09 10:30:47 +00:00
[OCaml] Unbreak Llvm_executionengine.initialize_native_target.
First, return true on success, as it is the OCaml convention. Second, also initialize the native assembly printer, which is, despite the name, required for MCJIT operation. Since this function did not initialize the assembly printer earlier and no function to initialize native assembly printer was available elsewhere, it is safe to break its interface: it means that it simply could not be used successfully before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220620 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -32,7 +32,9 @@ void llvm_initialize(void) {
|
|||||||
|
|
||||||
/* unit -> bool */
|
/* unit -> bool */
|
||||||
CAMLprim value llvm_initialize_native_target(value Unit) {
|
CAMLprim value llvm_initialize_native_target(value Unit) {
|
||||||
return Val_bool(LLVMInitializeNativeTarget());
|
return Val_bool(!LLVMInitializeNativeTarget() &&
|
||||||
|
!LLVMInitializeNativeAsmParser() &&
|
||||||
|
!LLVMInitializeNativeAsmPrinter());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Can't use the recommended caml_named_value mechanism for backwards
|
/* Can't use the recommended caml_named_value mechanism for backwards
|
||||||
|
@@ -19,6 +19,9 @@ let i32_type = Llvm.i32_type context
|
|||||||
let i64_type = Llvm.i64_type context
|
let i64_type = Llvm.i64_type context
|
||||||
let double_type = Llvm.double_type context
|
let double_type = Llvm.double_type context
|
||||||
|
|
||||||
|
let () =
|
||||||
|
assert (Llvm_executionengine.initialize_native_target ())
|
||||||
|
|
||||||
let bomb msg =
|
let bomb msg =
|
||||||
prerr_endline msg;
|
prerr_endline msg;
|
||||||
exit 2
|
exit 2
|
||||||
|
Reference in New Issue
Block a user