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

SCM Repository

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

Diff of /branches/vis12/src/compiler/c-util/c-ty-translate.sml

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

revision 2117, Mon Jan 21 02:43:14 2013 UTC revision 2118, Mon Jan 21 03:24:27 2013 UTC
# Line 16  Line 16 
16    (* translate a TreeIL type to the C types used to represent it in the external API *)    (* translate a TreeIL type to the C types used to represent it in the external API *)
17      val toCType : TreeIL.Ty.ty -> CLang.ty      val toCType : TreeIL.Ty.ty -> CLang.ty
18    
19      (* return true if the external API typed used to represent a TreeIL type is a C array type *)
20        val isCArrayTy : TreeIL.Ty.ty -> bool
21    
22    (* generate code to copy values from their internal Diderot representation to the external    (* generate code to copy values from their internal Diderot representation to the external
23     * C representation.     * C representation.
24     *)     *)
# Line 70  Line 73 
73              | _ => raise Fail(concat["CTyTranslate.toCType(", Ty.toString ty, ")"])              | _ => raise Fail(concat["CTyTranslate.toCType(", Ty.toString ty, ")"])
74            (* end case *))            (* end case *))
75    
76      (* return true if the external API typed used to represent a TreeIL type is a C array type *)
77        fun isCArrayTy ty = (case ty
78               of Ty.TensorTy[n] => true
79                | Ty.TensorTy[n, m] => true
80                | Ty.TensorTy[n, m, l] => true
81                | Ty.SeqTy(Ty.IntTy, n) => true
82                | Ty.SeqTy(ty, n) => true
83                | _ => false
84              (* end case *))
85    
86      fun subscript (e, i) = CL.mkSubscript(e, CL.mkInt(IntInf.fromInt i))      fun subscript (e, i) = CL.mkSubscript(e, CL.mkInt(IntInf.fromInt i))
87    
88  (* we might want to use memcpy in some cases  (* we might want to use memcpy in some cases

Legend:
Removed from v.2117  
changed lines
  Added in v.2118

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