+2013-08-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * error.c (pp_ggc_formatted_text): New.
+ (type_as_string): Use it in lieu of pp_formatted_text.
+ (type_as_string_translate): Likewise.
+ (expr_as_string): Likewise.
+ (decl_as_string): Likewise.
+ (decl_as_string_translate): Likewise.
+ (lang_decl_name): Likewise.
+ (decl_to_string): Likewise.
+ (expr_to_string): Likewise.
+ (fndecl_to_string): Likewise.
+ (parm_to_string): Likewise.
+ (type_to_string): Likewise.
+ (args_to_string): Likewise.
+ (subst_to_string): Likewise.
+
2013-08-19 Balaji V. Iyer <balaji.v.iyer@intel.com>
PR c/57490
cxx_pp->enclosing_scope = current_function_decl;
}
+/* Same as pp_formatted_text, except the return string is a separate
+ copy and has a GGC storage duration, e.g. an indefinite lifetime. */
+
+inline const char *
+pp_ggc_formatted_text (pretty_printer *pp)
+{
+ return ggc_strdup (pp_formatted_text (pp));
+}
/* Exported interface to stringifying types, exprs and decls under TFF_*
control. */
reinit_cxx_pp ();
pp_translate_identifiers (cxx_pp) = false;
dump_type (cxx_pp, typ, flags);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
const char *
{
reinit_cxx_pp ();
dump_type (cxx_pp, typ, flags);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
const char *
reinit_cxx_pp ();
pp_translate_identifiers (cxx_pp) = false;
dump_expr (cxx_pp, decl, flags);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
/* Wrap decl_as_string with options appropriate for dwarf. */
reinit_cxx_pp ();
pp_translate_identifiers (cxx_pp) = false;
dump_decl (cxx_pp, decl, flags);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
const char *
{
reinit_cxx_pp ();
dump_decl (cxx_pp, decl, flags);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
/* Wrap lang_decl_name with options appropriate for dwarf. */
else
dump_decl (cxx_pp, DECL_NAME (decl), TFF_PLAIN_IDENTIFIER);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
/* Return the location of a tree passed to %+ formats. */
reinit_cxx_pp ();
dump_decl (cxx_pp, decl, flags);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
static const char *
{
reinit_cxx_pp ();
dump_expr (cxx_pp, decl, 0);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
static const char *
flags |= TFF_FUNCTION_DEFAULT_ARGUMENTS;
reinit_cxx_pp ();
dump_decl (cxx_pp, fndecl, flags);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
pp_string (cxx_pp, "'this'");
else
pp_decimal_int (cxx_pp, p + 1);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
static const char *
if (memcmp (p, p+aka_start, len) == 0)
p[len] = '\0';
}
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
static const char *
if (TREE_CHAIN (p))
pp_separate_with_comma (cxx_pp);
}
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
/* Pretty-print a deduction substitution (from deduction_tsubst_fntype). P
pp_cxx_whitespace (cxx_pp);
dump_template_bindings (cxx_pp, tparms, targs, NULL);
pp_cxx_right_bracket (cxx_pp);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
static const char *
reinit_cxx_pp ();
cxx_pp->padding = v ? pp_before : pp_none;
pp_cxx_cv_qualifier_seq (cxx_pp, p);
- return pp_formatted_text (cxx_pp);
+ return pp_ggc_formatted_text (cxx_pp);
}
/* Langhook for print_error_function. */