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

SCM Repository

[diderot] Annotation of /trunk/src/compiler/IL/gen/mid-il.in
ViewVC logotype

Annotation of /trunk/src/compiler/IL/gen/mid-il.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (view) (download)

1 : jhr 266 (* mid-il.sml
2 :     *
3 :     * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)
4 :     * 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 282 datatype ty = BoolTy | StringTy | IntTy | VecTy of int
15 : jhr 266
16 : jhr 328 val realTy = VecTy 0
17 :    
18 : jhr 266 fun samety (ty1 : ty, ty2) = (ty1 = ty2)
19 :     fun hashty BoolTy = 0w1
20 :     | hashty StringTy = 0w2
21 :     | hashty IntTy = 0w3
22 : jhr 282 | hashty (VecTy d) = Word.fromInt d + 0w4
23 : jhr 266 fun tyToString BoolTy = "bool"
24 :     | tyToString StringTy = "string"
25 :     | tyToString IntTy = "int"
26 : jhr 282 | tyToString (VecTy 0) = "real"
27 :     | tyToString (VecTy d) = "vec" ^ Int.toString d
28 : jhr 266
29 :     fun samestring (s1 : string, s2) = (s1 = s2)
30 :     val hashstring = HashString.hashString
31 :     fun stringToString s = String.concat["\"", s, "\""]
32 :    
33 :     @BODY@
34 :    
35 :     end
36 :    
37 :     structure MidIL = SSAFn(MidOps)

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