forked from ocaml/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathilambdac.ml
37 lines (30 loc) · 1.09 KB
/
ilambdac.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module Flambda2_backend = struct
let symbol_for_global' id =
Symbol.unsafe_create
(Compilation_unit.get_current_exn ())
(Linkage_name.create (Compilenv.symbol_for_global id))
let division_by_zero =
symbol_for_global' Predef.ident_division_by_zero
let invalid_argument =
symbol_for_global' Predef.ident_invalid_argument
let closure_symbol _ = failwith "Not yet implemented"
let really_import_approx _ = failwith "Not yet implemented"
let import_symbol _ = failwith "Not yet implemented"
let all_predefined_exception_symbols = Symbol.Set.empty (* XXX *)
let size_int = Arch.size_int
let big_endian = Arch.big_endian
let max_sensible_number_of_arguments =
Proc.max_arguments_for_tailcalls - 1
end
let flambda2_backend =
(module Flambda2_backend : Flambda2_backend_intf.S)
let () =
Clflags.dump_cmm := true;
Clflags.keep_asm_file := true;
let fl = Parse_ilambda.go ~backend:flambda2_backend () in
Asmgen.compile_implementation_flambda
?toplevel:None
~prefixname:"test"
~ppf_dump:Format.std_formatter
~required_globals:Ident.Set.empty
fl