Skip to content

Commit 3b5b205

Browse files
committed
Allow the deletion of blocks with exceptional successors.
1 parent 9349b0b commit 3b5b205

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/cfg/disconnect_block.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ let disconnect cfg_with_layout label =
4343
(* CR-someday gyorsh: if trap handlers can be eliminated, remove this
4444
label from block.exn of other blocks. *)
4545
Misc.fatal_error "Removing trap handler blocks is not supported";
46-
let successors = C.successor_labels ~normal:true ~exn:true cfg block in
4746
let has_predecessors = not (Label.Set.is_empty block.predecessors) in
48-
let n = Label.Set.cardinal successors in
47+
let n = Label.Set.cardinal (C.successor_labels ~normal:true ~exn:false cfg block) in
4948
let has_more_than_one_successor = n > 1 in
5049
if !C.verbose then Printf.printf "Disconnect %d in %s\n" label cfg.fun_name;
5150
if has_more_than_one_successor && has_predecessors then
@@ -56,6 +55,7 @@ let disconnect cfg_with_layout label =
5655
least one predecessor"
5756
Label.print label;
5857
(* Update successor blocks. *)
58+
let successors = C.successor_labels ~normal:true ~exn:true cfg block in
5959
Label.Set.iter
6060
(fun succ ->
6161
let succ_block = C.get_block_exn cfg succ in

0 commit comments

Comments
 (0)