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 2134, Mon Feb 11 12:32:58 2013 UTC revision 2135, Mon Feb 11 12:33:24 2013 UTC
# Line 70  Line 70 
70            val inputs = ref []            val inputs = ref []
71            val globals = ref []            val globals = ref []
72            val globalInit = ref []            val globalInit = ref []
73              val funcs = ref []
74            val initially = ref NONE            val initially = ref NONE
75            val strands = ref []            val strands = ref []
76            fun setInitially init = (case !initially            fun setInitially init = (case !initially
# Line 130  Line 131 
131                          globals := x :: !globals;                          globals := x :: !globals;
132                          globalInit := S.S_Assign(x, e') :: (stms @ !globalInit)                          globalInit := S.S_Assign(x, e') :: (stms @ !globalInit)
133                        end                        end
134                      | AST.D_Func(f, params, body) =>
135                          funcs := S.Func{f=f, params=params, body=simplifyBlock body} :: !funcs
136                    | AST.D_Strand info => strands := simplifyStrand info :: !strands                    | AST.D_Strand info => strands := simplifyStrand info :: !strands
137                    | AST.D_InitialArray(creat, iters) =>                    | AST.D_InitialArray(creat, iters) =>
138                        setInitially (simplifyInit(true, creat, iters))                        setInitially (simplifyInit(true, creat, iters))
# Line 142  Line 145 
145                  inputs = List.rev(!inputs),                  inputs = List.rev(!inputs),
146                  globals = List.rev(!globals),                  globals = List.rev(!globals),
147                  globalInit = mkBlock (!globalInit),                  globalInit = mkBlock (!globalInit),
148                    funcs = List.rev(!funcs),
149                  init = (case !initially                  init = (case !initially
150  (* FIXME: the check for the initially block should really happen in typechecking *)  (* FIXME: the check for the initially block should really happen in typechecking *)
151                     of NONE => raise Fail "missing initially declaration"                     of NONE => raise Fail "missing initially declaration"
# Line 230  Line 234 
234                  end                  end
235              | AST.S_Die => S.S_Die :: stms              | AST.S_Die => S.S_Die :: stms
236              | AST.S_Stabilize => S.S_Stabilize :: stms              | AST.S_Stabilize => S.S_Stabilize :: stms
237                | AST.S_Return e => let
238                    val (stms, x) = simplifyExpToVar (e, stms)
239                    in
240                      S.S_Return x :: stms
241                    end
242              | AST.S_Print args => let              | AST.S_Print args => let
243                  val (stms, xs) = simplifyExpsToVars (args, stms)                  val (stms, xs) = simplifyExpsToVars (args, stms)
244                  in                  in

Legend:
Removed from v.2134  
changed lines
  Added in v.2135

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