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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/c-target/c-target.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/c-target/c-target.sml

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

revision 3196, Fri May 29 18:42:37 2015 UTC revision 3197, Tue Jun 2 17:11:42 2015 UTC
# Line 19  Line 19 
19      structure TrVar =      structure TrVar =
20        struct        struct
21          type env = CL.typed_var TreeIL.Var.Map.map          type env = CL.typed_var TreeIL.Var.Map.map
22          fun lookup (env, x) = (case V.Map.find (env, x)          fun lookup (env, x) = ( "-lookup ";case V.Map.find (env, x)
23                 of SOME(CL.V(_, x')) => x'                 of SOME(CL.V(_, x')) => x'
24                  | NONE => raise Fail(concat["lookup(_, ", V.name x, ")"])                  | NONE => raise Fail(concat["lookup(_, ", V.name x, ")"])
25                (* end case *))                (* end case *))
26        (* translate a variable that occurs in an l-value context (i.e., as the target of an assignment) *)        (* translate a variable that occurs in an l-value context (i.e., as the target of an assignment) *)
27          fun lvalueVar (env, x) = (case V.kind x  fun lvalueVar (env, x) = ("\n\tlvalueVar ";case V.kind x
28                 of IL.VK_Global => CL.mkVar(lookup(env, x))                 of IL.VK_Global => CL.mkVar(lookup(env, x))
29                  | IL.VK_Local =>                  | IL.VK_Local => CL.mkVar(lookup(env, x))
   
                         CL.mkVar(lookup(env, x))  
30    
31                (* end case *))                (* end case *))
32        (* translate a variable that occurs in an r-value context *)        (* translate a variable that occurs in an r-value context *)
33          fun rvalueVar (env, x) = (case V.kind x  fun rvalueVar (env, x) = ( "\n\trvalueVar ";case V.kind x
34                 of IL.VK_Global => CL.mkVar(lookup(env, x))                 of IL.VK_Global => ( "-global ";CL.mkVar(lookup(env, x)))
35                  | IL.VK_Local => CL.mkVar(lookup(env, x))                  | IL.VK_Local => ( "-local ";CL.mkVar(lookup(env, x)))
36                (* end case *))                (* end case *))
37        (* translate a strand state variable that occurs in an l-value context *)        (* translate a strand state variable that occurs in an l-value context *)
38          fun lvalueStateVar x = CL.mkIndirect(CL.mkVar "selfOut", IL.StateVar.name x)          fun lvalueStateVar x = CL.mkIndirect(CL.mkVar "selfOut", IL.StateVar.name x)

Legend:
Removed from v.3196  
changed lines
  Added in v.3197

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