diff options
| author | Brian Campbell | 2018-01-29 09:18:08 +0000 |
|---|---|---|
| committer | Brian Campbell | 2018-01-29 09:18:08 +0000 |
| commit | 3adfbd69df79862bb9ac8b57f4777a30dac24ff3 (patch) | |
| tree | 9dcce1ab1c12e2ce82630bd8ae4471b4ca1e0ba1 /src/monomorphise.ml | |
| parent | 4e4420f00984c11782445210709e665370e99358 (diff) | |
Turn off warnings when rechecking after mono
Diffstat (limited to 'src/monomorphise.ml')
| -rw-r--r-- | src/monomorphise.ml | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/monomorphise.ml b/src/monomorphise.ml index d911e537..5177a1a1 100644 --- a/src/monomorphise.ml +++ b/src/monomorphise.ml @@ -3123,15 +3123,23 @@ type options = { debug_analysis : int; rewrites : bool; rewrite_size_parameters : bool; - all_split_errors : bool + all_split_errors : bool; + dump_raw: bool } +let recheck defs = + let w = !Util.opt_warnings in + let () = Util.opt_warnings := false in + let r = Type_check.check (Type_check.Env.no_casts Type_check.initial_env) defs in + let () = Util.opt_warnings := w in + r + let monomorphise opts splits env defs = let (defs,env) = if opts.rewrites then let defs = MonoRewrites.mono_rewrite defs in (* TODO: is this necessary? *) - Type_check.check (Type_check.Env.no_casts Type_check.initial_env) defs + recheck defs else (defs,env) in (*let _ = Pretty_print.pp_defs stdout defs in*) @@ -3145,9 +3153,12 @@ let monomorphise opts splits env defs = (* TODO: currently doing this because constant propagation leaves numeric literals as int, try to avoid this later; also use final env for DEF_spec case above, because the type checker doesn't store the env at that point :( *) - if opts.rewrite_size_parameters then - let (defs,env) = Type_check.check (Type_check.Env.no_casts Type_check.initial_env) defs in - let defs = AtomToItself.rewrite_size_parameters env defs in - defs - else - defs + let defs = if opts.rewrite_size_parameters then + let (defs,env) = recheck defs in + let defs = AtomToItself.rewrite_size_parameters env defs in + defs + else + defs + in + let () = if opts.dump_raw then Pretty_print_sail.pp_defs stdout defs else () in + recheck defs |
