Skip to content

Commit 01a76e2

Browse files
committed
Better representation of tag containment, which will allow us to discern backreferences
1 parent a4a8bea commit 01a76e2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/boot/me/semant.ml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ type tag_info =
8888
{ tag_idents: (Ast.ident, (int * node_id * Ast.ty_tup)) Hashtbl.t;
8989
tag_nums: (int, (Ast.ident * node_id * Ast.ty_tup)) Hashtbl.t; }
9090

91+
type tag_graph_node = {
92+
mutable tgn_index: int option;
93+
tgn_children: opaque_id Queue.t;
94+
}
95+
9196
type ctxt =
9297
{ ctxt_sess: Session.sess;
9398
ctxt_frame_args: (node_id,node_id list) Hashtbl.t;
@@ -111,9 +116,8 @@ type ctxt =
111116
ctxt_all_lvals: (node_id,Ast.lval) Hashtbl.t;
112117
ctxt_call_lval_params: (node_id,Ast.ty array) Hashtbl.t;
113118

114-
(* Each pair (a, b) in this table indicates that tag a contains all the
115-
* tags in the list b. *)
116-
ctxt_tag_containment: (opaque_id, opaque_id Queue.t) Hashtbl.t;
119+
(* A directed graph that encodes the containment relation among tags. *)
120+
ctxt_tag_containment: (opaque_id, tag_graph_node) Hashtbl.t;
117121

118122
(* definition id --> definition *)
119123
ctxt_all_defns: (node_id,defn) Hashtbl.t;

0 commit comments

Comments
 (0)