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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/codegen/gen-library-interface.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/codegen/gen-library-interface.sml

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

revision 4005, Mon Jun 20 12:34:46 2016 UTC revision 4006, Mon Jun 20 12:45:56 2016 UTC
# Line 35  Line 35 
35      val outputGet      : TargetSpec.t * string -> string      val outputGet      : TargetSpec.t * string -> string
36      val worldTy        : TargetSpec.t -> string      val worldTy        : TargetSpec.t -> string
37    
38      (* translate API types to C types *)
39        val apiTypeToC : CodeGenEnv.t * APITypes.t -> CLang.ty
40    
41    end = struct    end = struct
42    
43      structure Ty = APITypes      structure Ty = APITypes
# Line 67  Line 70 
70      val outputGet      = TargetSpec.qualifyCId' "output_get"      val outputGet      = TargetSpec.qualifyCId' "output_get"
71      val worldTy        = TargetSpec.qualifyCId "world_t"      val worldTy        = TargetSpec.qualifyCId "world_t"
72    
73      (* translate API types to C types *)
74        fun apiTypeToC (env, ty) = (case ty
75               of Ty.IntTy => Env.intTy env
76                | Ty.BoolTy => CL.boolTy
77                | Ty.TensorTy[] => Env.realTy env
78                | Ty.TensorTy dd => CL.T_Array(Env.realTy env, SOME(List.foldl Int.* 1 dd))
79                | Ty.StringTy => CL.constPtrTy CL.charTy
80                | Ty.ImageTy(dim, shp) => raise Fail "FIXME: ImageTy"
81                | Ty.SeqTy(ty, NONE) => raise Fail "FIXME: ImageTy"
82                | Ty.SeqTy(ty, SOME n) => CL.T_Array(apiTypeToC(env, ty), SOME n)
83              (* end case *))
84    
85      fun gen {env, subs, rt, inputs, outputs} = let      fun gen {env, subs, rt, inputs, outputs} = let
86            val spec = Env.target env            val spec = Env.target env
87            val baseName = OS.Path.joinDirFile{            val baseName = OS.Path.joinDirFile{

Legend:
Removed from v.4005  
changed lines
  Added in v.4006

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