SCM Repository
Annotation of /trunk/src/compiler/IL/gen/mid-il.in
Parent Directory
|
Revision Log
Revision 282 - (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 : | fun samety (ty1 : ty, ty2) = (ty1 = ty2) | ||
17 : | fun hashty BoolTy = 0w1 | ||
18 : | | hashty StringTy = 0w2 | ||
19 : | | hashty IntTy = 0w3 | ||
20 : | jhr | 282 | | hashty (VecTy d) = Word.fromInt d + 0w4 |
21 : | jhr | 266 | fun tyToString BoolTy = "bool" |
22 : | | tyToString StringTy = "string" | ||
23 : | | tyToString IntTy = "int" | ||
24 : | jhr | 282 | | tyToString (VecTy 0) = "real" |
25 : | | tyToString (VecTy d) = "vec" ^ Int.toString d | ||
26 : | jhr | 266 | |
27 : | fun samestring (s1 : string, s2) = (s1 = s2) | ||
28 : | val hashstring = HashString.hashString | ||
29 : | fun stringToString s = String.concat["\"", s, "\""] | ||
30 : | |||
31 : | @BODY@ | ||
32 : | |||
33 : | end | ||
34 : | |||
35 : | structure MidIL = SSAFn(MidOps) |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |