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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/high-il/high-opt.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/high-il/high-opt.sml

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

revision 1232, Mon May 16 23:37:52 2011 UTC revision 1640, Wed Nov 16 02:19:51 2011 UTC
# Line 28  Line 28 
28              ("high-check", checkFlag, "enable consistency checking for HighIL [debug]")              ("high-check", checkFlag, "enable consistency checking for HighIL [debug]")
29            ]            ]
30    
31      fun debugDump (phase, prog) = if !debugFlag      fun checkIL (phase, prog) = (
32            then (            if !debugFlag
33              HighPP.output (Log.logFile(), "HighIL after " ^ phase, prog);              then HighPP.output (Log.logFile(), "HighIL after " ^ phase, prog)
34              prog)              else ();
35            else prog            if !checkFlag andalso CheckHighIL.check ("after " ^ phase, prog)
   
     fun checkIL (phase, prog) = if !checkFlag  
           then if CheckHighIL.check ("after " ^ phase, prog)  
36              then (              then (
37                  if not(!debugFlag)
38                    then HighPP.output (Log.logFile(), "HighIL after " ^ phase, prog)
39                    else ();
40                TextIO.output(TextIO.stdErr, concat[                TextIO.output(TextIO.stdErr, concat[
41                    "***** Internal error after ", phase,                    "***** Internal error after ", phase,
42                    ": see log file for details\n"                    ": see log file for details\n"
43                  ]);                  ]);
44                OS.Process.exit OS.Process.failure)                OS.Process.exit OS.Process.failure)
45              else prog              else prog)
           else prog  
46    
47      fun transform (ctl, phase, transform, prog) =      fun transform (ctl, phase, transform, prog) =
48            if !ctl            if !ctl
49              then checkIL (phase, debugDump(phase, transform prog))              then checkIL (phase, transform prog)
50              else prog              else prog
51    
52      fun optimize prog = let      fun optimize prog = let
53            val prog = checkIL ("translation to HighIL", prog)            val prog = checkIL ("translation to HighIL", prog)
54            val prog = transform (vnFlag, "value numbering", VN.transform, prog)            val prog = transform (vnFlag, "value numbering", VN.transform, prog)
55            val prog = checkIL ("normalization",            val prog = checkIL ("normalization", Normalize.transform prog)
                 debugDump ("normalization", Normalize.transform prog))  
56            in            in
57              prog              prog
58            end            end

Legend:
Removed from v.1232  
changed lines
  Added in v.1640

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