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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/tree-il/low-to-tree-fn.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/tree-il/low-to-tree-fn.sml

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

revision 2631, Fri May 23 18:13:12 2014 UTC revision 2632, Fri May 23 18:57:58 2014 UTC
# Line 42  Line 42 
42    
43          structure gT=getTypes          structure gT=getTypes
44          structure TreetoCFN=TreetoCFN          structure TreetoCFN=TreetoCFN
45    
46    (* create new tree IL variables *)    (* create new tree IL variables *)
47      local      local
48        val newVar = T.Var.new        val newVar = T.Var.new
# Line 59  Line 60 
60          | _ =>1          | _ =>1
61      (*end case*))      (*end case*))
62    
   
63      fun newGlobal x=newVar (genName("G_" ^ V.name x), T.VK_Global, V.ty x)      fun newGlobal x=newVar (genName("G_" ^ V.name x), T.VK_Global, V.ty x)
64      fun newParam x = newVar (genName("p_" ^ V.name x), T.VK_Local, V.ty x)      fun newParam x = newVar (genName("p_" ^ V.name x), T.VK_Local, V.ty x)
65      fun newLocal x = newVar (genName("l_" ^ V.name x), T.VK_Local, V.ty x)      fun newLocal x = newVar (genName("l_" ^ V.name x), T.VK_Local, V.ty x)
# Line 99  Line 99 
99          | DEF of T.exp          (* either a target variable or constant for a defined variable *)          | DEF of T.exp          (* either a target variable or constant for a defined variable *)
100        datatype env = E of {        datatype env = E of {
101            tbl : target_binding VT.hash_table,            tbl : target_binding VT.hash_table,
102    (*
103              types : ??,
104              functs : ??,
105    *)
106            locals : T.var list            locals : T.var list
107          }          }
108      in      in
# Line 602  Line 606 
606                  (fn x => let val x' = newGlobal x in global(env, x, x'); x' end)                  (fn x => let val x' = newGlobal x in global(env, x, x'); x' end)
607                    (IL.CFG.liveAtExit globalInit)                    (IL.CFG.liveAtExit globalInit)
608            val {inputInit, globalInit} = splitGlobalInit globalInit            val {inputInit, globalInit} = splitGlobalInit globalInit
609              val inputInit = trCFG (env, [], fn _ => [], inputInit)
610              val globalInit = trCFG (env, [], fn _ => [], globalInit)
611            val strands = List.map (trStrand env) strands            val strands = List.map (trStrand env) strands
612              val HH = T.Program{
           val HH=  
             T.Program{  
613                  props = props,                  props = props,
614    (*
615                      types : typesOfEnv env,
616                      oprations : opersOfEnv env,
617    *)
618                  globals = globals,                  globals = globals,
619                  inputInit = trCFG (env, [], fn _ => [], inputInit),                    inputInit = inputInit,
620                  globalInit = trCFG (env, [], fn _ => [], globalInit),                    globalInit = globalInit,
621                  strands = strands,                  strands = strands,
622                  initially = trInitially (env, initially)                  initially = trInitially (env, initially)
623                }                }
624                  in (print "\n \t ---------------- Target Code --------------\n";HH)            in
625                print "\n \t ---------------- Target Code --------------\n";
626                HH
627            end            end
628    
629    end    end

Legend:
Removed from v.2631  
changed lines
  Added in v.2632

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