aboutsummaryrefslogtreecommitdiff
path: root/src/boot/me
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-09-16 11:28:55 -0700
committerPatrick Walton <[email protected]>2010-09-16 11:28:55 -0700
commit01a76e21a62041b50f746969e69c60e79e7e8b44 (patch)
tree94bd7f27a3b29fa901bcacb6f72f144dbf2e2645 /src/boot/me
parentAdd ctxt_tag_containment to the Semant context (diff)
downloadrust-01a76e21a62041b50f746969e69c60e79e7e8b44.tar.xz
rust-01a76e21a62041b50f746969e69c60e79e7e8b44.zip
Better representation of tag containment, which will allow us to discern backreferences
Diffstat (limited to 'src/boot/me')
-rw-r--r--src/boot/me/semant.ml10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml
index 9de22f1e..cde590c9 100644
--- a/src/boot/me/semant.ml
+++ b/src/boot/me/semant.ml
@@ -88,6 +88,11 @@ type tag_info =
{ tag_idents: (Ast.ident, (int * node_id * Ast.ty_tup)) Hashtbl.t;
tag_nums: (int, (Ast.ident * node_id * Ast.ty_tup)) Hashtbl.t; }
+type tag_graph_node = {
+ mutable tgn_index: int option;
+ tgn_children: opaque_id Queue.t;
+}
+
type ctxt =
{ ctxt_sess: Session.sess;
ctxt_frame_args: (node_id,node_id list) Hashtbl.t;
@@ -111,9 +116,8 @@ type ctxt =
ctxt_all_lvals: (node_id,Ast.lval) Hashtbl.t;
ctxt_call_lval_params: (node_id,Ast.ty array) Hashtbl.t;
- (* Each pair (a, b) in this table indicates that tag a contains all the
- * tags in the list b. *)
- ctxt_tag_containment: (opaque_id, opaque_id Queue.t) Hashtbl.t;
+ (* A directed graph that encodes the containment relation among tags. *)
+ ctxt_tag_containment: (opaque_id, tag_graph_node) Hashtbl.t;
(* definition id --> definition *)
ctxt_all_defns: (node_id,defn) Hashtbl.t;