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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/simplify/lift.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/simplify/lift.sml

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

revision 612, Sat Mar 12 17:56:24 2011 UTC revision 613, Sat Mar 12 19:29:23 2011 UTC
# Line 121  Line 121 
121              S.Block(doBlock blk)              S.Block(doBlock blk)
122            end            end
123    
124        fun reduceInit (env, init) = let
125              fun reduceCreate (S.C_Create{argInit, name, args}) = S.C_Create{
126                      argInit = reduce (env, argInit),
127                      name = name, args = args
128                    }
129              fun reduceIter (S.I_Range{rangeInit, param, lo, hi}) = S.I_Range{
130                      rangeInit = reduce (env, rangeInit),
131                      param = param, lo = lo, hi = hi
132                    }
133              in
134                case init
135                 of S.InitialArray(creat, iters) =>
136                      S.InitialArray(reduceCreate creat, List.map reduceIter iters)
137                  | S.InitialCollection(creat, iters) =>
138                      S.InitialCollection(reduceCreate creat, List.map reduceIter iters)
139                (* end case *)
140              end
141    
142      fun transform (prog as S.Program{globals, globalInit, init, strands}) = let      fun transform (prog as S.Program{globals, globalInit, init, strands}) = let
143            val statics = findStatics globalInit            val statics = findStatics globalInit
144            val staticEnv = Eval.evalStatics (statics, globalInit)            val staticEnv = Eval.evalStatics (statics, globalInit)
145            val globalInit = reduce (staticEnv, globalInit)            val globalInit = reduce (staticEnv, globalInit)
146  (* FIXME: reduce init *)            val init = reduceInit (staticEnv, init)
147            in            in
148              S.Program{              S.Program{
149                  globals = globals,                  globals = globals,

Legend:
Removed from v.612  
changed lines
  Added in v.613

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