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

SCM Repository

[diderot] Diff of /branches/vis12-cl/src/compiler/simplify/simplify.sml
ViewVC logotype

Diff of /branches/vis12-cl/src/compiler/simplify/simplify.sml

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

revision 2513, Thu Nov 21 16:26:45 2013 UTC revision 2514, Thu Nov 21 16:27:12 2013 UTC
# Line 126  Line 126 
126                      (* load the nrrd proxy here *)                      (* load the nrrd proxy here *)
127                        val info = NrrdInfo.getInfo nrrd                        val info = NrrdInfo.getInfo nrrd
128                        val (ty, init) = (case SimpleVar.typeOf x'                        val (ty, init) = (case SimpleVar.typeOf x'
129                               of ty as Ty.T_DynSequence _ => (ty, InP.DynSeq nrrd)                               of ty as SimpleTypes.T_DynSequence _ => (ty, InP.DynSeq nrrd)
130                                | ty as Ty.T_Image{dim, shape} => (ty, inputImage(nrrd, dim, shape))                                | ty as SimpleTypes.T_Image{dim, shape} => (ty, inputImage(nrrd, dim, shape))
131                                | _ => raise Fail "impossible"                                | _ => raise Fail "impossible"
132                              (* end case *))                              (* end case *))
133                        val inp = InP.INP{                        val inp = InP.INP{
# Line 178  Line 178 
178                        setInitially (simplifyInit(env, false, creat, iters));                        setInitially (simplifyInit(env, false, creat, iters));
179                        env)                        env)
180                  (* end case *))                  (* end case *))
181            val env = List.foldl simplifyDecl VMap.empty dcls            val env = List.foldl simplifyDecl VMap.empty decls
182            in            in
183              S.Program{              S.Program{
184                  props = props,                  props = props,
# Line 251  Line 251 
251     * Note that error reporting is done in the typechecker, but it does not prune unreachable     * Note that error reporting is done in the typechecker, but it does not prune unreachable
252     * code.     * code.
253     *)     *)
254      and simplifyStmt (env, env, stm, stms) = (case stm      and simplifyStmt (env, stm, stms) = (case stm
255             of AST.S_Block body => let             of AST.S_Block body => let
256                  fun simplify (_, [], stms) = stms                  fun simplify (_, [], stms) = stms
257                    | simplify (env', stm::r, stms) = let                    | simplify (env', stm::r, stms) = let
# Line 370  Line 370 
370                    (S.S_IfThenElse(x, s1, s2) :: stms, S.E_Var result)                    (S.S_IfThenElse(x, s1, s2) :: stms, S.E_Var result)
371                  end                  end
372              | AST.E_LoadNrrd(_, nrrd, ty) => (case cvtTy ty              | AST.E_LoadNrrd(_, nrrd, ty) => (case cvtTy ty
373                   of ty as SimpleTypes.T_Image{dim, shape} => (                   of ty as SimpleTypes.T_DynSequence _ => (stms, S.E_LoadSeq(ty, nrrd))
374                      | ty as SimpleTypes.T_Image{dim, shape} => (
375                        case ImageInfo.fromNrrd(NrrdInfo.getInfo nrrd, dim, shape)                        case ImageInfo.fromNrrd(NrrdInfo.getInfo nrrd, dim, shape)
376                         of NONE => raise Fail(concat[                         of NONE => raise Fail(concat[
377                                "nrrd file \"", nrrd, "\" does not have expected type"                                "nrrd file \"", nrrd, "\" does not have expected type"

Legend:
Removed from v.2513  
changed lines
  Added in v.2514

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