dump_generic_node (pp, t, 0, TDF_SLIM, 0);
}
+/* Equivalent to pp_printf (pp, "%qT", t), to avoid nesting pp_printf
+ calls within other pp_printf calls.
+
+ default_tree_printer handles 'T' and some other codes by calling
+ dump_generic_node (pp, t, 0, TDF_SLIM, 0);
+ dump_generic_node calls pp_printf in various places, leading to
+ garbled output.
+
+ Ideally pp_printf could be made to be reentrant, but in the meantime
+ this function provides a workaround. */
+
+static void
+print_quoted_type (pretty_printer *pp, tree t)
+{
+ pp_begin_quote (pp, pp_show_color (pp));
+ dump_generic_node (pp, t, 0, TDF_SLIM, 0);
+ pp_end_quote (pp, pp_show_color (pp));
+}
+
/* Dump this path_var to PP (which must support %E for trees).
Express the stack depth using an "@DEPTH" suffix, so e.g. given
if (m_type)
{
gcc_assert (TYPE_P (m_type));
- pp_printf (pp, "type: %qT, ", m_type);
+ pp_string (pp, "type: ");
+ print_quoted_type (pp, m_type);
+ pp_string (pp, ", ");
}
/* vfunc. */
}
if (m_type)
{
- pp_printf (pp, "%s type: %qT", field_prefix, m_type);
+ pp_printf (pp, "%s type: ", field_prefix);
+ print_quoted_type (pp, m_type);
pp_newline (pp);
}
pp_string (pp, "active ");
else
pp_string (pp, "inactive ");
- pp_printf (pp, "view as %qT: ", child->get_type ());
+ pp_string (pp, "view as ");
+ print_quoted_type (pp, child->get_type ());
+ pp_string (pp, ": ");
}
}
m_sval_id.print (pp);
if (m_type)
- pp_printf (pp, ", type: %qT", m_type);
+ {
+ pp_printf (pp, ", type: ");
+ print_quoted_type (pp, m_type);
+ }
}
/* Determine if a pointer to this region must be non-NULL.