diff options
author | Léo Gourdin <leo.gourdin@univ-grenoble-alpes.fr> | 2021-05-19 12:47:22 +0200 |
---|---|---|
committer | Léo Gourdin <leo.gourdin@univ-grenoble-alpes.fr> | 2021-05-19 12:47:22 +0200 |
commit | ab520acd80f7d39aa14fdda6932accbb2a787ebf (patch) | |
tree | 67adb8d133f32cd4a64e0d21270632f60866355a /scheduling/PrintBTL.ml | |
parent | af2208a2c7126d4d101fb07c40920e12c9ebbab3 (diff) | |
download | compcert-kvx-ab520acd80f7d39aa14fdda6932accbb2a787ebf.tar.gz compcert-kvx-ab520acd80f7d39aa14fdda6932accbb2a787ebf.zip |
Grouping common RTL functions, printer improvement
Diffstat (limited to 'scheduling/PrintBTL.ml')
-rw-r--r-- | scheduling/PrintBTL.ml | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/scheduling/PrintBTL.ml b/scheduling/PrintBTL.ml index 781dcaf3..b461e3f1 100644 --- a/scheduling/PrintBTL.ml +++ b/scheduling/PrintBTL.ml @@ -23,38 +23,48 @@ let ros pp = function let print_succ pp s = fprintf pp "\tsucc %d\n" (P.to_int s) +let print_pref pp pref = + fprintf pp "%s" pref + let rec print_iblock pp is_rec pref ib = - fprintf pp "%s" pref; match ib with | Bnop -> + print_pref pp pref; fprintf pp "Bnop\n" | Bop(op, args, res) -> + print_pref pp pref; fprintf pp "Bop: %a = %a\n" reg res (PrintOp.print_operation reg) (op, args) | Bload(trap, chunk, addr, args, dst) -> + print_pref pp pref; fprintf pp "Bload: %a = %s[%a]%a\n" reg dst (name_of_chunk chunk) (PrintOp.print_addressing reg) (addr, args) print_trapping_mode trap | Bstore(chunk, addr, args, src) -> + print_pref pp pref; fprintf pp "Bstore: %s[%a] = %a\n" (name_of_chunk chunk) (PrintOp.print_addressing reg) (addr, args) reg src | BF (Bcall(sg, fn, args, res, s)) -> + print_pref pp pref; fprintf pp "Bcall: %a = %a(%a)\n" reg res ros fn regs args; print_succ pp s | BF (Btailcall(sg, fn, args)) -> + print_pref pp pref; fprintf pp "Btailcall: %a(%a)\n" ros fn regs args | BF (Bbuiltin(ef, args, res, s)) -> + print_pref pp pref; fprintf pp "Bbuiltin: %a = %s(%a)\n" (print_builtin_res reg) res (name_of_external ef) (print_builtin_args reg) args; print_succ pp s | Bcond(cond, args, ib1, ib2, info) -> + print_pref pp pref; fprintf pp "Bcond: (%a) (prediction: %s)\n" (PrintOp.print_condition reg) (cond, args) (match info with None -> "none" | Some true -> "branch" | Some false -> "fallthrough"); @@ -67,15 +77,19 @@ let rec print_iblock pp is_rec pref ib = fprintf pp "%s]\n" pref | BF (Bjumptable(arg, tbl)) -> let tbl = Array.of_list tbl in + print_pref pp pref; fprintf pp "Bjumptable: (%a)\n" reg arg; for i = 0 to Array.length tbl - 1 do fprintf pp "\t\tcase %d: goto %d\n" i (P.to_int tbl.(i)) done | BF (Breturn None) -> + print_pref pp pref; fprintf pp "Breturn\n" | BF (Breturn (Some arg)) -> + print_pref pp pref; fprintf pp "Breturn: %a\n" reg arg | BF (Bgoto s) -> + print_pref pp pref; fprintf pp "Bgoto: %d\n" (P.to_int s) | Bseq (ib1, ib2) -> if is_rec then ( |