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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/simplify/simplify.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/simplify/simplify.sml

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

revision 2140, Thu Feb 14 23:58:15 2013 UTC revision 2147, Sun Feb 17 17:30:09 2013 UTC
# Line 210  Line 210 
210     *)     *)
211      and simplifyBlock stm = mkBlock (simplifyStmt (stm, []))      and simplifyBlock stm = mkBlock (simplifyStmt (stm, []))
212    
213      (* simplify the statement stm where stms is a reverse-order list of preceeding simplified
214       * statements.  This function returns a reverse-order list of simplified statements.
215       *)
216      and simplifyStmt (stm, stms) = (case stm      and simplifyStmt (stm, stms) = (case stm
217             of AST.S_Block body => let             of AST.S_Block body => let
218  (* FIXME: we should probably prune unreachable code in the typechecker and issue a warning! *)  (* FIXME: we should probably prune unreachable code in the typechecker and issue a warning! *)
219                  fun simplify ([], stms) = stms                  fun simplify ([], stms) = stms
220                    | simplify (stm::r, stms) = if contIsNext stm                    | simplify (stm::r, stms) = if contIsNext stm
221                        then simplify (r, simplifyStmt (stm, stms))                        then simplify (r, simplifyStmt (stm, stms))
222                        else simplify (r, [])  (* prune unreachable statements *)                        else simplifyStmt (stm, stms)  (* prune unreachable statements *)
223                  in                  in
224                    simplify (body, stms)                    simplify (body, stms)
225                  end                  end
# Line 361  Line 364 
364    
365      fun transform (errStrm, ast) = let      fun transform (errStrm, ast) = let
366            val simple = simplifyProgram ast            val simple = simplifyProgram ast
367            val _ = SimplePP.output (Log.logFile(), simple)       (* DEBUG *)            val _ = SimplePP.output (Log.logFile(), "simplify", simple)   (* DEBUG *)
368              val simple = Inliner.transform simple
369              val _ = SimplePP.output (Log.logFile(), "inlining", simple)   (* DEBUG *)
370  (*  (*
371            val simple = Lift.transform simple            val simple = Lift.transform simple
372                  handle Eval.Error msg => (Error.error(errStrm, msg); simple)                  handle Eval.Error msg => (Error.error(errStrm, msg); simple)

Legend:
Removed from v.2140  
changed lines
  Added in v.2147

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