Option to perform type inference on all types
This commit is contained in:
parent
0aad3ac466
commit
cad8a0149f
4 changed files with 13 additions and 7 deletions
|
@ -129,7 +129,8 @@ let main () =
|
|||
"-only-memalloc", Arg.Set do_mem_alloc, doc_memalloc_only;
|
||||
"-only-linear", Arg.Set do_linear_typing, doc_linear_only;
|
||||
"-old-scheduler", Arg.Set use_old_scheduler, doc_interf_scheduler;
|
||||
"-O", Arg.Unit do_optim, doc_optim
|
||||
"-O", Arg.Unit do_optim, doc_optim;
|
||||
"-mall", Arg.Set interf_all, doc_interf_all;
|
||||
]
|
||||
compile errmsg;
|
||||
with
|
||||
|
|
|
@ -142,13 +142,14 @@ module World = struct
|
|||
Signature.field_assoc f fields
|
||||
|
||||
let is_optimized_ty ty =
|
||||
match Modules.unalias_type ty with
|
||||
| Tarray _ -> true
|
||||
| Tid n ->
|
||||
!Compiler_options.interf_all ||
|
||||
match Modules.unalias_type ty with
|
||||
| Tarray _ -> true
|
||||
| Tid n ->
|
||||
(match Modules.find_type n with
|
||||
| Signature.Tstruct _ -> true
|
||||
| _ -> false)
|
||||
| _ -> false
|
||||
| _ -> false
|
||||
|
||||
let is_optimized iv =
|
||||
is_optimized_ty (ivar_type iv)
|
||||
|
|
|
@ -140,6 +140,9 @@ let node _ () f =
|
|||
f, ()
|
||||
|
||||
let program p =
|
||||
let mall = !Compiler_options.interf_all in
|
||||
(* Compiler_options.interf_all := false; *)
|
||||
let funs = { Mls_mapfold.defaults with Mls_mapfold.node_dec = node } in
|
||||
let p, () = Mls_mapfold.program_it funs () p in
|
||||
p
|
||||
Compiler_options.interf_all := mall;
|
||||
p
|
||||
|
|
|
@ -134,7 +134,7 @@ let check_options () =
|
|||
if !do_linear_typing then err "Unable to activate linear typing with strict SSA activated."
|
||||
)
|
||||
|
||||
|
||||
let interf_all = ref false
|
||||
|
||||
let doc_verbose = "\t\t\tSet verbose mode"
|
||||
and doc_version = "\t\tThe version of the compiler"
|
||||
|
@ -170,3 +170,4 @@ and doc_memalloc_only = "\tEnable memory allocation"
|
|||
and doc_linear_only = "\t\tEnable linear annotations"
|
||||
and doc_interf_scheduler = "\tUse the old scheduler"
|
||||
and doc_optim = "\t\t\tOptimize with deadcode, tomato, itfusion and memalloc"
|
||||
and doc_interf_all = "\t\tPerform memory allocation on all types"
|
||||
|
|
Loading…
Reference in a new issue