diff options
author | Gabriel Dos Reis <gdr@integrable-solutions.net> | 2013-08-22 10:14:46 +0000 |
---|---|---|
committer | Gabriel Dos Reis <gdr@gcc.gnu.org> | 2013-08-22 10:14:46 +0000 |
commit | da6ca2b5ee8cf03215697da17fd7f1a4f21bf2ba (patch) | |
tree | 022ef428c3c313c44d9026f48348fe881e59ba87 /gcc/c-family | |
parent | 0e1474e5a6b808f10e251e2e1f3519f9f291d093 (diff) | |
download | gcc-da6ca2b5ee8cf03215697da17fd7f1a4f21bf2ba.zip gcc-da6ca2b5ee8cf03215697da17fd7f1a4f21bf2ba.tar.gz gcc-da6ca2b5ee8cf03215697da17fd7f1a4f21bf2ba.tar.bz2 |
pretty-print.h (output_buffer::output_buffer): Declare.
* pretty-print.h (output_buffer::output_buffer): Declare.
(pretty_printer::pretty_printer): Likewise.
(pp_construct): Remove.
* pretty-print.c (output_buffer::output_buffer): Define.
(pretty_printer::pretty_printer): Rename from pp_construct. Simplify.
* gimple-pretty-print.c (print_gimple_stmt): Do not call pp_construct.
(print_gimple_expr): Likewise.
(print_gimple_seq): Likewise.
(gimple_dump_bb): Likewise.
* sched-vis.c (dump_value_slim): Likewise.
(dump_insn_slim): Likewise.
(dump_rtl_slim): Likewise.
(str_pattern_slim): Likewise.
* tree-mudflap.c (mf_varname_tree): Likewise.
* graph.c (print_graph_cfg): Likewise.
(start_graph_dump): Likewise.
* tree-pretty-print.c (maybe_init_pretty_print): Likewise. Use
placement-new.
* diagnostic.c (diagnostic_initialize): Simplify early diagnostic
pretty printer initialization.
* coretypes.h (diagnostic_context): Remove superflous type alias
declaration.
(pretty_printer): Likewise. Declare directly as a class.
(pretty_print_info): Remove declaration as class.
* asan.c (asan_emit_stack_protection): Remove call to pp_construct
and pp_clear_output_area.
(asan_add_global): Likewise.
c/
* c-objc-common.c (c_initialize_diagnostics): Simplify C pretty
printer initialization.
c-family/
* c-pretty-print.h (pp_c_pretty_printer_init): Remove.
(c_pretty_printer::c_pretty_printer): Declare.
* c-pretty-print.c (pretty_printer::c_pretty_printer): Rename from
c_pretty_printer_init. Adjust.
(print_c_tree): Do not call c_pretty_printer_init.
* c-ada-spec.c (dump_ads): Remove call to pp_construct.
cp/
* error.c (init_error): Remove calls to pp_construct and
pp_cxx_pretty_printer_init. Initialize cxx_pp with placement-new.
* cxx-pretty-print.h (cxx_pretty_printer::cxx_pretty_printer): Declare.
(cxx_pretty_printer_init): Remove.
* cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer):
Rename from cxx_pretty_printer_init. Adjust.
* cp-objcp-common.c (cxx_initialize_diagnostics): Simplify
initialization of C++ diagnostics pretty printer.
From-SVN: r201918
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/c-family/c-ada-spec.c | 1 | ||||
-rw-r--r-- | gcc/c-family/c-pretty-print.c | 67 | ||||
-rw-r--r-- | gcc/c-family/c-pretty-print.h | 3 |
4 files changed, 43 insertions, 37 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 1e053bd..513a927 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,12 @@ +2013-08-22 Gabriel Dos Reis <gdr@integrable-solutions.net> + + * c-pretty-print.h (pp_c_pretty_printer_init): Remove. + (c_pretty_printer::c_pretty_printer): Declare. + * c-pretty-print.c (pretty_printer::c_pretty_printer): Rename from + c_pretty_printer_init. Adjust. + (print_c_tree): Do not call c_pretty_printer_init. + * c-ada-spec.c (dump_ads): Remove call to pp_construct. + 2013-08-09 Arnaud Charlet <charlet@adacore.com> * c-ada-spec.c (print_ada_declaration): Prevent accessing null asm name diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index 22784c9..eac5783 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -3304,7 +3304,6 @@ dump_ads (const char *source_file, { pretty_printer pp; - pp_construct (&pp, NULL, 0); pp_needs_newline (&pp) = true; pp.buffer->stream = f; diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c index fed5802..253dfd1 100644 --- a/gcc/c-family/c-pretty-print.c +++ b/gcc/c-family/c-pretty-print.c @@ -2318,39 +2318,37 @@ pp_c_statement (c_pretty_printer *pp, tree stmt) /* Initialize the PRETTY-PRINTER for handling C codes. */ -void -pp_c_pretty_printer_init (c_pretty_printer *pp) -{ - pp->offset_list = 0; - - pp->flags = 0; - - pp->declaration = pp_c_declaration; - pp->declaration_specifiers = pp_c_declaration_specifiers; - pp->declarator = pp_c_declarator; - pp->direct_declarator = pp_c_direct_declarator; - pp->type_specifier_seq = pp_c_specifier_qualifier_list; - pp->abstract_declarator = pp_c_abstract_declarator; - pp->direct_abstract_declarator = pp_c_direct_abstract_declarator; - pp->ptr_operator = pp_c_pointer; - pp->parameter_list = pp_c_parameter_type_list; - pp->type_id = pp_c_type_id; - pp->simple_type_specifier = pp_c_type_specifier; - pp->function_specifier = pp_c_function_specifier; - pp->storage_class_specifier = pp_c_storage_class_specifier; - - pp->statement = pp_c_statement; - - pp->constant = pp_c_constant; - pp->id_expression = pp_c_id_expression; - pp->primary_expression = pp_c_primary_expression; - pp->postfix_expression = pp_c_postfix_expression; - pp->unary_expression = pp_c_unary_expression; - pp->initializer = pp_c_initializer; - pp->multiplicative_expression = pp_c_multiplicative_expression; - pp->conditional_expression = pp_c_conditional_expression; - pp->assignment_expression = pp_c_assignment_expression; - pp->expression = pp_c_expression; +c_pretty_printer::c_pretty_printer () + : pretty_printer () +{ + offset_list = 0; + flags = 0; + declaration = pp_c_declaration; + declaration_specifiers = pp_c_declaration_specifiers; + declarator = pp_c_declarator; + direct_declarator = pp_c_direct_declarator; + type_specifier_seq = pp_c_specifier_qualifier_list; + abstract_declarator = pp_c_abstract_declarator; + direct_abstract_declarator = pp_c_direct_abstract_declarator; + ptr_operator = pp_c_pointer; + parameter_list = pp_c_parameter_type_list; + type_id = pp_c_type_id; + simple_type_specifier = pp_c_type_specifier; + function_specifier = pp_c_function_specifier; + storage_class_specifier = pp_c_storage_class_specifier; + + statement = pp_c_statement; + + constant = pp_c_constant; + id_expression = pp_c_id_expression; + primary_expression = pp_c_primary_expression; + postfix_expression = pp_c_postfix_expression; + unary_expression = pp_c_unary_expression; + initializer = pp_c_initializer; + multiplicative_expression = pp_c_multiplicative_expression; + conditional_expression = pp_c_conditional_expression; + assignment_expression = pp_c_assignment_expression; + expression = pp_c_expression; } @@ -2360,8 +2358,7 @@ void print_c_tree (FILE *file, tree t) { c_pretty_printer pp; - pp_construct (&pp, NULL, 0); - pp_c_pretty_printer_init (&pp); + pp_needs_newline (&pp) = true; pp.buffer->stream = file; pp_statement (&pp, t); diff --git a/gcc/c-family/c-pretty-print.h b/gcc/c-family/c-pretty-print.h index 390477d..9064755 100644 --- a/gcc/c-family/c-pretty-print.h +++ b/gcc/c-family/c-pretty-print.h @@ -49,6 +49,8 @@ typedef void (*c_pretty_print_fn) (c_pretty_printer *, tree); and cp/cxx-pretty-print.c for an example of derivation. */ struct c_pretty_printer : pretty_printer { + c_pretty_printer (); + /* Points to the first element of an array of offset-list. Not used yet. */ int *offset_list; @@ -120,7 +122,6 @@ struct c_pretty_printer : pretty_printer #define pp_expression(PP, E) (PP)->expression (PP, E) -extern void pp_c_pretty_printer_init (c_pretty_printer *); void pp_c_whitespace (c_pretty_printer *); void pp_c_left_paren (c_pretty_printer *); void pp_c_right_paren (c_pretty_printer *); |