| 1 |
functor GCMap(GC : GC_TYPE) : GC_MAP = |
| 2 |
struct |
| 3 |
structure C = CellsBasis |
| 4 |
structure GC = GC |
| 5 |
exception GCMap |
| 6 |
|
| 7 |
type gcmap = GC.gctype C.HashTable.hash_table |
| 8 |
|
| 9 |
val GCMAP = Annotations.new(SOME(fn _ => "gcmap")) |
| 10 |
: gcmap Annotations.property |
| 11 |
|
| 12 |
fun toString gcmap = |
| 13 |
let val lookup = C.HashTable.lookup gcmap |
| 14 |
fun f r = "{" ^ GC.toString(lookup r)^ "}" handle _ => "{?}" |
| 15 |
in f end |
| 16 |
|
| 17 |
fun pr(r,gc) = "r" ^ Int.toString(C.cellId r) ^ ":" ^ GC.toString gc |
| 18 |
fun prSet S = "{"^foldr (fn (x,"") => pr x | (x,y) => pr x^","^y) "" S^"}" |
| 19 |
|
| 20 |
val GCLIVEIN = Annotations.new(SOME(fn S => "livein: "^prSet S)) |
| 21 |
val GCLIVEOUT = Annotations.new(SOME(fn S => "liveout: "^prSet S)) |
| 22 |
|
| 23 |
end |