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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/cxx-util/tree-to-cxx.sml
ViewVC logotype

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

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

revision 3894, Sun May 22 14:51:27 2016 UTC revision 3896, Sun May 22 18:24:49 2016 UTC
# Line 13  Line 13 
13    
14      val trType : CodeGenEnv.t * TreeTypes.t -> CLang.ty      val trType : CodeGenEnv.t * TreeTypes.t -> CLang.ty
15    
16        val trAPIType : CodeGenEnv.t * APITypes.t -> CLang.ty
17    
18      val trBlock : CodeGenEnv.t * TreeIR.block -> CLang.stm      val trBlock : CodeGenEnv.t * TreeIR.block -> CLang.stm
19    
20      val trExp : CodeGenEnv.t * TreeIR.exp -> CLang.exp      val trExp : CodeGenEnv.t * TreeIR.exp -> CLang.exp
# Line 50  Line 52 
52              | (Ty.StrandTy name) => CL.T_Named("strand_" ^ Atom.toString name)              | (Ty.StrandTy name) => CL.T_Named("strand_" ^ Atom.toString name)
53            (* end case *))            (* end case *))
54    
55        fun trAPIType (env, ty) = (case ty
56               of APITypes.IntTy => Env.intTy env
57                | APITypes.BoolTy => Env.boolTy env
58                | APITypes.TensorTy[] => Env.realTy env
59                | APITypes.TensorTy dd => CL.T_Array(Env.realTy env, SOME(List.foldl Int.* 1 dd))
60                | APITypes.StringTy => CL.charPtr (* const?? *)
61                | APITypes.ImageTy(dim, _) => CL.T_Ptr(CL.T_Named "nrrd")
62                | APITypes.SeqTy(ty, NONE) => CL.T_Ptr(CL.T_Named "nrrd")
63                | APITypes.SeqTy(ty, SOME n) => CL.T_Array(trAPIType(env, ty), SOME n)
64              (* end case *))
65    
66    (* translate a local variable that occurs in an l-value context *)    (* translate a local variable that occurs in an l-value context *)
67      fun lvalueVar (env, x) = CL.mkVar(Env.lookup(env, x))      fun lvalueVar (env, x) = CL.mkVar(Env.lookup(env, x))
68    (* translate a variable that occurs in an r-value context *)    (* translate a variable that occurs in an r-value context *)

Legend:
Removed from v.3894  
changed lines
  Added in v.3896

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