summaryrefslogtreecommitdiff
path: root/src/jib/jib_compile.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2019-03-14 13:36:47 +0000
committerAlasdair Armstrong2019-03-14 14:22:41 +0000
commit0b191fdc6ee7929a7c4667e2835c8e8c1d6e3ada (patch)
treea3ccff150909ba775ffa85b6984fbbb474ffee39 /src/jib/jib_compile.ml
parent52b3b8e65dcb1f29b0f587880858cb938fd5de45 (diff)
C: Some further tweaks
Diffstat (limited to 'src/jib/jib_compile.ml')
-rw-r--r--src/jib/jib_compile.ml5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/jib/jib_compile.ml b/src/jib/jib_compile.ml
index 27f833d8..facf64e9 100644
--- a/src/jib/jib_compile.ml
+++ b/src/jib/jib_compile.ml
@@ -1179,10 +1179,15 @@ and compile_def' n total ctx = function
if !opt_debug_flow_graphs then
begin
let instrs = Jib_optimize.(instrs |> optimize_unit |> flatten_instrs) in
+ let root, _, cfg = Jib_ssa.control_flow_graph instrs in
+ let idom = Jib_ssa.immediate_dominators cfg root in
let cfg = Jib_ssa.ssa instrs in
let out_chan = open_out (Util.zencode_string (string_of_id id) ^ ".gv") in
Jib_ssa.make_dot out_chan cfg;
close_out out_chan;
+ let out_chan = open_out (Util.zencode_string (string_of_id id) ^ ".dom.gv") in
+ Jib_ssa.make_dominators_dot out_chan idom cfg;
+ close_out out_chan;
end;
[CDEF_fundef (id, None, List.map fst compiled_args, instrs)], orig_ctx