view src/mono_inline.sml @ 2233:af1585e7d645

More work factoring out Sqlcache back end.
author Ziv Scully <ziv@mit.edu>
date Wed, 06 May 2015 23:11:30 -0400
parents edd634b889d0
children
line wrap: on
line source
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