annotate 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
rev   line source
ziv@2214 1 structure MonoInline = struct
ziv@2214 2
ziv@2214 3 fun inlineFull file =
ziv@2214 4 let
ziv@2214 5 val oldInline = Settings.getMonoInline ()
ziv@2214 6 val oldFull = !MonoReduce.fullMode
ziv@2214 7 in
ziv@2214 8 (Settings.setMonoInline (case Int.maxInt of
ziv@2214 9 NONE => 1000000
ziv@2214 10 | SOME n => n);
ziv@2214 11 MonoReduce.fullMode := true;
ziv@2214 12 let
ziv@2214 13 val file = MonoReduce.reduce file
ziv@2214 14 val file = MonoOpt.optimize file
ziv@2214 15 val file = Fuse.fuse file
ziv@2214 16 val file = MonoOpt.optimize file
ziv@2214 17 val file = MonoShake.shake file
ziv@2214 18 in
ziv@2214 19 file
ziv@2214 20 end before
ziv@2214 21 (MonoReduce.fullMode := oldFull;
ziv@2214 22 Settings.setMonoInline oldInline))
ziv@2214 23 handle ex => (Settings.setMonoInline oldInline;
ziv@2214 24 MonoReduce.fullMode := oldFull;
ziv@2214 25 raise ex)
ziv@2214 26 end
ziv@2214 27
ziv@2214 28 end