Skip to content

Commit

Permalink
Compiler: structure, not need to recompute the whole preds
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Aug 3, 2023
1 parent 0eaf3f7 commit 7b6f4bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/lib/structure.ml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ let build_graph blocks pc =
let preds = reverse_graph succs in
List.iter !poptraps ~f:(fun (enter_pc, leave_pc) ->
if leave_try_body block_order preds blocks leave_pc
then
then (
(* Add an edge to limit the [try] body *)
Hashtbl.add succs enter_pc (Addr.Set.add leave_pc (Hashtbl.find succs enter_pc)));
let preds = reverse_graph succs in
Hashtbl.add succs enter_pc (Addr.Set.add leave_pc (Hashtbl.find succs enter_pc));
Hashtbl.add preds leave_pc (Addr.Set.add enter_pc (Hashtbl.find preds leave_pc))));
{ succs; preds; reverse_post_order = !l; block_order }

let dominator_tree g =
Expand Down

0 comments on commit 7b6f4bd

Please sign in to comment.