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

SCM Repository

[diderot] Diff of /branches/vis12-cl/src/compiler/c-target/gen-inputs.sml
ViewVC logotype

Diff of /branches/vis12-cl/src/compiler/c-target/gen-inputs.sml

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

revision 3087, Tue Mar 17 16:35:47 2015 UTC revision 3088, Tue Mar 17 18:27:27 2015 UTC
# Line 70  Line 70 
70    (* generate code to initialize the global input variables from the command-line inputs *)    (* generate code to initialize the global input variables from the command-line inputs *)
71      fun genInitInputs (tgt, inputs) = let      fun genInitInputs (tgt, inputs) = let
72          (* the world pointer type *)          (* the world pointer type *)
73            val worldPtrTy = CL.T_Ptr(CL.T_Named(N.worldTy tgt))            val worldPtrTy = N.worldPtrTy tgt
74          (* the global state pointer type *)          (* the global state pointer type *)
75            val globPtrTy = CL.T_Ptr(CL.T_Named(N.globalsTy tgt))            val globPtrTy = N.globalsPtrTy tgt
76          (* the inputs pointer type *)          (* the inputs pointer type *)
77            val inputPtrTy = CL.T_Ptr(CL.T_Named(N.inputsTy tgt))            val inputPtrTy = N.inputsPtrTy tgt
78          (* some common variables *)          (* some common variables *)
79            val inpV = CL.mkVar "inp"            val inpV = CL.mkVar "inp"
80            val optsV = CL.mkVar "opts"            val optsV = CL.mkVar "opts"
# Line 132  Line 132 
132    
133      fun genCheckInputs (tgt, inputs) = let      fun genCheckInputs (tgt, inputs) = let
134          (* the world pointer type *)          (* the world pointer type *)
135            val worldPtrTy = CL.T_Ptr(CL.T_Named(N.worldTy tgt))            val worldPtrTy = N.worldPtrTy tgt
136            val wrldParam = CL.PARAM([], worldPtrTy, "wrld")            val wrldParam = CL.PARAM([], worldPtrTy, "wrld")
137          (* check that the specified input has been defined and, if not, define it to its default *)          (* check that the specified input has been defined and, if not, define it to its default *)
138            fun check (gv, name, _, optDflt) = let            fun check (gv, name, _, optDflt) = let
# Line 173  Line 173 
173      fun genInputFuns (_, []) = []      fun genInputFuns (_, []) = []
174        | genInputFuns (tgt, inputs) = let        | genInputFuns (tgt, inputs) = let
175          (* the world pointer type *)          (* the world pointer type *)
176            val worldPtrTy = CL.T_Ptr(CL.T_Named(N.worldTy tgt))            val worldPtrTy = N.worldPtrTy tgt
177            val wrldParam = CL.PARAM([], worldPtrTy, "wrld")            val wrldParam = CL.PARAM([], worldPtrTy, "wrld")
178          (* create decls for an input variable *)          (* create decls for an input variable *)
179            fun mkInputDecls (gv, name, desc, optDflt) = let            fun mkInputDecls (gv, name, desc, optDflt) = let

Legend:
Removed from v.3087  
changed lines
  Added in v.3088

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