# HG changeset patch # User Ziv Scully # Date 1413324429 14400 # Node ID edd634b889d0ad44d6646731e57ecdf2f992df7a # Parent 365727ff68f4620db0473d7fd91d448c1878afaf Add mono_inline.sml (which was left out of last commit). diff -r 365727ff68f4 -r edd634b889d0 src/mono_inline.sml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mono_inline.sml Tue Oct 14 18:07:09 2014 -0400 @@ -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