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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/codegen/low-to-tree.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/codegen/low-to-tree.sml

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

revision 532, Mon Feb 14 20:26:41 2011 UTC revision 533, Mon Feb 14 22:56:45 2011 UTC
# Line 148  Line 148 
148      fun doAssign (env, (lhs, rhs)) = (case rhs      fun doAssign (env, (lhs, rhs)) = (case rhs
149             of IL.VAR x => setDef (env, lhs, useVar env x)             of IL.VAR x => setDef (env, lhs, useVar env x)
150              | IL.LIT lit => setDef (env, lhs, T.E_Lit lit)              | IL.LIT lit => setDef (env, lhs, T.E_Lit lit)
151                | IL.OP(Op.LoadImage info, [a]) => let
152                    val t = newLocal lhs
153                    in
154                      (rename(env, lhs, t), [T.S_LoadImage(t, ImageInfo.dim info, useVar env a)])
155                    end
156                | IL.OP(Op.Input(ty, name), []) => let
157                    val t = newLocal lhs
158                    in
159                      (rename(env, lhs, t), [T.S_Input(t, name, NONE)])
160                    end
161                | IL.OP(Op.InputWithDefault(ty, name), [a]) => let
162                    val t = newLocal lhs
163                    in
164                      (rename(env, lhs, t), [T.S_Input(t, name, SOME(useVar env a))])
165                    end
166              | IL.OP(rator, args) =>              | IL.OP(rator, args) =>
167                  bind (env, lhs, T.E_Op(rator, List.map (useVar env) args))                  bind (env, lhs, T.E_Op(rator, List.map (useVar env) args))
168              | IL.CONS args => let              | IL.CONS args => let
169                (* we give cons expressions names, since not all targets support them inline *)                (* we give cons expressions names, since not all targets support them inline *)
170                  val t = newLocal lhs                  val t = newLocal lhs
171                  val rhs = T.E_Cons(List.map (useVar env) args)                  val rhs = List.map (useVar env) args
172                  in                  in
173                    (rename(env, lhs, t), [T.S_Assign(t, rhs)])                    (rename(env, lhs, t), [T.S_Cons(t, rhs)])
174                  end                  end
175            (* end case *))            (* end case *))
176    

Legend:
Removed from v.532  
changed lines
  Added in v.533

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