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-vars.sml
ViewVC logotype

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

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

revision 3468, Mon Nov 30 16:26:17 2015 UTC revision 3501, Thu Dec 17 20:07:13 2015 UTC
# Line 42  Line 42 
42    
43    (* analyze a method for uses of parameters *)    (* analyze a method for uses of parameters *)
44      fun analyzeMethod blk = let      fun analyzeMethod blk = let
45            fun analyzeBlk (S.Block stms) = List.app analyzeStm stms            fun analyzeBlk (S.Block{code, ...}) = List.app analyzeStm code
46            and analyzeStm stm = (case stm            and analyzeStm stm = (case stm
47                   of S.S_Var(x, NONE) => ()                   of S.S_Var(x, NONE) => ()
48                    | S.S_Var(x, SOME e) => analyzeExp e                    | S.S_Var(x, SOME e) => analyzeExp e
# Line 85  Line 85 
85                    | NONE => x                    | NONE => x
86                  (* end case *))                  (* end case *))
87            val renameList = List.map rename            val renameList = List.map rename
88            fun renameBlk (S.Block stms) = S.Block(List.map renameStm stms)            fun renameBlk (S.Block{props, code}) = S.Block{props = props, code = List.map renameStm code}
89            and renameStm stm = (case stm            and renameStm stm = (case stm
90                   of S.S_Var(x, NONE) => stm                   of S.S_Var(x, NONE) => stm
91                    | S.S_Var(x, SOME e) => S.S_Var(x, SOME(renameExp e))                    | S.S_Var(x, SOME e) => S.S_Var(x, SOME(renameExp e))
# Line 159  Line 159 
159                          name = name, params = params,                          name = name, params = params,
160                          state = state @ shadowParams,                          state = state @ shadowParams,
161                          stateInit = let                          stateInit = let
162                            val S.Block stms = stateInit                            val S.Block{props, code} = stateInit
163                            in                            in
164                              S.Block(stms @ initStms)                              S.Block{props = props, code = code @ initStms}
165                            end,                            end,
166                          initM = Option.map rename initM,                          initM = Option.map rename initM,
167                          updateM = rename updateM,                          updateM = rename updateM,

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

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