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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/low-to-tree/env.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/low-to-tree/env.sml

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

revision 4317, Sat Jul 30 14:12:14 2016 UTC revision 4380, Mon Aug 8 17:05:58 2016 UTC
# Line 23  Line 23 
23    (* create a new environment *)    (* create a new environment *)
24      val new : TreeIR.target_info -> t      val new : TreeIR.target_info -> t
25    
26      (* create a new environment that includes function definitions for map-reduce statments *)
27        val newWithFuncs : TreeIR.target_info * LowIR.func_def list -> t
28    
29    (* return the layout of a Low IR vector of a given width as a Tree IR composite vector *)    (* return the layout of a Low IR vector of a given width as a Tree IR composite vector *)
30      val layoutVec : t -> int -> TreeTypes.vec_layout      val layoutVec : t -> int -> TreeTypes.vec_layout
31    
# Line 46  Line 49 
49     *)     *)
50      val flushPending : t * TreeIR.stm list -> TreeIR.stm list      val flushPending : t * TreeIR.stm list -> TreeIR.stm list
51    
52      (* lookup a function definition *)
53        val lookupFunc : t * LowIR.func -> LowIR.func_def
54    
55    end = struct    end = struct
56    
57      structure VT = LowIR.Var.Tbl      structure VT = LowIR.Var.Tbl
# Line 64  Line 70 
70    
71      datatype t = E of {      datatype t = E of {
72          tbl : (bool * binding) VT.hash_table,          tbl : (bool * binding) VT.hash_table,
73          info : TreeIR.target_info          info : TreeIR.target_info,
74            funcs : LowIR.func_def list
75        }        }
76    
77      fun decCount (LowIR.V{useCnt, ...}) = let      fun decCount (LowIR.V{useCnt, ...}) = let
# Line 75  Line 82 
82    
83      fun new info = E{      fun new info = E{
84              tbl = VT.mkTable (256, Fail "tbl"),              tbl = VT.mkTable (256, Fail "tbl"),
85              info = info              info = info,
86                funcs = []
87              }
88    
89        fun newWithFuncs (info, fdefs) = E{
90                tbl = VT.mkTable (256, Fail "tbl"),
91                info = info,
92                funcs = List.filter (fn (LowIR.Func{name, ...}) => Flatten.isMapFunc name) fdefs
93            }            }
94    
95      fun layoutVec (E{info={layout, ...}, ...}) wid = layout wid      fun layoutVec (E{info={layout, ...}, ...}) wid = layout wid
# Line 132  Line 146 
146              stms              stms
147            end            end
148    
149        fun lookupFunc (E{funcs, ...}, f) = (
150              case List.find (fn (LowIR.Func{name, ...}) => LowIR.Func.same(f, name)) funcs
151               of SOME fdef => fdef
152                | NONE => raise Fail(concat["lookupFunc(", LowIR.Func.toString f, ")"])
153              (* end case *))
154    
155    end    end

Legend:
Removed from v.4317  
changed lines
  Added in v.4380

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