Debian Codegraph @

lib/mlrisc-lib/MLRISC/aliasing/pointsTo.sig

raw
1 (*
2 * This module can be used to perform points-to analysis for typed languages
3 *
4 * -- Allen
5 *)
6 signature POINTS_TO =
7 sig
8
9 eqtype edgekind
10 structure C : CELLS_BASIS (* = CellsBasis *)
11 where type CellSet.cellset = CellsBasis.CellSet.cellset
12 and type 'a ColorTable.hash_table = 'a CellsBasis.ColorTable.hash_table
13 and type 'a HashTable.hash_table = 'a CellsBasis.HashTable.hash_table
14 and type SortedCells.sorted_cells = CellsBasis.SortedCells.sorted_cells
15 and type cell = CellsBasis.cell
16 and type cellColor = CellsBasis.cellColor
17 and type cellkind = CellsBasis.cellkind
18 and type cellkindDesc = CellsBasis.cellkindDesc
19 and type cellkindInfo = CellsBasis.cellkindInfo
20
21 datatype cell =
22 LINK of cell ref
23 | SREF of C.cell * (edgekind * int * cell ref) list ref
24 | WREF of C.cell * (edgekind * int * cell ref) list ref
25 | SCELL of C.cell * (edgekind * int * cell ref) list ref
26 | WCELL of C.cell * (edgekind * int * cell ref) list ref
27 | TOP of {mutable:bool, id:C.cell, name:string}
28 (* a collapsed node *)
29 type region = cell ref
30 type edges = (edgekind * int * region) list
31
32 val reset : (unit -> C.cell) -> unit
33
34 (* generate a new reference/immutable cell *)
35 val newSRef : unit -> region
36 val newWRef : unit -> region
37 val newSCell : unit -> region
38 val newWCell : unit -> region
39
40 (* generate a new collapsed node *)
41 val newTop : {mutable:bool,name:string} -> region
42
43 (*
44 * The following are methods for constructing the storage shape graph.
45 *)
46 val pi : region * int -> region (* the ith projection *)
47 val sub : region * int -> region (* the ith subscript *)
48 val dom : region * int -> region (* the ith domain *)
49 val ran : region * int -> region (* the ith range *)
50 val offset : region * int -> region (* the ith offset *)
51
52 val unify : region * region -> unit
53 val interfere : region * region -> bool (* do they interfere? *)
54
55 (*
56 * More complex methods
57 *)
58 val mkRecord : region option * region list -> region
59 val mkRef : region option * region -> region
60 val mkArray : region option * region list -> region
61 val mkVector : region option * region list -> region
62 val mkLambda : region list -> region (* define a function *)
63
64 val app : region * region list -> unit (* apply a function *)
65 val ret : region * region list -> unit (* binds the return values *)
66
67 val strongUpdate : region * int * region -> unit
68 val strongSubscript : region * int -> region
69 val weakUpdate : region * region -> unit
70 val weakSubscript : region -> region
71
72 val toString : region -> string
73
74 end