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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/tree-ir/tree-types.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/tree-ir/tree-types.sml

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

revision 4385, Tue Aug 9 01:57:15 2016 UTC revision 4386, Tue Aug 9 13:51:49 2016 UTC
# Line 29  Line 29 
29        | TupleTy of t list               (* tuples; used for multiple return values *)        | TupleTy of t list               (* tuples; used for multiple return values *)
30        | SeqTy of t * int option        | SeqTy of t * int option
31        | ImageTy of ImageInfo.info        | ImageTy of ImageInfo.info
32        | StrandTy of Atom.atom        | StrandIdTy of Atom.atom         (* index into strand-state array *)
33          | StrandPtrTy of Atom.atom        (* pointer to strand state object *)
34    
35      val intTy = IntTy      val intTy = IntTy
36    
# Line 91  Line 92 
92        | same (SeqTy(ty1, NONE), SeqTy(ty2, NONE)) = same(ty1, ty2)        | same (SeqTy(ty1, NONE), SeqTy(ty2, NONE)) = same(ty1, ty2)
93        | same (SeqTy(ty1, SOME n1), SeqTy(ty2, SOME n2)) = (n1 = n2) andalso same(ty1, ty2)        | same (SeqTy(ty1, SOME n1), SeqTy(ty2, SOME n2)) = (n1 = n2) andalso same(ty1, ty2)
94        | same (ImageTy info1, ImageTy info2) = ImageInfo.sameShape(info1, info2)        | same (ImageTy info1, ImageTy info2) = ImageInfo.sameShape(info1, info2)
95        | same (StrandTy n1, StrandTy n2) = Atom.same(n1, n2)        | same (StrandIdTy n1, StrandIdTy n2) = Atom.same(n1, n2)
96          | same (StrandPtrTy n1, StrandPtrTy n2) = Atom.same(n1, n2)
97        | same _ = false        | same _ = false
98    
99    (* is a source type compatible with the destination type? *)    (* is a source type compatible with the destination type? *)
# Line 108  Line 110 
110        | hash (SeqTy(ty, NONE)) = hash ty + 0w23        | hash (SeqTy(ty, NONE)) = hash ty + 0w23
111        | hash (SeqTy(ty, SOME n)) = Word.fromInt n * hash ty + 0w29        | hash (SeqTy(ty, SOME n)) = Word.fromInt n * hash ty + 0w29
112        | hash (ImageTy info) = 0w37 * ImageInfo.hash info + 0w6        | hash (ImageTy info) = 0w37 * ImageInfo.hash info + 0w6
113        | hash (StrandTy n) = Atom.hash n        | hash (StrandIdTy n) = 0w41 + Atom.hash n
114          | hash (StrandPtrTy n) = 0w43 + Atom.hash n
115    
116      fun toString BoolTy = "bool"      fun toString BoolTy = "bool"
117        | toString StringTy = "string"        | toString StringTy = "string"
# Line 129  Line 132 
132        | toString (SeqTy(ty, NONE)) = toString ty ^ "[]"        | toString (SeqTy(ty, NONE)) = toString ty ^ "[]"
133        | toString (SeqTy(ty, SOME n)) = concat[toString ty, "[", Int.toString n, "]"]        | toString (SeqTy(ty, SOME n)) = concat[toString ty, "[", Int.toString n, "]"]
134        | toString (ImageTy info) = concat["image(", ImageInfo.toString info, ")"]        | toString (ImageTy info) = concat["image(", ImageInfo.toString info, ")"]
135        | toString (StrandTy n) = Atom.toString n        | toString (StrandIdTy n) = concat["id(", Atom.toString n, ")"]
136          | toString (StrandPtrTy n) = "&" ^ Atom.toString n
137    
138      structure Tbl = HashTableFn (      structure Tbl = HashTableFn (
139        struct        struct

Legend:
Removed from v.4385  
changed lines
  Added in v.4386

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