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

SCM Repository

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

Diff of /branches/vis15/src/compiler/codegen/codegen-env.sml

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

revision 3926, Sat Jun 4 05:01:29 2016 UTC revision 3927, Sat Jun 4 21:20:01 2016 UTC
# Line 30  Line 30 
30      val global : t -> CLang.var      val global : t -> CLang.var
31      val selfIn : t -> CLang.var      val selfIn : t -> CLang.var
32      val selfOut : t -> CLang.var      val selfOut : t -> CLang.var
33        val world : t -> CLang.var
34    
35    (* get CLang versions of standard Diderot types *)    (* get CLang versions of standard Diderot types *)
36      val realTy  : t -> CLang.ty      val realTy  : t -> CLang.ty
37      val intTy   : t -> CLang.ty      val intTy   : t -> CLang.ty
38      val boolTy  : t -> CLang.ty      val boolTy  : t -> CLang.ty
39        val rawRealTy : t -> RawTypes.t
40    
41    (* CLang versions of templated runtime types *)    (* CLang versions of templated runtime types *)
42      val optionsTy : t -> CLang.ty      val optionsTy : t -> CLang.ty
# Line 54  Line 56 
56              vmap = List.foldl VMap.insert' VMap.empty [              vmap = List.foldl VMap.insert' VMap.empty [
57                  (PseudoVars.global, global),                  (PseudoVars.global, global),
58                  (PseudoVars.selfIn, selfIn),                  (PseudoVars.selfIn, selfIn),
59                  (PseudoVars.selfOut, selfOut)                  (PseudoVars.selfOut, selfOut),
60                    (PseudoVars.world, "wrld")
61                ],                ],
62              spec = spec              spec = spec
63            }            }
# Line 76  Line 79 
79      fun global env = lookup(env, PseudoVars.global)      fun global env = lookup(env, PseudoVars.global)
80      fun selfIn env = lookup(env, PseudoVars.selfIn)      fun selfIn env = lookup(env, PseudoVars.selfIn)
81      fun selfOut env = lookup(env, PseudoVars.selfOut)      fun selfOut env = lookup(env, PseudoVars.selfOut)
82        fun world env = lookup(env, PseudoVars.world)
83    
84      fun realTy (Env{spec, ...}) = if (#double spec) then CL.double else CL.float      fun realTy (Env{spec, ...}) = if (#double spec) then CL.double else CL.float
85      fun intTy (Env{spec, ...}) = if (#longint spec) then CL.int64 else CL.int32      fun intTy (Env{spec, ...}) = if (#longint spec) then CL.int64 else CL.int32
86  (* FIXME: to support versions of C without <stdbool>, we will need to map bool to int *)  (* FIXME: to support versions of C without <stdbool>, we will need to map bool to int *)
87      fun boolTy (Env{spec, ...}) = CL.boolTy      fun boolTy (Env{spec, ...}) = CL.boolTy
88        fun rawRealTy (Env{spec, ...}) = if (#double spec)
89              then RawTypes.RT_Double
90              else RawTypes.RT_Float
91    
92      fun optionsTy env = CL.T_Template("diderot::options", [realTy env, intTy env])      fun optionsTy env = CL.T_Template("diderot::options", [realTy env, intTy env])
93    

Legend:
Removed from v.3926  
changed lines
  Added in v.3927

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