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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/codegen/collect-info.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/codegen/collect-info.sml

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

revision 3872, Wed May 18 13:08:16 2016 UTC revision 3919, Mon May 30 06:53:48 2016 UTC
# Line 29  Line 29 
29      val collect : TreeIR.program -> t      val collect : TreeIR.program -> t
30    
31      val foldOverTypes : (TreeTypes.t * bool * 'a -> 'a) -> 'a -> t -> 'a      val foldOverTypes : (TreeTypes.t * bool * 'a -> 'a) -> 'a -> t -> 'a
32        val applyToTypes : (TreeTypes.t * bool -> unit) -> t -> unit
33    
34    end = struct    end = struct
35    
36      structure IR = TreeIR      structure IR = TreeIR
37        structure Ty = TreeTypes
38    
39      datatype t = Info of {      datatype t = Info of {
40          tys : bool TreeTypes.Tbl.hash_table     (* mapping for types in program; the bool is true *)          tys : bool TreeTypes.Tbl.hash_table     (* mapping for types in program; the bool is true *)
# Line 82  Line 84 
84                    | IR.E_Op(rator, args) => (                    | IR.E_Op(rator, args) => (
85                        (* TODO: check rator *)                        (* TODO: check rator *)
86                        List.app doExp args)                        List.app doExp args)
87                    | IR.E_Vec(_, es) => List.app doExp es                    | IR.E_Vec(w, pw, es) => (addType(Ty.VecTy(w, pw), false); List.app doExp es)
88                    | IR.E_Cons(es, ty) => (addType(ty, false); List.app doExp es)                    | IR.E_Cons(es, ty) => (addType(ty, false); List.app doExp es)
89                    | IR.E_Seq(es, ty) => (addType(ty, false); List.app doExp es)                    | IR.E_Seq(es, ty) => (addType(ty, false); List.app doExp es)
90                    | IR.E_Pack(_, es) => List.app doExp es                    | IR.E_Pack(_, es) => List.app doExp es
91                    | IR.E_VLoad(_, e, _) => doExp e                    | IR.E_VLoad(layout, e, i) => (addType(Ty.nthVec(layout, i), false); doExp e)
92                    | _ => ()                    | _ => ()
93                  (* end case *))                  (* end case *))
94            fun doStm stm = (case stm            fun doStm stm = (case stm
# Line 127  Line 129 
129    
130      fun foldOverTypes f init (Info{tys}) = TreeTypes.Tbl.foldi f init tys      fun foldOverTypes f init (Info{tys}) = TreeTypes.Tbl.foldi f init tys
131    
132        fun applyToTypes f (Info{tys}) = TreeTypes.Tbl.appi f tys
133    
134    end    end

Legend:
Removed from v.3872  
changed lines
  Added in v.3919

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