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/gen-inputs-util.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/cxx-util/gen-inputs-util.sml

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

revision 3912, Wed May 25 14:53:50 2016 UTC revision 3924, Fri Jun 3 17:30:27 2016 UTC
# Line 64  Line 64 
64      fun genInputsStruct (_, []) = []      fun genInputsStruct (_, []) = []
65        | genInputsStruct (env : Env.t, inputs) = let        | genInputsStruct (env : Env.t, inputs) = let
66            fun mkField (Inp.INP{var, ty, ...}) = (case ty            fun mkField (Inp.INP{var, ty, ...}) = (case ty
67                   of Ty.SeqTy(_, NONE) => (CL.charPtr, GVar.name var)                   of Ty.SeqTy(_, NONE) => (CL.charPtr, GVar.qname var)
68                    | Ty.ImageTy _ => (CL.charPtr, GVar.name var)                    | Ty.ImageTy _ => (CL.charPtr, GVar.qname var)
69                    | ty => (trType(env, ty), GVar.name var)                    | ty => (trType(env, ty), GVar.qname var)
70                  (* end case *))                  (* end case *))
71            in            in
72              [CL.D_StructDef(NONE, List.map mkField inputs, SOME "cmd_line_inputs")]              [CL.D_StructDef(NONE, List.map mkField inputs, SOME "cmd_line_inputs")]
# Line 96  Line 96 
96                    [ CL.mkStr name,                    [ CL.mkStr name,
97                      CL.mkStr(Option.getOpt(desc, "")),                      CL.mkStr(Option.getOpt(desc, "")),
98                      if Ty.isCArrayTy ty                      if Ty.isCArrayTy ty
99                        then CL.mkIndirect(globalsE, GVar.name var)                        then CL.mkIndirect(globalsE, GVar.qname var)
100                        else CL.mkAddrOf(CL.mkIndirect(globalsE, GVar.name var)),                        else CL.mkAddrOf(CL.mkIndirect(globalsE, GVar.qname var)),
101                      case init of Inp.NoDefault => CL.mkBool false | _ => CL.mkBool true                      case init of Inp.NoDefault => CL.mkBool false | _ => CL.mkBool true
102                    ])                    ])
103            in            in
# Line 122  Line 122 
122    (* generate the typedef for the defined-input flag struct. *)    (* generate the typedef for the defined-input flag struct. *)
123      fun genDefinedInpStruct [] = []      fun genDefinedInpStruct [] = []
124        | genDefinedInpStruct inputs = let        | genDefinedInpStruct inputs = let
125            fun mkField (Inp.INP{var, ...}) = (CL.boolTy, GVar.name var)            fun mkField (Inp.INP{var, ...}) = (CL.boolTy, GVar.qname var)
126            in            in
127              [CL.D_StructDef(NONE, List.map mkField inputs, SOME "defined_inputs")]              [CL.D_StructDef(NONE, List.map mkField inputs, SOME "defined_inputs")]
128            end            end

Legend:
Removed from v.3912  
changed lines
  Added in v.3924

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