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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/driver/main.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/driver/main.sml

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

revision 3506, Fri Dec 18 04:03:54 2015 UTC revision 3582, Wed Jan 13 22:14:05 2016 UTC
# Line 27  Line 27 
27              else ()              else ()
28    
29    (* conditional printing of intermediate forms *)    (* conditional printing of intermediate forms *)
30      fun dump ctl output message prog = if Controls.get ctl      fun dump ctl output phase prog = if Controls.get ctl
31            then output (Log.logFile(), message, prog)            then output (Log.logFile(), "After "^phase, prog)
32            else ()            else ()
33    
34    (* compiler front end (parsing, typechecking, and simplification *)    (* compiler front end (parsing, typechecking, and simplification *)
# Line 47  Line 47 
47                    checkForErrors errStrm;                    checkForErrors errStrm;
48                    valOf pt                    valOf pt
49                  end) ()                  end) ()
50            val _ = dump Ctl.dumpPT (ParseTreePP.output errStrm) "" parseTree            val _ = dump Ctl.dumpPT (ParseTreePP.output errStrm) "parsing" parseTree
51          (***** TYPECHECKING *****)          (***** TYPECHECKING *****)
52            val _ = PhaseTimer.start Timers.timeTypechecker            val _ = PhaseTimer.start Timers.timeTypechecker
53            val ast = (Typechecker.check errStrm parseTree)            val ast = (Typechecker.check errStrm parseTree)
54            val _ = PhaseTimer.stop Timers.timeTypechecker            val _ = PhaseTimer.stop Timers.timeTypechecker
55            val _ = checkForErrors errStrm            val _ = checkForErrors errStrm
56  (* TODO: check AST for consistency *)  (* TODO: check AST for consistency *)
57            val _ = dump Ctl.dumpAST ASTPP.output "" ast            val _ = dump Ctl.dumpAST ASTPP.output "typechecking" ast
58          (***** SIMPLIFY *****)          (***** SIMPLIFY *****)
59            val simple = Simplify.transform (errStrm, ast)            val simple = SimpleOpt.checkAfter ("simplify", Simplify.transform (errStrm, ast))
           val _ = dump Ctl.dumpSimple SimplePP.output "after simplify" simple  
60            val simple = SimpleOpt.transform simple            val simple = SimpleOpt.transform simple
           val _ = dump Ctl.dumpSimple SimplePP.output "after simple optimization" simple  
61            in            in
62            (* check for warnings and report if necessary *)            (* check for warnings and report if necessary *)
63              if Error.anyWarnings errStrm              if Error.anyWarnings errStrm
# Line 92  Line 90 
90                    | _ => (errnl "expected diderot file"; quitWithError filename)                    | _ => (errnl "expected diderot file"; quitWithError filename)
91                  (* end case *))                  (* end case *))
92            val simple = PhaseTimer.withTimer Timers.timeFront frontEnd filename            val simple = PhaseTimer.withTimer Timers.timeFront frontEnd filename
93          (***** TRANSLATION TO HIGH IL*****)          (***** TRANSLATION TO HIGH IR*****)
94            val high = Translate.translate simple            val high = Translate.translate simple
95            val _ = dump Ctl.dumpHighIL HighPP.output "after translate" high            val _ = dump Ctl.dumpHighIR HighPP.output "translate" high
96  (* TODO *)          (***** HIGH-IR OPTIMIZATION *****)
97          (***** HIGH-IL OPTIMIZATION *****)            val high = HighOptimizer.optimize high
98  (* TODO *)          (***** TRANSLATION TO MID IR *****)
99          (***** TRANSLATION TO MID IL *****)            val mid = HighToMid.translate high
100  (* TODO *)            val _ = dump Ctl.dumpMidIR MidPP.output "high-to-mid" mid
101          (***** TRANSLATION TO LOW IL *****)          (***** TRANSLATION TO LOW IR *****)
102  (* TODO *)  (* TODO *)
103            in            in
104            (***** CODE GENERATION *****)            (***** CODE GENERATION *****)

Legend:
Removed from v.3506  
changed lines
  Added in v.3582

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