aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2013-08-05 04:00:57 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2013-08-05 04:00:57 +0000
commitb066401f2654cca7577a6de6d6d4c38701549571 (patch)
tree2a3052c426aacb44697e1d70381e8bd33a240377 /gcc/cp/error.c
parent5edf2c603c09e44850606837dc767e4bca501eca (diff)
downloadgcc-b066401f2654cca7577a6de6d6d4c38701549571.zip
gcc-b066401f2654cca7577a6de6d6d4c38701549571.tar.gz
gcc-b066401f2654cca7577a6de6d6d4c38701549571.tar.bz2
pretty-print.h (pp_base): Remove.
* pretty-print.h (pp_base): Remove. Adjust dependent macros. * diagnostic.h (diagnostic_flush_buffer): Adjust. * pretty-print.c (pp_formatted_text_data): Likewise. (pp_indent): Rename from pp_base_indent. (pp_format): Rename from pp_base_format. (pp_output_formatted_text): Rename from pp_base_output_formatted_text. (pp_format_verbatim): Rename from pp_base_format_verbatim. (pp_flush): Rename from pp_base_flush. (pp_set_line_maximum_length): Rename from pp_base_set_line_maximum_length. (pp_clear_output_area): Rename from pp_base_clear_output_area. (pp_set_prefix): Rename from pp_base_set_prefix. (pp_destroy_prefix): Rename from pp_base_destroy_prefix. (pp_emit_prefix): Rename from pp_base_emit_prefix. (pp_append_text): Rename from pp_base_append_text. (pp_formatted_text): Rename from pp_base_formatted_text. (pp_last_position_in_text): Rename from pp_base_last_position_in_text. (pp_remaining_character_count_for_line): Rename from pp_base_remaining_character_count_for_line. (pp_newline): Rename from pp_base_newline. (pp_character): Rename from pp_base_character. (pp_string): Rename from pp_base_string. (pp_maybe_space): Rename from pp_base_maybe_space. * asan.c (asan_pp_string): Adjust. (asan_emit_stack_protection): Likewise. (asan_add_global): Likewise. * sched-vis.c (str_pattern_slim): Adjust pretty printer function call. * tree-mudflap.c (mf_varname_tree): Likewise. * tree-pretty-print.c (pp_tree_identifier): Rename from pp_base_tree_identifier. * tree-pretty-print.h (pp_tree_identifier): Remove macro definition. Declare as function. c/ * c-objc-common.c (c_initialize_diagnostics): Don't call pp_base. c-family/ * c-pretty-print.h (c_pretty_printer): Derive from pretty_printer. (pp_base): Remove. (pp_c_base): Likewise. Adjust users. * c-pretty-print.c (pp_c_maybe_whitespace): Adjust. (pp_c_whitespace): Do not call pp_base. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_left_brace): Likewise. (pp_c_right_brace): Likewise. (pp_c_left_bracket): Likewise. (pp_c_right_bracket): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_star): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_complement): Likewise. (pp_c_exclamation): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_ws_string): Likewise. (pp_c_identifier): Likewise. (pp_c_statement): Likewise. (print_c_tree): Likewise. cp/ * cxx-pretty-print.h (pp_c_base): Remove. (cxx_pretty_printer): Derive from c_pretty_printer. Adjust macros using pp_c_base. * cp-objcp-common.c (cxx_initialize_diagnostics): Do not call pp_base. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): Likewise. (pp_cxx_colon_colon): Likewise. (pp_cxx_separate_with): Likewise. (pp_cxx_storage_class_specifier): Do not call pp_c_base. (pp_cxx_expression_list): Likewise. (pp_cxx_space_for_pointer_operator): Likewise. (pp_cxx_init_declarator): Likewise. (pp_cxx_call_argument_list): Likewise. (pp_cxx_constant): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_cast_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_statement): Likewise. (pp_cxx_pretty_printer_init): Tidy. * error.c (init_error): Do not use pp_base. (dump_aggr_type): Likewise. (dump_type_prefix): Likewise. (dump_type_suffix): Likewise. (dump_global_iord): Likewise. (dump_decl): Likewise. (dump_function_decl): Likewise. (dump_ref_qualifier): Likewise. (reinit_cxx_pp): Likewise. (decl_as_dwarf_string): Likewise. (lang_decl_dwarf_name): Likewise. (type_to_string): Likewise. (cv_to_string): Likewise. (cxx_print_error_function): Likewise. (cp_diagnostic_starter): Likewise. (cp_diagnostic_finalizer): Likewise. (cp_print_error_function): Likewise. (print_instantiation_context): Likewise. (cp_printer): Likewise. From-SVN: r201479
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c67
1 files changed, 33 insertions, 34 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 887a6ee..440169a 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -108,7 +108,7 @@ init_error (void)
diagnostic_finalizer (global_dc) = cp_diagnostic_finalizer;
diagnostic_format_decoder (global_dc) = cp_printer;
- pp_construct (pp_base (cxx_pp), NULL, 0);
+ pp_construct (cxx_pp, NULL, 0);
pp_cxx_pretty_printer_init (cxx_pp);
}
@@ -654,7 +654,7 @@ dump_aggr_type (tree t, int flags)
if (flags & TFF_CLASS_KEY_OR_ENUM)
pp_string (cxx_pp, M_("<anonymous>"));
else
- pp_printf (pp_base (cxx_pp), M_("<anonymous %s>"), variety);
+ pp_printf (cxx_pp, M_("<anonymous %s>"), variety);
}
else if (LAMBDA_TYPE_P (t))
{
@@ -706,8 +706,7 @@ dump_type_prefix (tree t, int flags)
{
pp_cxx_whitespace (cxx_pp);
pp_cxx_left_paren (cxx_pp);
- pp_c_attributes_display (pp_c_base (cxx_pp),
- TYPE_ATTRIBUTES (sub));
+ pp_c_attributes_display (cxx_pp, TYPE_ATTRIBUTES (sub));
}
if (TYPE_PTR_P (t))
pp_star (cxx_pp);
@@ -718,7 +717,7 @@ dump_type_prefix (tree t, int flags)
else
pp_ampersand (cxx_pp);
}
- pp_base (cxx_pp)->padding = pp_before;
+ cxx_pp->padding = pp_before;
pp_cxx_cv_qualifier_seq (cxx_pp, t);
}
break;
@@ -736,7 +735,7 @@ dump_type_prefix (tree t, int flags)
}
pp_cxx_star (cxx_pp);
pp_cxx_cv_qualifier_seq (cxx_pp, t);
- pp_base (cxx_pp)->padding = pp_before;
+ cxx_pp->padding = pp_before;
break;
/* This can be reached without a pointer when dealing with
@@ -782,7 +781,7 @@ dump_type_prefix (tree t, int flags)
case FIXED_POINT_TYPE:
case NULLPTR_TYPE:
dump_type (t, flags);
- pp_base (cxx_pp)->padding = pp_before;
+ cxx_pp->padding = pp_before;
break;
default:
@@ -829,7 +828,7 @@ dump_type_suffix (tree t, int flags)
anyway; they may in g++, but we'll just pretend otherwise. */
dump_parameters (arg, flags & ~TFF_FUNCTION_DEFAULT_ARGUMENTS);
- pp_base (cxx_pp)->padding = pp_before;
+ cxx_pp->padding = pp_before;
pp_cxx_cv_qualifiers (cxx_pp, type_memfn_quals (t));
dump_ref_qualifier (t, flags);
dump_exception_spec (TYPE_RAISES_EXCEPTIONS (t), flags);
@@ -918,7 +917,7 @@ dump_global_iord (tree t)
else
gcc_unreachable ();
- pp_printf (pp_base (cxx_pp), p, input_filename);
+ pp_printf (cxx_pp, p, input_filename);
}
static void
@@ -1048,7 +1047,7 @@ dump_decl (tree t, int flags)
flags &= ~TFF_UNQUALIFIED_NAME;
if (DECL_NAME (t) == NULL_TREE)
{
- if (!(pp_c_base (cxx_pp)->flags & pp_c_flag_gnu_v3))
+ if (!(cxx_pp->flags & pp_c_flag_gnu_v3))
pp_cxx_ws_string (cxx_pp, M_("{anonymous}"));
else
pp_cxx_ws_string (cxx_pp, M_("(anonymous namespace)"));
@@ -1457,14 +1456,14 @@ dump_function_decl (tree t, int flags)
if (TREE_CODE (fntype) == METHOD_TYPE)
{
- pp_base (cxx_pp)->padding = pp_before;
+ cxx_pp->padding = pp_before;
pp_cxx_cv_qualifier_seq (cxx_pp, class_of_this_parm (fntype));
dump_ref_qualifier (fntype, flags);
}
if (flags & TFF_EXCEPTION_SPECIFICATION)
{
- pp_base (cxx_pp)->padding = pp_before;
+ cxx_pp->padding = pp_before;
dump_exception_spec (exceptions, flags);
}
@@ -1549,7 +1548,7 @@ dump_ref_qualifier (tree t, int flags ATTRIBUTE_UNUSED)
{
if (FUNCTION_REF_QUALIFIED (t))
{
- pp_base (cxx_pp)->padding = pp_before;
+ cxx_pp->padding = pp_before;
if (FUNCTION_RVALUE_QUALIFIED (t))
pp_cxx_ws_string (cxx_pp, "&&");
else
@@ -2615,7 +2614,7 @@ static void
reinit_cxx_pp (void)
{
pp_clear_output_area (cxx_pp);
- pp_base (cxx_pp)->padding = pp_none;
+ cxx_pp->padding = pp_none;
pp_indentation (cxx_pp) = 0;
pp_needs_newline (cxx_pp) = false;
cxx_pp->enclosing_scope = current_function_decl;
@@ -2659,10 +2658,10 @@ decl_as_dwarf_string (tree decl, int flags)
const char *name;
/* Curiously, reinit_cxx_pp doesn't reset the flags field, so setting the flag
here will be adequate to get the desired behaviour. */
- pp_c_base (cxx_pp)->flags |= pp_c_flag_gnu_v3;
+ cxx_pp->flags |= pp_c_flag_gnu_v3;
name = decl_as_string (decl, flags);
/* Subsequent calls to the pretty printer shouldn't use this style. */
- pp_c_base (cxx_pp)->flags &= ~pp_c_flag_gnu_v3;
+ cxx_pp->flags &= ~pp_c_flag_gnu_v3;
return name;
}
@@ -2691,10 +2690,10 @@ lang_decl_dwarf_name (tree decl, int v, bool translate)
const char *name;
/* Curiously, reinit_cxx_pp doesn't reset the flags field, so setting the flag
here will be adequate to get the desired behaviour. */
- pp_c_base (cxx_pp)->flags |= pp_c_flag_gnu_v3;
+ cxx_pp->flags |= pp_c_flag_gnu_v3;
name = lang_decl_name (decl, v, translate);
/* Subsequent calls to the pretty printer shouldn't use this style. */
- pp_c_base (cxx_pp)->flags &= ~pp_c_flag_gnu_v3;
+ cxx_pp->flags &= ~pp_c_flag_gnu_v3;
return name;
}
@@ -2861,7 +2860,7 @@ type_to_string (tree typ, int verbose)
&& !uses_template_parms (typ))
{
int aka_start; char *p;
- struct obstack *ob = pp_base (cxx_pp)->buffer->obstack;
+ struct obstack *ob = cxx_pp->buffer->obstack;
/* Remember the end of the initial dump. */
int len = obstack_object_size (ob);
tree aka = strip_typedefs (typ);
@@ -2943,7 +2942,7 @@ static const char *
cv_to_string (tree p, int v)
{
reinit_cxx_pp ();
- pp_base (cxx_pp)->padding = v ? pp_before : pp_none;
+ cxx_pp->padding = v ? pp_before : pp_none;
pp_cxx_cv_qualifier_seq (cxx_pp, p);
return pp_formatted_text (cxx_pp);
}
@@ -2954,7 +2953,7 @@ cxx_print_error_function (diagnostic_context *context, const char *file,
diagnostic_info *diagnostic)
{
lhd_print_error_function (context, file, diagnostic);
- pp_base_set_prefix (context->printer, file);
+ pp_set_prefix (context->printer, file);
maybe_print_instantiation_context (context);
}
@@ -2966,7 +2965,7 @@ cp_diagnostic_starter (diagnostic_context *context,
cp_print_error_function (context, diagnostic);
maybe_print_instantiation_context (context);
maybe_print_constexpr_context (context);
- pp_base_set_prefix (context->printer, diagnostic_build_prefix (context,
+ pp_set_prefix (context->printer, diagnostic_build_prefix (context,
diagnostic));
}
@@ -2975,7 +2974,7 @@ cp_diagnostic_finalizer (diagnostic_context *context,
diagnostic_info *diagnostic)
{
virt_loc_aware_diagnostic_finalizer (context, diagnostic);
- pp_base_destroy_prefix (context->printer);
+ pp_destroy_prefix (context->printer);
}
/* Print current function onto BUFFER, in the process of reporting
@@ -2996,10 +2995,10 @@ cp_print_error_function (diagnostic_context *context,
char *new_prefix = (file && abstract_origin == NULL)
? file_name_as_prefix (context, file) : NULL;
- pp_base_set_prefix (context->printer, new_prefix);
+ pp_set_prefix (context->printer, new_prefix);
if (current_function_decl == NULL)
- pp_base_string (context->printer, _("At global scope:"));
+ pp_string (context->printer, _("At global scope:"));
else
{
tree fndecl, ao;
@@ -3062,8 +3061,8 @@ cp_print_error_function (diagnostic_context *context,
if (fndecl)
{
expanded_location s = expand_location (*locus);
- pp_base_character (context->printer, ',');
- pp_base_newline (context->printer);
+ pp_character (context->printer, ',');
+ pp_newline (context->printer);
if (s.file != NULL)
{
if (context->show_column && s.column != 0)
@@ -3083,12 +3082,12 @@ cp_print_error_function (diagnostic_context *context,
cxx_printable_name_translate (fndecl, 2));
}
}
- pp_base_character (context->printer, ':');
+ pp_character (context->printer, ':');
}
- pp_base_newline (context->printer);
+ pp_newline (context->printer);
diagnostic_set_last_function (context, diagnostic);
- pp_base_destroy_prefix (context->printer);
+ pp_destroy_prefix (context->printer);
context->printer->prefix = old_prefix;
}
}
@@ -3267,7 +3266,7 @@ print_instantiation_partial_context (diagnostic_context *context,
}
print_instantiation_partial_context_line (context, NULL, loc,
/*recursive_p=*/false);
- pp_base_newline (context->printer);
+ pp_newline (context->printer);
}
/* Called from cp_thing to print the template context for an error. */
@@ -3287,7 +3286,7 @@ print_instantiation_context (void)
{
print_instantiation_partial_context
(global_dc, current_instantiation (), input_location);
- pp_base_newline (global_dc->printer);
+ pp_newline (global_dc->printer);
diagnostic_flush_buffer (global_dc);
}
@@ -3312,7 +3311,7 @@ maybe_print_constexpr_context (diagnostic_context *context)
pp_verbatim (context->printer,
_("%r%s:%d:%R in constexpr expansion of %qs"),
"locus", xloc.file, xloc.line, s);
- pp_base_newline (context->printer);
+ pp_newline (context->printer);
}
}
@@ -3384,7 +3383,7 @@ cp_printer (pretty_printer *pp, text_info *text, const char *spec,
return false;
}
- pp_base_string (pp, result);
+ pp_string (pp, result);
if (set_locus && t != NULL)
*text->locus = location_of (t);
return true;