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/util.sml
ViewVC logotype

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

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

revision 4090, Wed Jun 29 01:13:18 2016 UTC revision 4091, Wed Jun 29 02:44:36 2016 UTC
# Line 25  Line 25 
25    (* create new tree IL variables *)    (* create new tree IL variables *)
26      val newParamVar : LowIR.var -> TreeVar.t      val newParamVar : LowIR.var -> TreeVar.t
27      val newLocalVar : LowIR.var -> TreeVar.t      val newLocalVar : LowIR.var -> TreeVar.t
28        val newMemVar   : LowIR.var -> TreeVar.t  (* non-reference local variable *)
29      val newIterVar : LowIR.var -> TreeVar.t      val newIterVar : LowIR.var -> TreeVar.t
30      val newTempVar : string * TreeTypes.t -> TreeVar.t      val newTempVar : string * TreeTypes.t -> TreeVar.t
31    
# Line 61  Line 62 
62    
63      local      local
64        val cnt = ref 0        val cnt = ref 0
65        fun newVar prefix x = let        fun newVar trTy prefix x = let
66              val n = !cnt              val n = !cnt
67              in              in
68                cnt := n+1;                cnt := n+1;
69                TreeVar.new (                TreeVar.new (
70                  String.concat[prefix, LowIR.Var.name x, "_", Int.toString n],                  String.concat[prefix, LowIR.Var.name x, "_", Int.toString n],
71                  trTempType (LowIR.Var.ty x))                  trTy (LowIR.Var.ty x))
72              end              end
73      in      in
74    
75      val newParamVar = newVar "p_"      val newParamVar = newVar trTempType "p_"
76      val newLocalVar = newVar "l_"      val newLocalVar = newVar trTempType "l_"
77      val newIterVar = newVar "i_"      val newIterVar = newVar trTempType "i_"
78        val newMemVar = newVar trType "l_"
79    
80      fun newTempVar (prefix, ty) = let      fun newTempVar (prefix, ty) = let
81            val n = !cnt            val n = !cnt

Legend:
Removed from v.4090  
changed lines
  Added in v.4091

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