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

SCM Repository

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

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

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

revision 2661, Fri May 30 14:43:55 2014 UTC revision 2662, Fri May 30 16:55:05 2014 UTC
# Line 12  Line 12 
12      structure Ty = IL.Ty      structure Ty = IL.Ty
13      structure CL = CLang      structure CL = CLang
14      structure N = CNames      structure N = CNames
15        structure Opr=OprToClang
16    
17    (* variable translation *)    (* variable translation *)
18      structure TrVar =      structure TrVar =
# Line 59  Line 60 
60          globals : CL.decl list ref,          globals : CL.decl list ref,
61          topDecls : CL.decl list ref,          topDecls : CL.decl list ref,
62          strands : strand AtomTable.hash_table,          strands : strand AtomTable.hash_table,
63          initially : CL.decl ref          initially : CL.decl ref,
64            opr: CL.decl list ref,
65            typs: CL.ty list ref
66    
67        }        }
68    
69      datatype env = ENV of {      datatype env = ENV of {
# Line 98  Line 102 
102        | isVecTy _= false        | isVecTy _= false
103    
104    
105    
106    
107  fun getPieces n=let  fun getPieces n=let
108      (*Convert to binary*)      (*Convert to binary*)
109      fun toBin n = let      fun toBin n = let
# Line 114  Line 120 
120    
121    
122    
123    
124        (*Program , Opr-> Program with new CLang declations *)
125        fun getOpr(Prog{ opr, typs,...} ,oprations)=let
126            val DecL=List.map Opr.handleOpr oprations
127            in
128                (opr:=DecL;1)
129            end
130    
131        fun prntOpr(Prog{ opr, typs,...})=  let
132            val str=List.map CLang.decToString (!opr)
133    
134            in
135                (String.concat["\n \t\t---- Tree-To-C Decalations\n",
136                String.concat str])
137            end
138    
139         (*All Types in the program  *)
140        fun getTypes(Prog{ opr, typs,...}, e) =let
141    
142            val ClTyps=List.map ToC.trType  (e)
143            in
144                (typs:=ClTyps;1)
145            end
146    
147        fun prntTypes(Prog{ opr, typs,...})=let
148            val str=List.map CL.tyToString(!typs)
149            in
150                String.concat["\n \t\t---- Tree-To-C Types \n",
151                String.concatWith"," str]
152            end
153    
154    
155    
156    
157    (* we support printing in the sequential C target *)    (* we support printing in the sequential C target *)
158      val supportsPrinting = true      val supportsPrinting = true
159    
# Line 134  Line 174 
174          fun block (ENV{vMap, ...}, blk) = ToC.trBlock (vMap, blk)          fun block (ENV{vMap, ...}, blk) = ToC.trBlock (vMap, blk)
175          fun exp (ENV{vMap, ...}, e) = ToC.trExp(vMap, e)          fun exp (ENV{vMap, ...}, e) = ToC.trExp(vMap, e)
176    
         fun allTypes e = ToC.trAllTypes e  
         fun allOpr e = ToC.trAllOpr e  
177        end        end
178    
179    (* variables *)    (* variables *)
# Line 177  Line 215 
215    (* programs *)    (* programs *)
216      structure Program =      structure Program =
217        struct        struct
218    
219    
220    
221          fun new {name, double, parallel, debug} = (          fun new {name, double, parallel, debug} = (
222                N.initTargetSpec {double=double, long=false};                N.initTargetSpec {double=double, long=false};
223                Prog{                Prog{
# Line 198  Line 239 
239                      ],                      ],
240                    topDecls = ref [],                    topDecls = ref [],
241                    strands = AtomTable.mkTable (16, Fail "strand table"),                    strands = AtomTable.mkTable (16, Fail "strand table"),
242                    initially = ref(CL.D_Comment["missing initially"])                    initially = ref(CL.D_Comment["missing initially"]),
243                      opr=ref [], typs=ref []
244                  })                  })
245        (* register the code that is used to register command-line options for input variables *)        (* register the code that is used to register command-line options for input variables *)
246          fun inputs (Prog{topDecls, ...}, stm) = let          fun inputs (Prog{topDecls, ...}, stm) = let

Legend:
Removed from v.2661  
changed lines
  Added in v.2662

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