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

SCM Repository

[diderot] Annotation of /branches/pure-cfg/src/compiler/gen/il/mid-il.in
ViewVC logotype

Annotation of /branches/pure-cfg/src/compiler/gen/il/mid-il.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1624 - (view) (download)

1 : jhr 266 (* mid-il.sml
2 :     *
3 : jhr 435 * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4 : jhr 266 * All rights reserved.
5 :     *
6 :     * Middle-level version of the Diderot IL.
7 :     *
8 :     * Note: this file is generated from gen/mid-il.spec and gen/mid-il.in.
9 :     *)
10 :    
11 :     structure MidOps =
12 :     struct
13 :    
14 : jhr 1624 (* required helper functions for types *)
15 : jhr 391 type ty = MidILTypes.ty
16 :     val samety = MidILTypes.same
17 :     val hashty = MidILTypes.hash
18 :     val tyToString = MidILTypes.toString
19 : jhr 328
20 : jhr 1624 (* required helper functions for type lists *)
21 :     type tys = ty list
22 :     fun sametys (tys1, tys2) = ListPair.allEq samety (tys1, tys2)
23 :     fun hashtys tys = List.foldl (fn (ty, s) => hashty ty + 0w3 * s) 0w0 tys
24 :     fun tysToString tys = String.concat["[", String.concatWith "," (List.map tyToString tys), "]" ]
25 :    
26 : jhr 1116 (* required helper functions for the int type *)
27 : jhr 332 fun sameint (i1 : int, i2) = (i1 = i2)
28 :     fun hashint i = Word.fromInt i
29 :     fun intToString i = Int.toString i
30 :    
31 : jhr 1116 (* required helper functions for the string type *)
32 : jhr 266 fun samestring (s1 : string, s2) = (s1 = s2)
33 :     val hashstring = HashString.hashString
34 :     fun stringToString s = String.concat["\"", s, "\""]
35 :    
36 :     @BODY@
37 :    
38 :     end
39 :    
40 : jhr 392 structure MidIL = SSAFn(
41 : jhr 1232 val ilName = "mid-il"
42 : jhr 392 structure Ty = MidILTypes
43 :     structure Op = MidOps)
44 : jhr 1116
45 :     structure MidILCensus = CensusFn(MidIL)
46 :    

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