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

SCM Repository

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

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

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

revision 3500, Wed Dec 16 15:01:40 2015 UTC revision 3501, Thu Dec 17 20:07:13 2015 UTC
# Line 71  Line 71 
71      fun cvtVars xs = List.map cvtVar xs      fun cvtVars xs = List.map cvtVar xs
72    
73    (* make a block out of a list of statements that are in reverse order *)    (* make a block out of a list of statements that are in reverse order *)
74      fun mkBlock stms = S.Block(List.rev stms)      fun mkBlock stms = S.Block{props = PropList.newHolder(), code = List.rev stms}
75    
76      fun inputImage (errStrm, nrrd, dim, shape) = (      fun inputImage (errStrm, nrrd, dim, shape) = (
77            case ImageInfo.fromNrrd(NrrdInfo.getInfo(errStrm, nrrd), dim, shape)            case ImageInfo.fromNrrd(NrrdInfo.getInfo(errStrm, nrrd), dim, shape)
# Line 86  Line 86 
86        | CONT                    (* stm sequence falls through *)        | CONT                    (* stm sequence falls through *)
87        | EDIT of 'a              (* pruned code that has non-exiting paths *)        | EDIT of 'a              (* pruned code that has non-exiting paths *)
88    
89      fun pruneUnreachableCode (blk as S.Block stms) = let      fun pruneUnreachableCode blk = let
90            fun isExit S.S_Die = true            fun isExit S.S_Die = true
91              | isExit S.S_Stabilize = true              | isExit S.S_Stabilize = true
92              | isExit (S.S_Return _) = true              | isExit (S.S_Return _) = true
# Line 141  Line 141 
141                    | (PRUNE blk1, EXIT      ) => PRUNE(S.S_IfThenElse(x, blk1, blk2))                    | (PRUNE blk1, EXIT      ) => PRUNE(S.S_IfThenElse(x, blk1, blk2))
142                    | (PRUNE blk1, PRUNE blk2) => PRUNE(S.S_IfThenElse(x, blk1, blk2))                    | (PRUNE blk1, PRUNE blk2) => PRUNE(S.S_IfThenElse(x, blk1, blk2))
143                  (* end case *))                  (* end case *))
144            and pruneBlk (S.Block stms) = (case pruneStms stms            and pruneBlk (S.Block{props, code}) = (case pruneStms code
145                   of PRUNE stms => PRUNE(S.Block stms)                   of PRUNE stms => PRUNE(S.Block{props=props, code=stms})
146                    | EDIT stms => EDIT(S.Block stms)                    | EDIT stms => EDIT(S.Block{props=props, code=stms})
147                    | EXIT => EXIT (* different instances of ctl_flow_info *)                    | EXIT => EXIT (* different instances of ctl_flow_info *)
148                    | CONT => CONT                    | CONT => CONT
149                  (* end case *))                  (* end case *))

Legend:
Removed from v.3500  
changed lines
  Added in v.3501

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