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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/tree-il/low-to-tree-fn.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/tree-il/low-to-tree-fn.sml

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

revision 2022, Wed Oct 10 11:55:39 2012 UTC revision 2023, Wed Oct 10 12:27:13 2012 UTC
# Line 235  Line 235 
235              (* end case *)              (* end case *)
236            end            end
237    
238      (* translate input-variable initialization to a TreeIL expression *)
239        fun trInitialization (InP.String s) = ([], T.E_Lit(Literal.String s))
240          | trInitialization (InP.Int n) = ([], T.E_Lit(Literal.Int n))
241          | trInitialization (InP.Real f) = ([], T.E_Lit(Literal.Float f))
242          | trInitialization (InP.Bool b) = ([], T.E_Lit(Literal.Bool b))
243          | trInitialization (InP.Tensor(shp, vs)) = raise Fail "trInitialization: Tensor"
244          | trInitialization (InP.Seq vs) = raise Fail "trInitialization: Seq"
245          | trInitialization _ = raise Fail "trInitialization: impossible"
246    
247    (* translate a LowIL assignment to a list of zero or more target statements *)    (* translate a LowIL assignment to a list of zero or more target statements *)
248      fun doAssign (env, (lhs, rhs)) = let      fun doAssign (env, (lhs, rhs)) = let
249            fun doLHS () = (case peekGlobal(env, lhs)            fun doLHS () = (case peekGlobal(env, lhs)
# Line 264  Line 273 
273                      (env, [T.S_LoadImage(t, ImageInfo.dim info, useVar env a)])                      (env, [T.S_LoadImage(t, ImageInfo.dim info, useVar env a)])
274                    end                    end
275  *)  *)
276                  | IL.OP(Op.Input(InP.INP{ty=Ty.DynSeqTy _, name, desc, init}), []) => let
277                      val (env, t) = doLHS()
278                      in
279                        case init
280                         of NONE => (env, [T.S_InputNrrd(t, name, desc, NONE)])
281                          | SOME(InP.DynSeq nrrd) => (env, [T.S_InputNrrd(t, name, desc, SOME nrrd)])
282                          | _ => raise Fail "bogus initialization for dynamic sequence"
283                        (* end case *)
284                      end
285                  | IL.OP(Op.Input(InP.INP{ty=Ty.ImageTy _, name, desc, init}), []) => let
286                      val (env, t) = doLHS()
287                      in
288                        case init
289                         of SOME(InP.Proxy(nrrd, _)) => (env, [T.S_InputNrrd(t, name, desc, SOME nrrd)])
290                          | SOME(InP.Image _) => (env, [T.S_InputNrrd(t, name, desc, NONE)])
291                          | _ => raise Fail "bogus initialization for image"
292                        (* end case *)
293                      end
294                | IL.OP(Op.Input(InP.INP{ty, name, desc, init=NONE}), []) => let                | IL.OP(Op.Input(InP.INP{ty, name, desc, init=NONE}), []) => let
295                    val (env, t) = doLHS()                    val (env, t) = doLHS()
296                    in                    in
297                      (env, [T.S_Input(t, name, desc, NONE)])                      (env, [T.S_Input(t, name, desc, NONE)])
298                    end                    end
299                | IL.OP(Op.Input(InP.INP{ty, name, desc, init=SOME init}), []) => raise Fail "FIXME"                | IL.OP(Op.Input(InP.INP{ty, name, desc, init=SOME init}), []) => let
300                      val (env, t) = doLHS()
301                      val (stms, exp) = trInitialization init
302                      in
303                        (env, stms@[T.S_Input(t, name, desc, SOME exp)])
304                      end
305  (*  (*
306                | IL.OP(Op.InputWithDefault(ty, name, desc), [a]) => let                | IL.OP(Op.InputWithDefault(ty, name, desc), [a]) => let
307                    val (env, t) = doLHS()                    val (env, t) = doLHS()

Legend:
Removed from v.2022  
changed lines
  Added in v.2023

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