comparison src/mono_inline.sml @ 2214:edd634b889d0

Add mono_inline.sml (which was left out of last commit).
author Ziv Scully <ziv@mit.edu>
date Tue, 14 Oct 2014 18:07:09 -0400
parents
children
comparison
equal deleted inserted replaced
2213:365727ff68f4 2214:edd634b889d0
1 structure MonoInline = struct
2
3 fun inlineFull file =
4 let
5 val oldInline = Settings.getMonoInline ()
6 val oldFull = !MonoReduce.fullMode
7 in
8 (Settings.setMonoInline (case Int.maxInt of
9 NONE => 1000000
10 | SOME n => n);
11 MonoReduce.fullMode := true;
12 let
13 val file = MonoReduce.reduce file
14 val file = MonoOpt.optimize file
15 val file = Fuse.fuse file
16 val file = MonoOpt.optimize file
17 val file = MonoShake.shake file
18 in
19 file
20 end before
21 (MonoReduce.fullMode := oldFull;
22 Settings.setMonoInline oldInline))
23 handle ex => (Settings.setMonoInline oldInline;
24 MonoReduce.fullMode := oldFull;
25 raise ex)
26 end
27
28 end