aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-mudflap.c
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2013-08-16 10:42:49 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2013-08-16 10:42:49 +0000
commit4042dca916ad7f5a99438e37416d4fed2209cc6d (patch)
tree1941396b68e43aac5c217d7b53117fdbbf6b6df2 /gcc/tree-mudflap.c
parent5073d50905684dc9069c9e047ed00335450bfe47 (diff)
downloadgcc-4042dca916ad7f5a99438e37416d4fed2209cc6d.zip
gcc-4042dca916ad7f5a99438e37416d4fed2209cc6d.tar.gz
gcc-4042dca916ad7f5a99438e37416d4fed2209cc6d.tar.bz2
sched-vis.c (rtl_slim_pp_initialized): Remove.
* sched-vis.c (rtl_slim_pp_initialized): Remove. (rtl_slim_pp): Likewise. (init_rtl_slim_pretty_print): Likewise. (dump_value_slim): Don't call it. Use local pretty printer. (dump_insn_slim): Likewise. (dump_rtl_slim): Likewise. (str_pattern_slim): Likewise. * tree-mudflap.c (mf_varname_tree): Use local pretty printer. Simplify. From-SVN: r201785
Diffstat (limited to 'gcc/tree-mudflap.c')
-rw-r--r--gcc/tree-mudflap.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index adf2f7b..293ee2c 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -106,20 +106,14 @@ mf_build_string (const char *string)
static tree
mf_varname_tree (tree decl)
{
- static pretty_printer buf_rec;
- static int initialized = 0;
- pretty_printer *buf = & buf_rec;
const char *buf_contents;
tree result;
gcc_assert (decl);
- if (!initialized)
- {
- pp_construct (buf, /* prefix */ NULL, /* line-width */ 0);
- initialized = 1;
- }
- pp_clear_output_area (buf);
+ pretty_printer buf;
+ pp_construct (&buf, /* prefix */ NULL, /* line-width */ 0);
+ pp_clear_output_area (&buf);
/* Add FILENAME[:LINENUMBER[:COLUMNNUMBER]]. */
{
@@ -134,17 +128,17 @@ mf_varname_tree (tree decl)
if (sourcefile == NULL)
sourcefile = "<unknown file>";
- pp_string (buf, sourcefile);
+ pp_string (&buf, sourcefile);
if (sourceline != 0)
{
- pp_colon (buf);
- pp_decimal_int (buf, sourceline);
+ pp_colon (&buf);
+ pp_decimal_int (&buf, sourceline);
if (sourcecolumn != 0)
{
- pp_colon (buf);
- pp_decimal_int (buf, sourcecolumn);
+ pp_colon (&buf);
+ pp_decimal_int (&buf, sourcecolumn);
}
}
}
@@ -152,7 +146,7 @@ mf_varname_tree (tree decl)
if (current_function_decl != NULL_TREE)
{
/* Add (FUNCTION) */
- pp_string (buf, " (");
+ pp_string (&buf, " (");
{
const char *funcname = NULL;
if (DECL_NAME (current_function_decl))
@@ -160,12 +154,12 @@ mf_varname_tree (tree decl)
if (funcname == NULL)
funcname = "anonymous fn";
- pp_string (buf, funcname);
+ pp_string (&buf, funcname);
}
- pp_string (buf, ") ");
+ pp_string (&buf, ") ");
}
else
- pp_space (buf);
+ pp_space (&buf);
/* Add <variable-declaration>, possibly demangled. */
{
@@ -186,13 +180,13 @@ mf_varname_tree (tree decl)
if (declname == NULL)
declname = "<unnamed variable>";
- pp_string (buf, declname);
+ pp_string (&buf, declname);
}
/* Return the lot as a new STRING_CST. */
- buf_contents = pp_formatted_text (buf);
+ buf_contents = ggc_strdup (pp_formatted_text (&buf));
result = mf_build_string (buf_contents);
- pp_clear_output_area (buf);
+ pp_clear_output_area (&buf);
return result;
}