diff options
| author | Alasdair | 2019-03-05 03:09:16 +0000 |
|---|---|---|
| committer | Alasdair | 2019-03-05 03:09:16 +0000 |
| commit | 8718a39778d4c673ceea1c7f9bb219b29788ebae (patch) | |
| tree | bb1bbb4a90fa1332e6c6736e99177934ca0dfdab /src/specialize.ml | |
| parent | 15872b4c48d932a920ea6d22b69889ff32f6a446 (diff) | |
Additional optimizations for C compilation
Diffstat (limited to 'src/specialize.ml')
| -rw-r--r-- | src/specialize.ml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/specialize.ml b/src/specialize.ml index 19c5df7a..a487fc2f 100644 --- a/src/specialize.ml +++ b/src/specialize.ml @@ -52,6 +52,8 @@ open Ast open Ast_util open Rewriter +let opt_ddump_spec_ast = ref None + let is_typ_ord_arg = function | A_aux (A_typ _, _) -> true | A_aux (A_order _, _) -> true @@ -565,6 +567,15 @@ let specialize_ids spec ids ast = (1, ast) (IdSet.elements ids) in let ast = reorder_typedefs ast in + begin match !opt_ddump_spec_ast with + | Some (f, i) -> + let filename = f ^ "_spec_" ^ string_of_int i ^ ".sail" in + let out_chan = open_out filename in + Pretty_print_sail.pp_defs out_chan ast; + close_out out_chan; + opt_ddump_spec_ast := Some (f, i + 1) + | None -> () + end; let ast, _ = Type_error.check Type_check.initial_env ast in let ast = List.fold_left (fun ast id -> rewrite_polymorphic_calls spec id ast) ast (IdSet.elements ids) |
