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 1703, Tue Mar 6 13:05:55 2012 UTC revision 1704, Tue Mar 6 15:44:37 2012 UTC
# Line 52  Line 52 
52        }        }
53    
54      datatype program = Prog of {      datatype program = Prog of {
55          name : string,                  (* stem of source file *)          name : string,                  (* name of source file *)
56            exec : bool,                    (* true for standalone programs *)
57          double : bool,                  (* true for double-precision support *)          double : bool,                  (* true for double-precision support *)
58          parallel : bool,                (* true for multithreaded (or multi-GPU) target *)          parallel : bool,                (* true for multithreaded (or multi-GPU) target *)
59          debug : bool,                   (* true for debug support in executable *)          debug : bool,                   (* true for debug support in executable *)
# Line 146  Line 147 
147    (* programs *)    (* programs *)
148      structure Program =      structure Program =
149        struct        struct
150          fun new {name, double, parallel, debug} = (          fun new {name, exec, double, parallel, debug} = (
151                N.initTargetSpec {double=double, long=false};                N.initTargetSpec {double=double, long=false};
152                Prog{                Prog{
153                    name = name,                    name = name, exec = exec,
154                    double = double, parallel = parallel, debug = debug,                    double = double, parallel = parallel, debug = debug,
155                    globals = ref [ (* NOTE: in reverse order! *)                    globals = ref [ (* NOTE: in reverse order! *)
156                        CL.D_Var(["static"], CL.charPtr, "ProgramName",                        CL.D_Var(["static"], CL.charPtr, "ProgramName",
# Line 377  Line 378 
378        (* output the code to a file.  The string is the basename of the file, the extension        (* output the code to a file.  The string is the basename of the file, the extension
379         * is provided by the target.         * is provided by the target.
380         *)         *)
381          fun generate (basename, prog as Prog{name, double, parallel, debug, ...}) = let          fun generate (basename, prog as Prog{name, exec, double, parallel, debug, ...}) = let
382                fun condCons (true, x, xs) = x::xs                fun condCons (true, x, xs) = x::xs
383                  | condCons (false, _, xs) = xs                  | condCons (false, _, xs) = xs
384              (* generate the C compiler flags *)              (* generate the C compiler flags *)
# Line 391  Line 392 
392                val extraLibs = condCons (parallel, #pthread Paths.extraLibs, [])                val extraLibs = condCons (parallel, #pthread Paths.extraLibs, [])
393                val extraLibs = Paths.teemLinkFlags @ #base Paths.extraLibs :: extraLibs                val extraLibs = Paths.teemLinkFlags @ #base Paths.extraLibs :: extraLibs
394                val rtLib = TargetUtil.runtimeName {                val rtLib = TargetUtil.runtimeName {
395                        target = TargetUtil.TARGET_C,                        target = TargetUtil.TARGET_C, exec = exec,
396                        parallel = parallel, double = double, debug = debug                        parallel = parallel, double = double, debug = debug
397                      }                      }
398                val ldOpts = rtLib :: extraLibs                val ldOpts = rtLib :: extraLibs

Legend:
Removed from v.1703  
changed lines
  Added in v.1704

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