start_cfg_edge_event::get_desc (bool can_colorize) const
{
bool user_facing = !flag_analyzer_verbose_edges;
- label_text edge_desc
- = label_text::take (m_sedge->get_description (user_facing));
+ label_text edge_desc (m_sedge->get_description (user_facing));
if (user_facing)
{
if (edge_desc.m_buffer && strlen (edge_desc.m_buffer) > 0)
{
if (logger)
{
- char *desc = sedge->get_description (false);
+ label_text desc (sedge->get_description (false));
logger->log (" sedge: SN:%i -> SN:%i %s",
sedge->m_src->m_index,
sedge->m_dest->m_index,
- desc);
- free (desc);
+ desc.m_buffer);
}
const gimple *last_stmt = src_point.get_supernode ()->get_last_stmt ();
superedge::dump (pretty_printer *pp) const
{
pp_printf (pp, "edge: SN: %i -> SN: %i", m_src->m_index, m_dest->m_index);
- char *desc = get_description (false);
- if (strlen (desc) > 0)
+ label_text desc (get_description (false));
+ if (strlen (desc.m_buffer) > 0)
{
pp_space (pp);
- pp_string (pp, desc);
+ pp_string (pp, desc.m_buffer);
}
- free (desc);
}
/* Dump this superedge to stderr. */
/* Build a description of this superedge (e.g. "true" for the true
edge of a conditional, or "case 42:" for a switch case).
- The caller is responsible for freeing the result.
-
If USER_FACING is false, the result also contains any underlying
CFG edge flags. e.g. " (flags FALLTHRU | DFS_BACK)". */
-char *
+label_text
superedge::get_description (bool user_facing) const
{
pretty_printer pp;
dump_label_to_pp (&pp, user_facing);
- return xstrdup (pp_formatted_text (&pp));
+ return label_text::take (xstrdup (pp_formatted_text (&pp)));
}
/* Implementation of superedge::dump_label_to_pp for non-switch CFG
::edge get_any_cfg_edge () const;
cgraph_edge *get_any_callgraph_edge () const;
- char *get_description (bool user_facing) const;
+ label_text get_description (bool user_facing) const;
protected:
superedge (supernode *src, supernode *dest, enum edge_kind kind)