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

SCM Repository

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

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

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

revision 1773, Sat Mar 31 13:29:34 2012 UTC revision 1774, Sat Mar 31 17:32:46 2012 UTC
# Line 203  Line 203 
203    (* programs *)    (* programs *)
204      structure Program =      structure Program =
205        struct        struct
206          fun new (tgt : target_desc) = let          fun new (tgt : target_desc) = (
 (*  
               val includes = if #exec tgt  
                     then ["#include \"Diderot/diderot.h\"\n"]  
                     else [  
                         "#include \"",  
                         OS.Path.joinBaseExt{base= #outBase tgt, ext= SOME "h"},  
                         "\"\n"  
                       ]  
 *)  
               in  
207                  N.initTargetSpec {double= #double tgt, long=false};                  N.initTargetSpec {double= #double tgt, long=false};
208                  Prog{                  Prog{
209                      tgt = tgt,                      tgt = tgt,
210                      globals = ref [],                      globals = ref [],
 (*  
                     globals = ref [ (* NOTE: in reverse order! *)  
                         CL.D_Var(["static"], CL.charPtr, "ProgramName",  
                           SOME(CL.I_Exp(CL.mkStr(#srcFile tgt)))),  
                         CL.D_Verbatim([  
                             concat["#define " ^ TargetUtil.floatPrecisionDef tgt, "\n"],  
                             concat["#define " ^ TargetUtil.intPrecisionDef tgt, "\n"],  
                             concat["#define " ^ TargetUtil.targetDef tgt, "\n"]  
                           ] @ includes)  
                       ],  
 *)  
211                      topDecls = ref [],                      topDecls = ref [],
212                      strands = AtomTable.mkTable (16, Fail "strand table"),                      strands = AtomTable.mkTable (16, Fail "strand table"),
213                      nAxes = ref(SOME ~1),                      nAxes = ref(SOME ~1),
214                      initially = ref(CL.D_Comment["missing initially"])                      initially = ref(CL.D_Comment["missing initially"])
215                    }                  })
                 end  
216  (* FIXME: the inputFn was used for the standalone executable; we need to do something  (* FIXME: the inputFn was used for the standalone executable; we need to do something
217   * different for libraries.   * different for libraries.
218   *)   *)
# Line 496  Line 474 
474                end                end
475    
476          fun genExecSrc (baseName, prog) = let          fun genExecSrc (baseName, prog) = let
477                val Prog{tgt, globals, topDecls, strands, initially, ...} = prog                val Prog{tgt, globals, topDecls, strands, nAxes, initially, ...} = prog
478                val [strand as Strand{name, tyName, state, output, ...}] = AtomTable.listItems strands                val [strand as Strand{name, tyName, state, output, ...}] = AtomTable.listItems strands
479                  val outputs = GenOutput.gen (tgt, !nAxes) [output]
480                val substitutions =                val substitutions =
481                      ("DIDEROT_FLOAT_PRECISION", TargetUtil.floatPrecisionDef tgt) ::                      ("DIDEROT_FLOAT_PRECISION", TargetUtil.floatPrecisionDef tgt) ::
482                      ("DIDEROT_INT_PRECISION", TargetUtil.intPrecisionDef tgt) ::                      ("DIDEROT_INT_PRECISION", TargetUtil.intPrecisionDef tgt) ::
# Line 515  Line 494 
494                  ppDecl (genWorldStruct(true, tgt, strand));                  ppDecl (genWorldStruct(true, tgt, strand));
495                  List.app ppDecl (List.rev (!globals));                  List.app ppDecl (List.rev (!globals));
496                  List.app ppDecl (List.rev (!topDecls));                  List.app ppDecl (List.rev (!topDecls));
497                    ppDecl (GenInputs.genRegisterInputs (tgt, [(*FIXME*)]));
498                  List.app ppDecl (genStrand(tgt, strand));                  List.app ppDecl (genStrand(tgt, strand));
499  (* outputs *)                  List.app ppDecl outputs;
500                  ppStrandTable (ppStrm, [strand]);                  ppStrandTable (ppStrm, [strand]);
501                  ppDecl (CL.verbatim [InitFrag.text] substitutions);                  ppDecl (CL.verbatim [InitFrag.text] substitutions);
502  (* FIXME: the XXX_Init function needs to include code to initialize the globals with defaults *)  (* FIXME: the XXX_Init function needs to include code to initialize the globals with defaults *)

Legend:
Removed from v.1773  
changed lines
  Added in v.1774

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