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 2147, Sun Feb 17 17:30:09 2013 UTC revision 2154, Mon Feb 18 16:54:22 2013 UTC
# Line 68  Line 68 
68    
69    (* is the given statement's continuation the syntactically following statement? *)    (* is the given statement's continuation the syntactically following statement? *)
70      fun contIsNext (AST.S_Block stms) = List.all contIsNext stms      fun contIsNext (AST.S_Block stms) = List.all contIsNext stms
71          | contIsNext (AST.IfThenElse(_, s1, s2)) = contIsNext s1 orelse contIsNext s2
72        | contIsNext AST.S_Die = false        | contIsNext AST.S_Die = false
73        | contIsNext AST.S_Stabilize = false        | contIsNext AST.S_Stabilize = false
74        | contIsNext (AST.S_Return _) = false        | contIsNext (AST.S_Return _) = false
# Line 212  Line 213 
213    
214    (* simplify the statement stm where stms is a reverse-order list of preceeding simplified    (* simplify the statement stm where stms is a reverse-order list of preceeding simplified
215     * statements.  This function returns a reverse-order list of simplified statements.     * statements.  This function returns a reverse-order list of simplified statements.
216       * Note that error reporting is done in the typechecker, but it does not prune unreachable
217       * code.
218     *)     *)
219      and simplifyStmt (stm, stms) = (case stm      and simplifyStmt (stm, stms) = (case stm
220             of AST.S_Block body => let             of AST.S_Block body => let
 (* FIXME: we should probably prune unreachable code in the typechecker and issue a warning! *)  
221                  fun simplify ([], stms) = stms                  fun simplify ([], stms) = stms
222                    | simplify (stm::r, stms) = if contIsNext stm                    | simplify (stm::r, stms) = if contIsNext stm
223                        then simplify (r, simplifyStmt (stm, stms))                        then simplify (r, simplifyStmt (stm, stms))

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

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