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

SCM Repository

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

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

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

revision 282, Fri Aug 13 19:20:23 2010 UTC revision 435, Tue Oct 19 13:14:20 2010 UTC
# Line 1  Line 1 
1  (* mid-il.sml  (* mid-il.sml
2   *   *
3   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4   * All rights reserved.   * All rights reserved.
5   *   *
6   * Middle-level version of the Diderot IL.   * Middle-level version of the Diderot IL.
# Line 11  Line 11 
11  structure MidOps =  structure MidOps =
12    struct    struct
13    
14      datatype ty = BoolTy | StringTy | IntTy | VecTy of int      type ty = MidILTypes.ty
15    
16      fun samety (ty1 : ty, ty2) = (ty1 = ty2)      val samety = MidILTypes.same
17      fun hashty BoolTy = 0w1      val hashty = MidILTypes.hash
18        | hashty StringTy = 0w2      val tyToString = MidILTypes.toString
19        | hashty IntTy = 0w3  
20        | hashty (VecTy d) = Word.fromInt d + 0w4      fun sameint (i1 : int, i2) = (i1 = i2)
21      fun tyToString BoolTy = "bool"      fun hashint i = Word.fromInt i
22        | tyToString StringTy = "string"      fun intToString i = Int.toString i
       | tyToString IntTy = "int"  
       | tyToString (VecTy 0) = "real"  
       | tyToString (VecTy d) = "vec" ^ Int.toString d  
23    
24      fun samestring (s1 : string, s2) = (s1 = s2)      fun samestring (s1 : string, s2) = (s1 = s2)
25      val hashstring = HashString.hashString      val hashstring = HashString.hashString
# Line 32  Line 29 
29    
30    end    end
31    
32  structure MidIL = SSAFn(MidOps)  structure MidIL = SSAFn(
33      structure Ty = MidILTypes
34      structure Op = MidOps)

Legend:
Removed from v.282  
changed lines
  Added in v.435

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