summaryrefslogtreecommitdiff
path: root/gcc/gimple-pretty-print.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimple-pretty-print.c')
-rw-r--r--gcc/gimple-pretty-print.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 6329d51f2da..0f386163ab3 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -477,6 +477,60 @@ dump_gimple_call_args (pretty_printer *buffer, gimple gs, int flags)
}
}
+/* Dump the points-to solution *PT to BUFFER. */
+
+static void
+pp_points_to_solution (pretty_printer *buffer, struct pt_solution *pt)
+{
+ if (pt->anything)
+ {
+ pp_string (buffer, "anything ");
+ return;
+ }
+ if (pt->nonlocal)
+ pp_string (buffer, "nonlocal ");
+ if (pt->escaped)
+ pp_string (buffer, "escaped ");
+ if (pt->ipa_escaped)
+ pp_string (buffer, "unit-escaped ");
+ if (pt->null)
+ pp_string (buffer, "null ");
+ if (pt->vars
+ && !bitmap_empty_p (pt->vars))
+ {
+ bitmap_iterator bi;
+ unsigned i;
+ pp_string (buffer, "{ ");
+ EXECUTE_IF_SET_IN_BITMAP (pt->vars, 0, i, bi)
+ {
+ struct tree_decl_minimal in;
+ tree var;
+ in.uid = i;
+ var = (tree) htab_find_with_hash (gimple_referenced_vars (cfun),
+ &in, i);
+ if (var)
+ {
+ dump_generic_node (buffer, var, 0, dump_flags, false);
+ if (DECL_PT_UID (var) != DECL_UID (var))
+ {
+ pp_string (buffer, "ptD.");
+ pp_decimal_int (buffer, DECL_PT_UID (var));
+ }
+ }
+ else
+ {
+ pp_string (buffer, "D.");
+ pp_decimal_int (buffer, i);
+ }
+ pp_character (buffer, ' ');
+ }
+ pp_character (buffer, '}');
+ if (pt->vars_contains_global)
+ pp_string (buffer, " (glob)");
+ if (pt->vars_contains_restrict)
+ pp_string (buffer, " (restr)");
+ }
+}
/* Dump the call statement GS. BUFFER, SPC and FLAGS are as in
dump_gimple_stmt. */
@@ -486,6 +540,25 @@ dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags)
{
tree lhs = gimple_call_lhs (gs);
+ if (flags & TDF_ALIAS)
+ {
+ struct pt_solution *pt;
+ pt = gimple_call_use_set (gs);
+ if (!pt_solution_empty_p (pt))
+ {
+ pp_string (buffer, "# USE = ");
+ pp_points_to_solution (buffer, pt);
+ newline_and_indent (buffer, spc);
+ }
+ pt = gimple_call_clobber_set (gs);
+ if (!pt_solution_empty_p (pt))
+ {
+ pp_string (buffer, "# CLB = ");
+ pp_points_to_solution (buffer, pt);
+ newline_and_indent (buffer, spc);
+ }
+ }
+
if (flags & TDF_RAW)
{
dump_gimple_fmt (buffer, spc, flags, "%G <%T, %T",