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 3711, Fri Apr 1 22:57:00 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
           (* check for warnings and report if necessary *)  
             if Error.anyWarnings errStrm  
               then Error.report (TextIO.stdErr, errStrm)  
               else ();  
62              simple              simple
63            end            end
64    
# Line 74  Line 68 
68      fun frontEnd filename = let      fun frontEnd filename = let
69            val errStrm = Error.mkErrStream filename            val errStrm = Error.mkErrStream filename
70            fun finish () = (            fun finish () = (
71                  if Error.anyErrors errStrm                  if Error.anyWarnings errStrm
                   then (  
                     Error.report (TextIO.stdErr, errStrm);  
                     quitWithError (Error.sourceFile errStrm))  
                 else if Error.anyWarnings errStrm  
72                    then Error.report (TextIO.stdErr, errStrm)                    then Error.report (TextIO.stdErr, errStrm)
73                    else ())                    else ())
74            in            in
# Line 92  Line 82 
82                    | _ => (errnl "expected diderot file"; quitWithError filename)                    | _ => (errnl "expected diderot file"; quitWithError filename)
83                  (* end case *))                  (* end case *))
84            val simple = PhaseTimer.withTimer Timers.timeFront frontEnd filename            val simple = PhaseTimer.withTimer Timers.timeFront frontEnd filename
85          (***** TRANSLATION TO HIGH IL*****)          (***** TRANSLATION TO HIGH IR*****)
86            val high = Translate.translate simple            val high = Translate.translate simple
87            val _ = dump Ctl.dumpHighIL HighPP.output "after translate" high            val _ = dump Ctl.dumpHighIR HighPP.output "translate" high
88  (* TODO *)          (***** HIGH-IR OPTIMIZATION *****)
89          (***** HIGH-IL OPTIMIZATION *****)            val high = HighOptimizer.optimize high
90  (* TODO *)          (***** TRANSLATION TO MID IR *****)
91          (***** TRANSLATION TO MID IL *****)            val mid = HighToMid.translate high
92  (* TODO *)            val _ = dump Ctl.dumpMidIR MidPP.output "high-to-mid" mid
93          (***** TRANSLATION TO LOW IL *****)          (***** MID-IR OPTIMIZATION *****)
94              val mid = MidOptimizer.optimize mid
95            (***** TRANSLATION TO LOW IR *****)
96              val low = MidToLow.translate mid
97              val _ = dump Ctl.dumpLowIR LowPP.output "mid-to-low" low
98  (* TODO *)  (* TODO *)
99            in            in
100            (***** CODE GENERATION *****)            (***** CODE GENERATION *****)

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

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