diff options
| author | Graydon Hoare <[email protected]> | 2010-09-30 16:10:30 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-09-30 16:10:30 -0700 |
| commit | 62c224ffe4845ed3a1f651d05ea0be84d5c870ea (patch) | |
| tree | 4b5fdc0220f369b0cae5784c1d076fe502a78df0 /src/boot/me/semant.ml | |
| parent | Initial check-in of 99 Bottles Of Beer (diff) | |
| download | rust-62c224ffe4845ed3a1f651d05ea0be84d5c870ea.tar.xz rust-62c224ffe4845ed3a1f651d05ea0be84d5c870ea.zip | |
Drop slots on block exits even when blocks have no statements. Part way to fixing bind leakage in rustc.
Diffstat (limited to 'src/boot/me/semant.ml')
| -rw-r--r-- | src/boot/me/semant.ml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml index 945155b0..7f5e4cda 100644 --- a/src/boot/me/semant.ml +++ b/src/boot/me/semant.ml @@ -131,6 +131,7 @@ type ctxt = (* Typestate-y stuff. *) ctxt_stmt_is_init: (node_id,unit) Hashtbl.t; ctxt_post_stmt_slot_drops: (node_id,node_id list) Hashtbl.t; + ctxt_post_block_slot_drops: (node_id,node_id list) Hashtbl.t; (* Layout-y stuff. *) ctxt_slot_aliased: (node_id,unit) Hashtbl.t; @@ -141,6 +142,7 @@ type ctxt = ctxt_call_sizes: (node_id,size) Hashtbl.t; ctxt_block_is_loop_body: (node_id,unit) Hashtbl.t; ctxt_stmt_loop_depths: (node_id,int) Hashtbl.t; + ctxt_block_loop_depths: (node_id,int) Hashtbl.t; ctxt_slot_loop_depths: (node_id,int) Hashtbl.t; (* Translation-y stuff. *) @@ -216,6 +218,7 @@ let new_ctxt sess abi crate = ctxt_stmt_is_init = Hashtbl.create 0; ctxt_post_stmt_slot_drops = Hashtbl.create 0; + ctxt_post_block_slot_drops = Hashtbl.create 0; ctxt_slot_aliased = Hashtbl.create 0; ctxt_slot_is_obj_state = Hashtbl.create 0; @@ -227,6 +230,7 @@ let new_ctxt sess abi crate = ctxt_block_is_loop_body = Hashtbl.create 0; ctxt_slot_loop_depths = Hashtbl.create 0; ctxt_stmt_loop_depths = Hashtbl.create 0; + ctxt_block_loop_depths = Hashtbl.create 0; ctxt_fn_fixups = Hashtbl.create 0; ctxt_block_fixups = Hashtbl.create 0; @@ -399,6 +403,10 @@ let get_stmt_depth (cx:ctxt) (id:node_id) : int = Hashtbl.find cx.ctxt_stmt_loop_depths id ;; +let get_block_depth (cx:ctxt) (id:node_id) : int = + Hashtbl.find cx.ctxt_block_loop_depths id +;; + let get_slot_depth (cx:ctxt) (id:node_id) : int = Hashtbl.find cx.ctxt_slot_loop_depths id ;; |