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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/cfg-ir/ssa-fn.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/cfg-ir/ssa-fn.sml

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

revision 3505, Fri Dec 18 02:47:03 2015 UTC revision 3517, Sat Dec 19 04:39:21 2015 UTC
# Line 12  Line 12 
12    
13  functor SSAFn (  functor SSAFn (
14    
15      val ilName : string      val irName : string
16    
17      structure Ty : SSA_TYPES      structure Ty : SSA_TYPES
18      structure Op : OPERATORS where type ty = Ty.ty      structure Op : OPERATORS where type ty = Ty.ty
# Line 22  Line 22 
22      structure Ty = Ty      structure Ty = Ty
23      structure Op = Op      structure Op = Op
24    
25      val ilName = ilName      val irName = irName
26    
27    (***** CFG *****)    (***** CFG *****)
28    
# Line 137  Line 137 
137          id : Stamp.stamp,               (* variable's unique ID *)          id : Stamp.stamp,               (* variable's unique ID *)
138          name : string,                  (* variable's name *)          name : string,                  (* variable's name *)
139          ty : Ty.ty,                     (* variable's type *)          ty : Ty.ty,                     (* variable's type *)
140          input : bool,                   (* true for input variables *)          kind : global_kind,             (* the variable kind *)
141            useCnt : int ref,               (* count of uses *)
142          props : PropList.holder          props : PropList.holder
143        }        }
144    
145        and global_kind = ConstVar | InputVar | GlobalVar
146    
147    (***** strand state variables *****)    (***** strand state variables *****)
148      and state_var = SV of {      and state_var = SV of {
149          id : Stamp.stamp,               (* variable's unique ID *)          id : Stamp.stamp,               (* variable's unique ID *)
# Line 193  Line 196 
196    
197      structure GlobalVar =      structure GlobalVar =
198        struct        struct
199          fun new (isIn, name, ty) = GV{          fun new (kind, name, ty) = GV{
200                  id = Stamp.new(),                  id = Stamp.new(),
201                  name = name,                  name = name,
202                  ty = ty,                  ty = ty,
203                  input = isIn,                  kind = kind,
204                    useCnt = ref 0,
205                  props = PropList.newHolder()                  props = PropList.newHolder()
206                }                }
207          fun name (GV{name, ...}) = name          fun name (GV{name, ...}) = name
208          fun uniqueName (GV{id, name, ...}) = name ^ Stamp.toString id          fun uniqueName (GV{id, name, ...}) = name ^ Stamp.toString id
209            fun kind (GV{kind, ...}) = kind
210          fun ty (GV{ty, ...}) = ty          fun ty (GV{ty, ...}) = ty
211          fun isInput (GV{input, ...}) = input          fun isInput (GV{kind=InputVar, ...}) = true
212              | isInput _ = false
213            fun useCount (GV{useCnt, ...}) = !useCnt
214          fun same (GV{id=a, ...}, GV{id=b, ...}) = Stamp.same(a, b)          fun same (GV{id=a, ...}, GV{id=b, ...}) = Stamp.same(a, b)
215          fun compare (GV{id=a, ...}, GV{id=b, ...}) = Stamp.compare(a, b)          fun compare (GV{id=a, ...}, GV{id=b, ...}) = Stamp.compare(a, b)
216          fun hash (GV{id, ...}) = Stamp.hash id          fun hash (GV{id, ...}) = Stamp.hash id

Legend:
Removed from v.3505  
changed lines
  Added in v.3517

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