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 328, Wed Aug 18 22:19:26 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      val realTy = VecTy 0      val samety = MidILTypes.same
17        val hashty = MidILTypes.hash
18      fun samety (ty1 : ty, ty2) = (ty1 = ty2)      val tyToString = MidILTypes.toString
19      fun hashty BoolTy = 0w1  
20        | hashty StringTy = 0w2      fun sameint (i1 : int, i2) = (i1 = i2)
21        | hashty IntTy = 0w3      fun hashint i = Word.fromInt i
22        | hashty (VecTy d) = Word.fromInt d + 0w4      fun intToString i = Int.toString i
     fun tyToString BoolTy = "bool"  
       | tyToString StringTy = "string"  
       | 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 34  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.328  
changed lines
  Added in v.435

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