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

SCM Repository

[diderot] Diff of /branches/lamont/src/compiler/codegen/target-util.sml
ViewVC logotype

Diff of /branches/lamont/src/compiler/codegen/target-util.sml

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

revision 1685, Sun Jan 22 15:23:36 2012 UTC revision 1704, Tue Mar 6 15:44:37 2012 UTC
# Line 1  Line 1 
1  (* target-util.sml  (* target-util.sml
2   *   *
3   * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)   * COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4   * All rights reserved.   * All rights reserved.
5   *   *
6   * Utility support for target selection, etc.   * Utility support for target selection, etc.
# Line 15  Line 15 
15        | TARGET_CUDA             (* C + CUDA *)        | TARGET_CUDA             (* C + CUDA *)
16    
17      type target_desc = {      type target_desc = {
18            exec : bool,            (* generate standalone executable? *)
19          target : target,        (* target platform *)          target : target,        (* target platform *)
20          parallel : bool,        (* parallel components *)          parallel : bool,        (* parallel components *)
21          double : bool,          (* true for double-precision candidates *)          double : bool,          (* true for double-precision candidates *)
# Line 22  Line 23 
23        }        }
24    
25    (* convert a target specification to the name of the runtime library *)    (* convert a target specification to the name of the runtime library *)
26      fun runtimeName {target, parallel, double, debug} = let      fun runtimeName {exec, target, parallel, double, debug} = let
27            val l = if debug then ["-debug.o"] else [".o"]            val l = if debug then ["-debug.o"] else [".o"]
28            val l = if parallel then "-par"::l else l            val l = if parallel then "-par"::l else l
29            val p = if double then "-d" else "-f"            val p = if double then "-d" else "-f"
30            val t = (case target            val t = (case target
31                   of TARGET_C => "c"                   of TARGET_C => "-c"
32                    | TARGET_CL => "cl"                    | TARGET_CL => "-cl"
33                    | TARGET_CUDA => "cuda"                    | TARGET_CUDA => "-cuda"
34                  (* end case *))                  (* end case *))
35              val lib = if exec then "-main" else "-rt"
36            in            in
37              OS.Path.concat(              OS.Path.concat(
38                Paths.diderotLib,                Paths.diderotLib,
39                String.concat("diderot-rt-" :: t :: p :: l))                String.concat("diderot" :: lib :: t :: p :: l))
40            end            end
41    
42    end    end

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

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