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

SCM Repository

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

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

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

revision 2081, Mon Nov 5 23:26:06 2012 UTC revision 2082, Tue Nov 6 22:54:10 2012 UTC
# Line 16  Line 16 
16    (* generate the input initialization structure that we use to initialize input    (* generate the input initialization structure that we use to initialize input
17     * globals from command-line arguments in stand-alone executables.     * globals from command-line arguments in stand-alone executables.
18     *)     *)
19      val genInputsStruct : TargetUtil.target_desc * input_desc list -> CLang.decl      val genInputsStruct : Properties.props * input_desc list -> CLang.decl
20    
21    (* generate the functions that handle inputs for standalone executables.  These are:    (* generate the functions that handle inputs for standalone executables.  These are:
22     *    InitDefaults    -- called to initialize the default input values     *    InitDefaults    -- called to initialize the default input values
# Line 24  Line 24 
24     *    InitInptus      -- called to initialize the input globals from the values specified     *    InitInptus      -- called to initialize the input globals from the values specified
25     *                       on the command line.     *                       on the command line.
26     *)     *)
27      val genExecInputFuns : TargetUtil.target_desc * input_desc list -> CLang.decl list      val genExecInputFuns : Properties.props * input_desc list -> CLang.decl list
28    
29    (*** Support for libraries ***)    (*** Support for libraries ***)
30    
31    (* generate the typedef for the defined-input flag struct. *)    (* generate the typedef for the defined-input flag struct. *)
32      val genDefinedInpStruct : TargetUtil.target_desc * input_desc list -> CLang.decl      val genDefinedInpStruct : Properties.props * input_desc list -> CLang.decl
33    
34    (* generated the functions to initialize inputs for the library API.  This function also    (* generated the functions to initialize inputs for the library API.  This function also
35     * generates the function to initialize the defined input flags struct.     * generates the function to initialize the defined input flags struct.
36     *)     *)
37      val genInputFuns : TargetUtil.target_desc * input_desc list -> CLang.decl list      val genInputFuns : Properties.props * input_desc list -> CLang.decl list
38    
39    end = struct    end = struct
40    
# Line 50  Line 50 
50      val nrrdPtrTy = CL.T_Ptr(CL.T_Named "Nrrd")      val nrrdPtrTy = CL.T_Ptr(CL.T_Named "Nrrd")
51      val wrldPrefixTy = CL.T_Ptr(CL.T_Named "WorldPrefix_t")      val wrldPrefixTy = CL.T_Ptr(CL.T_Named "WorldPrefix_t")
52    
53      type target_desc = TargetUtil.target_desc      type props = Properties.props
54    
55    (* translate a TreeIL type to the C types used to represent it in the external API *)    (* translate a TreeIL type to the C types used to represent it in the external API *)
56      val trType = CTyTranslate.toCType      val trType = CTyTranslate.toCType
# Line 77  Line 77 
77    (* generate the input initialization structure that we use to initialize input    (* generate the input initialization structure that we use to initialize input
78     * globals from command-line arguments in stand-alone executables.     * globals from command-line arguments in stand-alone executables.
79     *)     *)
80      fun genInputsStruct (tgt : target_desc, inputs) = let      fun genInputsStruct (tgt : props, inputs) = let
81            fun mkField (Ty.DynSeqTy _, name, _, _) = (CL.charPtr, name)            fun mkField (Ty.DynSeqTy _, name, _, _) = (CL.charPtr, name)
82              | mkField (Ty.ImageTy _, name, _, _) = (CL.charPtr, name)              | mkField (Ty.ImageTy _, name, _, _) = (CL.charPtr, name)
83              | mkField (ty, name, _, _) = (trType ty, name)              | mkField (ty, name, _, _) = (trType ty, name)
# Line 175  Line 175 
175            ]            ]
176    
177    (* generate the typedef for the defined-input flag struct. *)    (* generate the typedef for the defined-input flag struct. *)
178      fun genDefinedInpStruct (tgt : target_desc, inputs) = let      fun genDefinedInpStruct (tgt : props, inputs) = let
179            fun mkField (_, name, _, _) = (CL.boolTy, name)            fun mkField (_, name, _, _) = (CL.boolTy, name)
180            in            in
181              CL.D_StructDef(NONE, List.map mkField inputs, SOME(N.definedInpTy tgt))              CL.D_StructDef(NONE, List.map mkField inputs, SOME(N.definedInpTy tgt))

Legend:
Removed from v.2081  
changed lines
  Added in v.2082

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