Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/common/log.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/common/log.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3507, Fri Dec 18 12:49:08 2015 UTC revision 3508, Fri Dec 18 14:19:30 2015 UTC
# Line 16  Line 16 
16    
17      val msg : string -> unit      val msg : string -> unit
18    
19      (* conditional dumping and checking of IR *)
20        val after : {
21                dumpCtl : bool Controls.control,
22                checkCtl : bool Controls.control,
23                output : TextIO.outstream * string * 'prog -> unit,
24                checkIR : string * 'prog -> bool
25              } -> string * 'prog -> 'prog
26    
27      val reportTiming : PhaseTimer.timer -> unit      val reportTiming : PhaseTimer.timer -> unit
28    
29    end = struct    end = struct
# Line 44  Line 52 
52    
53      fun msg s = if !enabledFlg then TextIO.output(logFile(), s) else ();      fun msg s = if !enabledFlg then TextIO.output(logFile(), s) else ();
54    
55        fun after {dumpCtl, checkCtl, output, checkIR} (phase, prog) = let
56              fun dump () = output(logFile(), "after "^phase, prog)
57              in
58                if Controls.get dumpCtl
59                  then dump()
60                  else ();
61                if Controls.get checkCtl andalso checkIR("after " ^ phase, prog)
62                  then (
63                    if not(Controls.get dumpCtl)  (* avoid duplication *)
64                      then dump()
65                      else ();
66                    TextIO.output(TextIO.stdErr, concat [
67                        "***** Internal error after ", phase, ": see log file for details\n"
68                      ]);
69                    OS.Process.exit OS.Process.failure)
70                  else prog
71              end
72    
73      fun reportTiming timer = PhaseTimer.report (logFile(), timer)      fun reportTiming timer = PhaseTimer.report (logFile(), timer)
74    
75    end    end

Legend:
Removed from v.3507  
changed lines
  Added in v.3508

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0