mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Expose initializing the native target for the execution engine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81800 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -24,11 +24,15 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
/* Force the LLVM interpreter, JIT, and native target to be linked in. */
|
/* Force the LLVM interpreter and JIT to be linked in. */
|
||||||
void llvm_initialize(void) {
|
void llvm_initialize(void) {
|
||||||
LLVMLinkInInterpreter();
|
LLVMLinkInInterpreter();
|
||||||
LLVMLinkInJIT();
|
LLVMLinkInJIT();
|
||||||
LLVMInitializeNativeTarget();
|
}
|
||||||
|
|
||||||
|
/* unit -> bool */
|
||||||
|
CAMLprim value llvm_initialize_native_target(value Unit) {
|
||||||
|
return Val_bool(LLVMInitializeNativeTarget());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Can't use the recommended caml_named_value mechanism for backwards
|
/* Can't use the recommended caml_named_value mechanism for backwards
|
||||||
|
@@ -109,3 +109,6 @@ module ExecutionEngine = struct
|
|||||||
|
|
||||||
*)
|
*)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
external initialize_native_target : unit -> bool
|
||||||
|
= "llvm_initialize_native_target"
|
||||||
|
@@ -161,3 +161,6 @@ module ExecutionEngine: sig
|
|||||||
[ee]. *)
|
[ee]. *)
|
||||||
val target_data: t -> Llvm_target.TargetData.t
|
val target_data: t -> Llvm_target.TargetData.t
|
||||||
end
|
end
|
||||||
|
|
||||||
|
external initialize_native_target : unit -> bool
|
||||||
|
= "llvm_initialize_native_target"
|
||||||
|
@@ -962,6 +962,8 @@ open Llvm_target
|
|||||||
open Llvm_scalar_opts
|
open Llvm_scalar_opts
|
||||||
|
|
||||||
let main () =
|
let main () =
|
||||||
|
ignore (initialize_native_target ());
|
||||||
|
|
||||||
(* Install standard binary operators.
|
(* Install standard binary operators.
|
||||||
* 1 is the lowest precedence. *)
|
* 1 is the lowest precedence. *)
|
||||||
Hashtbl.add Parser.binop_precedence '<' 10;
|
Hashtbl.add Parser.binop_precedence '<' 10;
|
||||||
|
@@ -1487,6 +1487,8 @@ open Llvm_target
|
|||||||
open Llvm_scalar_opts
|
open Llvm_scalar_opts
|
||||||
|
|
||||||
let main () =
|
let main () =
|
||||||
|
ignore (initialize_native_target ());
|
||||||
|
|
||||||
(* Install standard binary operators.
|
(* Install standard binary operators.
|
||||||
* 1 is the lowest precedence. *)
|
* 1 is the lowest precedence. *)
|
||||||
Hashtbl.add Parser.binop_precedence '<' 10;
|
Hashtbl.add Parser.binop_precedence '<' 10;
|
||||||
|
@@ -1486,6 +1486,8 @@ open Llvm_target
|
|||||||
open Llvm_scalar_opts
|
open Llvm_scalar_opts
|
||||||
|
|
||||||
let main () =
|
let main () =
|
||||||
|
ignore (initialize_native_target ());
|
||||||
|
|
||||||
(* Install standard binary operators.
|
(* Install standard binary operators.
|
||||||
* 1 is the lowest precedence. *)
|
* 1 is the lowest precedence. *)
|
||||||
Hashtbl.add Parser.binop_precedence '<' 10;
|
Hashtbl.add Parser.binop_precedence '<' 10;
|
||||||
|
@@ -1816,6 +1816,8 @@ open Llvm_target
|
|||||||
open Llvm_scalar_opts
|
open Llvm_scalar_opts
|
||||||
|
|
||||||
let main () =
|
let main () =
|
||||||
|
ignore (initialize_native_target ());
|
||||||
|
|
||||||
(* Install standard binary operators.
|
(* Install standard binary operators.
|
||||||
* 1 is the lowest precedence. *)
|
* 1 is the lowest precedence. *)
|
||||||
Hashtbl.add Parser.binop_precedence '=' 2;
|
Hashtbl.add Parser.binop_precedence '=' 2;
|
||||||
|
Reference in New Issue
Block a user