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 3741, Sun Apr 10 23:33:56 2016 UTC revision 3814, Wed May 4 14:26:07 2016 UTC
# Line 88  Line 88 
88              before finish()              before finish()
89            end            end
90    
91      fun doFile (target : Target.desc, filename) = let      fun doFile (target : TargetOptions.t, filename) = let
92            val baseName = (case OS.Path.splitBaseExt filename            val baseName = (case OS.Path.splitBaseExt filename
93                   of {base, ext=SOME "diderot"} => base                   of {base, ext=SOME "diderot"} => base
94                    | _ => (errnl "expected diderot file"; quitWithError filename)                    | _ => (errnl "expected diderot file"; quitWithError filename)
# Line 96  Line 96 
96            val simple = PhaseTimer.withTimer Timers.timeFront frontEnd filename            val simple = PhaseTimer.withTimer Timers.timeFront frontEnd filename
97          (***** TRANSLATION TO HIGH IR*****)          (***** TRANSLATION TO HIGH IR*****)
98            val _ = verbosePrint["translating to HighIR ... "];            val _ = verbosePrint["translating to HighIR ... "];
99            val high = Translate.translate simple            val high = PhaseTimer.withTimer Timers.timeTranslate Translate.translate simple
100            val _ = verbosePrint["done\n"];            val _ = verbosePrint["done\n"];
101            val _ = dump Ctl.dumpHighIR HighPP.output "translate" high            val _ = dump Ctl.dumpHighIR HighPP.output "translate" high
102          (***** HIGH-IR OPTIMIZATION *****)          (***** HIGH-IR OPTIMIZATION *****)
103            val _ = verbosePrint["optimizing HighIR ... "];            val _ = verbosePrint["optimizing HighIR ... "];
104            val high = HighOptimizer.optimize high            val high = PhaseTimer.withTimer Timers.timeHigh HighOptimizer.optimize high
105            val _ = verbosePrint["done\n"];            val _ = verbosePrint["done\n"];
106          (***** TRANSLATION TO MID IR *****)          (***** TRANSLATION TO MID IR *****)
107            val _ = verbosePrint["translating to MidIR ... "];            val _ = verbosePrint["translating to MidIR ... "];
108            val mid = HighToMid.translate high            val mid = PhaseTimer.withTimer Timers.timeHighToMid HighToMid.translate high
109            val _ = verbosePrint["done\n"];            val _ = verbosePrint["done\n"];
110            val _ = dump Ctl.dumpMidIR MidPP.output "high-to-mid" mid            val _ = dump Ctl.dumpMidIR MidPP.output "high-to-mid" mid
111          (***** MID-IR OPTIMIZATION *****)          (***** MID-IR OPTIMIZATION *****)
112            val _ = verbosePrint["optimizing MidIR ... "];            val _ = verbosePrint["optimizing MidIR ... "];
113            val mid = MidOptimizer.optimize mid            val mid = PhaseTimer.withTimer Timers.timeMid MidOptimizer.optimize mid
114            val _ = verbosePrint["done\n"];            val _ = verbosePrint["done\n"];
115          (***** TRANSLATION TO LOW IR *****)          (***** TRANSLATION TO LOW IR *****)
   
116            val _ = verbosePrint["translating to LowIR ... "];            val _ = verbosePrint["translating to LowIR ... "];
117            val low = MidToLow.translate mid            val low = PhaseTimer.withTimer Timers.timeMidToLow MidToLow.translate mid
118            val _ = verbosePrint["done\n"];            val _ = verbosePrint["done\n"];
119            val _ = dump Ctl.dumpLowIR LowPP.output "mid-to-low" low            val _ = dump Ctl.dumpLowIR LowPP.output "mid-to-low" low
120            (***** LOW-IR OPTIMIZATION *****)
121  (* TODO *)            val _ = verbosePrint["optimizing LowIR ... "];
122              val low = PhaseTimer.withTimer Timers.timeLow LowOptimizer.optimize low
123              val _ = verbosePrint["done\n"];
124            (***** TRANSLATION TO TREE IR *****)
125    (* TODO *
126              val _ = verbosePrint["translating to TreeIR ... "];
127              val tree = PhaseTimer.withTimer Timers.timeLowToTree LowToTree.translate low
128              val _ = verbosePrint["done\n"];
129              val _ = dump Ctl.dumpLowIR TreePP.output "low-to-tree" tree
130    *)
131            in            in
132            (***** CODE GENERATION *****)            (***** CODE GENERATION *****)
133  (* TODO *)()  (* TODO *)()
# Line 137  Line 145 
145            OS.Process.failure)            OS.Process.failure)
146    
147      fun main (name: string, args: string list) = let      fun main (name: string, args: string list) = let
148              val _ = PhaseTimer.start Timers.timeCompiler
149            val {help, version, target, defs, file} =            val {help, version, target, defs, file} =
150                  (Options.parseCmdLine args)                  (Options.parseCmdLine args)
151                    handle Options.Usage msg => (                    handle Options.Usage msg => (
# Line 160  Line 169 
169                            if logging                            if logging
170                              then Log.init(base ^ ".log")                              then Log.init(base ^ ".log")
171                              else ();                              else ();
                           PhaseTimer.withTimer Timers.timeCompiler  
172                              doFile (target, file);                              doFile (target, file);
173                            if Controls.get Ctl.collectStats                            if Controls.get Ctl.collectStats
174                              then (                              then (
# Line 169  Line 177 
177                                  else ();                                  else ();
178                                Stats.report ())                                Stats.report ())
179                              else ();                              else ();
180                              PhaseTimer.stop Timers.timeCompiler;
181                            Log.reportTiming Timers.timeCompiler;                            Log.reportTiming Timers.timeCompiler;
182                            OS.Process.success                            OS.Process.success
183                          ) handle exn => handleExn exn                          ) handle exn => handleExn exn

Legend:
Removed from v.3741  
changed lines
  Added in v.3814

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