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 197, Mon Aug 2 20:51:47 2010 UTC revision 221, Tue Aug 3 20:13:55 2010 UTC
# Line 30  Line 30 
30            val actors = ref []            val actors = ref []
31            fun simplifyDecl dcl = (case dcl            fun simplifyDecl dcl = (case dcl
32                   of AST.D_Input(x, NONE) => let                   of AST.D_Input(x, NONE) => let
33                        val t = newTemp Ty.T_String                        val e' = S.E_Input(Var.nameOf x, NONE)
                       val stm = S.S_Assign(t, S.E_Lit(Literal.String(Var.nameOf x)))  
                       val ty = Var.monoTypeOf x  
                       val e' = S.E_Apply(BasisVars.input,  
                               [Ty.TYPE(MetaVar.newFromType ty)], [t], ty)  
34                        in                        in
35                          globals := x :: !globals;                          globals := x :: !globals;
36                          globalInit := S.S_Assign(x, e') :: stm :: !globalInit                          globalInit := S.S_Assign(x, e') :: !globalInit
37                        end                        end
38                    | AST.D_Input(x, SOME e) => let                    | AST.D_Input(x, SOME e) => let
39                        val (stms, x') = simplifyExpToVar (e, [])                        val (stms, x') = simplifyExpToVar (e, [])
40                        val t = newTemp Ty.T_String                        val e' = S.E_Input(Var.nameOf x, SOME x')
                       val stm = S.S_Assign(t, S.E_Lit(Literal.String(Var.nameOf x)))  
                       val ty = Var.monoTypeOf x  
                       val e' = S.E_Apply(BasisVars.optInput,  
                               [Ty.TYPE(MetaVar.newFromType ty)], [t, x'], ty)  
41                        in                        in
42                          globals := x :: !globals;                          globals := x :: !globals;
43                          globalInit := S.S_Assign(x, e') :: stm :: (stms @ !globalInit)                          globalInit := S.S_Assign(x, e') :: (stms @ !globalInit)
44                        end                        end
45                    | AST.D_Var(AST.VD_Decl(x, e)) => let                    | AST.D_Var(AST.VD_Decl(x, e)) => let
46                        val (stms, e') = simplifyExp (e, [])                        val (stms, e') = simplifyExp (e, [])

Legend:
Removed from v.197  
changed lines
  Added in v.221

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