summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ziv Scully <ziv@mit.edu>2014-10-14 18:07:09 -0400
committerGravatar Ziv Scully <ziv@mit.edu>2014-10-14 18:07:09 -0400
commit0185025d29459fe681afa1c01faa22a5d8034884 (patch)
tree9c34000f2479555c2e6bc07f26c23a0a10dfe7dc
parent75d1eedd15edc41b1c2bc9d1fce7a74f37bd78a1 (diff)
Add mono_inline.sml (which was left out of last commit).
-rw-r--r--src/mono_inline.sml28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mono_inline.sml b/src/mono_inline.sml
new file mode 100644
index 00000000..d23419f3
--- /dev/null
+++ b/src/mono_inline.sml
@@ -0,0 +1,28 @@
+structure MonoInline = struct
+
+fun inlineFull file =
+ let
+ val oldInline = Settings.getMonoInline ()
+ val oldFull = !MonoReduce.fullMode
+ in
+ (Settings.setMonoInline (case Int.maxInt of
+ NONE => 1000000
+ | SOME n => n);
+ MonoReduce.fullMode := true;
+ let
+ val file = MonoReduce.reduce file
+ val file = MonoOpt.optimize file
+ val file = Fuse.fuse file
+ val file = MonoOpt.optimize file
+ val file = MonoShake.shake file
+ in
+ file
+ end before
+ (MonoReduce.fullMode := oldFull;
+ Settings.setMonoInline oldInline))
+ handle ex => (Settings.setMonoInline oldInline;
+ MonoReduce.fullMode := oldFull;
+ raise ex)
+ end
+
+end