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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/mid-to-low/mk-low-ir.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/mid-to-low/mk-low-ir.sml

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

revision 3653, Tue Feb 2 22:50:44 2016 UTC revision 3660, Thu Feb 4 20:33:08 2016 UTC
# Line 43  Line 43 
43    (* an environment that maps De Bruijn indices to their iteration-index value *)    (* an environment that maps De Bruijn indices to their iteration-index value *)
44      type index_env = int IMap.map      type index_env = int IMap.map
45    
46      fun mk (avail, name, ty, rhs) = let      val add = AvailRHS.addAssign
           val lhs = V.new (name, ty)  
           in  
             AvailRHS.addAssign avail (lhs, rhs)  
           end  
47    
48      fun intLit (avail, n) = mk (avail, "intLit", Ty.intTy, IR.LIT(Literal.Int n))      fun intLit (avail, n) = add (avail, "intLit", Ty.intTy, IR.LIT(Literal.Int n))
49      fun realLit (avail, r) = mk (avail, "realLit", Ty.realTy, IR.LIT(Literal.Real r))      fun realLit (avail, r) = add (avail, "realLit", Ty.realTy, IR.LIT(Literal.Real r))
50      fun intToRealLit (avail, n) = realLit (avail, RealLit.fromInt(IntInf.fromInt n))      fun intToRealLit (avail, n) = realLit (avail, RealLit.fromInt(IntInf.fromInt n))
51      fun cons (avail, shp, args) = mk (avail, "tensor", Ty.TensorTy shp, IR.CONS(args, Ty.TensorTy shp))      fun cons (avail, shp, args) = add (avail, "tensor", Ty.TensorTy shp, IR.CONS(args, Ty.TensorTy shp))
52    
53      local      local
54        fun lookupMu (mapp, E.V id) = (case IMap.find (mapp, id)        fun lookupMu (mapp, E.V id) = (case IMap.find (mapp, id)

Legend:
Removed from v.3653  
changed lines
  Added in v.3660

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