gcc/gcc/cp/cxx-pretty-print.c

2956 lines
71 KiB
C
Raw Normal View History

pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
/* Implementation of subroutines for the GNU C++ pretty-printer.
Copyright (C) 2003-2017 Free Software Foundation, Inc.
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "cp-tree.h"
tree.h: Include real.h and fixed-value.h as basic datatypes. gcc/ChangeLog: * tree.h: Include real.h and fixed-value.h as basic datatypes. * dfp.c, convert.c, reload1.c, reginfo.c, tree-flow.h, tree-ssa-threadedge.c, tree-ssanames.c, tree-loop-linear.c, tree-into-ssa.c, tree-vect-generic.c, tree-ssa-structalias.c, tree-ssa-loop-im.c, tree-dump.c, tree-complex.c, tree-ssa-uninit.c, genrecog.c, tree-ssa-threadupdate.c, tree-ssa-loop-niter.c, tree-pretty-print.c, tree-loop-distribution.c, tree-ssa-loop-unswitch.c, c-lex.c, optabs.c, postreload-gcse.c, tree-ssa-loop-manip.c, postreload.c, tree-ssa-loop-ch.c, tree-tailcall.c, tree.c, reload.c, tree-scalar-evolution.c, rtlanal.c, tree-phinodes.c, builtins.c, final.c, genoutput.c, fold-const.c, tree-ssa-dse.c, genautomata.c, tree-ssa-uncprop.c, toplev.c, tree-chrec.c, genemit.c, c-cppbuiltin.c, tree-ssa-sccvn.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, mode-switching.c, tree-call-cdce.c, cse.c, genpeep.c, tree-ssa-math-opts.c, tree-ssa-dom.c, tree-nrv.c, tree-ssa-propagate.c, tree-ssa-alias.c, tree-ssa-sink.c, jump.c, ifcvt.c, dwarf2out.c, expr.c, genattrtab.c, genconditions.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop.c, tree-parloops.c, recog.c, tree-ssa-address.c, lcm.c, tree-eh.c, gimple-pretty-print.c, c-pretty-print.c, print-rtl.c, gcse.c, tree-if-conv.c, tree-data-ref.c, tree-affine.c, gimplify.c, tree-ssa-phiopt.c, implicit-zee.c, expmed.c, tree-dfa.c, emit-rtl.c, store-motion.c, cselib.c, tree-cfgcleanup.c, simplify-rtx.c, tree-ssa-pre.c, genpreds.c, tree-mudflap.c, print-tree.c, tree-ssa-copy.c, tree-ssa-forwprop.c, tree-ssa-dce.c, varasm.c, tree-nested.c, tree-ssa.c, tree-ssa-loop-prefetch.c, rtl.c, tree-inline.c, integrate.c, tree-optimize.c, tree-ssa-phiprop.c, fixed-value.c, combine.c, tree-profile.c, c-common.c, sched-vis.c, tree-cfg.c, passes.c, tree-ssa-reassoc.c, config/alpha/alpha.c, config/frv/frv.c, config/s390/s390.c, config/m32c/m32c.c, config/spu/spu.c, config/sparc/sparc.c, config/mep/mep.c, config/m32r/m32r.c, config/rx/rx.c, config/i386/i386.c, config/sh/sh.c, config/pdp11/pdp11.c, config/avr/avr.c, config/crx/crx.c, config/xtensa/xtensa.c, config/stormy16/stormy16.c, config/fr30/fr30.c, config/lm32/lm32.c, config/moxie/moxie.c, config/m68hc11/m68hc11.c, config/cris/cris.c, config/iq2000/iq2000.c, config/mn10300/mn10300.c, config/ia64/ia64.c, config/m68k/m68k.c, config/rs6000/rs6000.c, config/picochip/picochip.c, config/darwin.c, config/arc/arc.c, config/mcore/mcore.c, config/score/score3.c, config/score/score7.c, config/score/score.c, config/arm/arm.c, config/pa/pa.c, config/mips/mips.c, config/vax/vax.c, config/h8300/h8300.c, config/v850/v850.c, config/mmix/mmix.c, config/bfin/bfin.c: Clean up redundant includes. * Makefile.in: Update accordingly. java/ChangeLog: * typeck.c, decl.c, jcf-parse.c, except.c, expr.c: cp/Changelog: * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c: Clean up redundant includes. fortran/ChangeLog: * trans-const.c, trans-types.c, trans-intrinsic.c: Clean up redundant includes. From-SVN: r159663
2010-05-21 15:53:22 +02:00
#include "cxx-pretty-print.h"
#include "tree-pretty-print.h"
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
static void pp_cxx_unqualified_id (cxx_pretty_printer *, tree);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void pp_cxx_nested_name_specifier (cxx_pretty_printer *, tree);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
static void pp_cxx_qualified_id (cxx_pretty_printer *, tree);
static void pp_cxx_template_argument_list (cxx_pretty_printer *, tree);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void pp_cxx_type_specifier_seq (cxx_pretty_printer *, tree);
static void pp_cxx_ptr_operator (cxx_pretty_printer *, tree);
static void pp_cxx_parameter_declaration_clause (cxx_pretty_printer *, tree);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void pp_cxx_template_parameter (cxx_pretty_printer *, tree);
static void pp_cxx_cast_expression (cxx_pretty_printer *, tree);
static void pp_cxx_typeid_expression (cxx_pretty_printer *, tree);
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
static void pp_cxx_unary_left_fold_expression (cxx_pretty_printer *, tree);
static void pp_cxx_unary_right_fold_expression (cxx_pretty_printer *, tree);
static void pp_cxx_binary_fold_expression (cxx_pretty_printer *, tree);
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
static inline void
pp_cxx_nonconsecutive_character (cxx_pretty_printer *pp, int c)
{
const char *p = pp_last_position_in_text (pp);
if (p != NULL && *p == c)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_whitespace (pp);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
pp_character (pp, c);
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
2013-08-05 06:00:57 +02:00
pp->padding = pp_none;
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
#define pp_cxx_expression_list(PP, T) \
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
2013-08-05 06:00:57 +02:00
pp_c_expression_list (PP, T)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
#define pp_cxx_space_for_pointer_operator(PP, T) \
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
2013-08-05 06:00:57 +02:00
pp_c_space_for_pointer_operator (PP, T)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
#define pp_cxx_init_declarator(PP, T) \
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
2013-08-05 06:00:57 +02:00
pp_c_init_declarator (PP, T)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
#define pp_cxx_call_argument_list(PP, T) \
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
2013-08-05 06:00:57 +02:00
pp_c_call_argument_list (PP, T)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
void
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_colon_colon (cxx_pretty_printer *pp)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
{
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_colon_colon (pp);
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
2013-08-05 06:00:57 +02:00
pp->padding = pp_none;
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
}
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
void
pp_cxx_begin_template_argument_list (cxx_pretty_printer *pp)
{
pp_cxx_nonconsecutive_character (pp, '<');
}
void
pp_cxx_end_template_argument_list (cxx_pretty_printer *pp)
{
pp_cxx_nonconsecutive_character (pp, '>');
}
void
pp_cxx_separate_with (cxx_pretty_printer *pp, int c)
{
pp_separate_with (pp, c);
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
2013-08-05 06:00:57 +02:00
pp->padding = pp_none;
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
}
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
/* Expressions. */
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static inline bool
is_destructor_name (tree name)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
{
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
return name == complete_dtor_identifier
|| name == base_dtor_identifier
|| name == deleting_dtor_identifier;
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
/* conversion-function-id:
operator conversion-type-id
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
conversion-type-id:
type-specifier-seq conversion-declarator(opt)
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
conversion-declarator:
ptr-operator conversion-declarator(opt) */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static inline void
pp_cxx_conversion_function_id (cxx_pretty_printer *pp, tree t)
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
{
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "operator");
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_type_specifier_seq (pp, TREE_TYPE (t));
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static inline void
pp_cxx_template_id (cxx_pretty_printer *pp, tree t)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
{
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_unqualified_id (pp, TREE_OPERAND (t, 0));
pp_cxx_begin_template_argument_list (pp);
pp_cxx_template_argument_list (pp, TREE_OPERAND (t, 1));
pp_cxx_end_template_argument_list (pp);
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
}
/* Prints the unqualified part of the id-expression T.
unqualified-id:
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
identifier
operator-function-id
conversion-function-id
~ class-name
template-id */
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
static void
pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t)
{
enum tree_code code = TREE_CODE (t);
switch (code)
{
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case RESULT_DECL:
pp->translate_string ("<return-value>");
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case OVERLOAD:
t = OVL_CURRENT (t);
/* FALLTHRU */
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
case VAR_DECL:
case PARM_DECL:
case CONST_DECL:
case TYPE_DECL:
case FUNCTION_DECL:
case NAMESPACE_DECL:
case FIELD_DECL:
case LABEL_DECL:
case USING_DECL:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case TEMPLATE_DECL:
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
t = DECL_NAME (t);
re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. From-SVN: r239410
2016-08-12 12:30:47 +02:00
/* FALLTHRU */
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
case IDENTIFIER_NODE:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (t == NULL)
pp->translate_string ("<unnamed>");
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else if (IDENTIFIER_TYPENAME_P (t))
pp_cxx_conversion_function_id (pp, t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
else
{
if (is_destructor_name (t))
{
pp_complement (pp);
/* FIXME: Why is this necessary? */
if (TREE_TYPE (t))
t = constructor_name (TREE_TYPE (t));
}
pp_cxx_tree_identifier (pp, t);
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
case TEMPLATE_ID_EXPR:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_template_id (pp, t);
break;
case BASELINK:
pp_cxx_unqualified_id (pp, BASELINK_FUNCTIONS (t));
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case RECORD_TYPE:
case UNION_TYPE:
case ENUMERAL_TYPE:
case TYPENAME_TYPE:
case UNBOUND_CLASS_TEMPLATE:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_unqualified_id (pp, TYPE_NAME (t));
if (CLASS_TYPE_P (t) && CLASSTYPE_USE_TEMPLATE (t))
{
pp_cxx_begin_template_argument_list (pp);
pp_cxx_template_argument_list (pp, INNERMOST_TEMPLATE_ARGS
(CLASSTYPE_TI_ARGS (t)));
pp_cxx_end_template_argument_list (pp);
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case BIT_NOT_EXPR:
pp_cxx_complement (pp);
pp_cxx_unqualified_id (pp, TREE_OPERAND (t, 0));
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case TEMPLATE_TYPE_PARM:
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
case TEMPLATE_TEMPLATE_PARM:
if (TYPE_IDENTIFIER (t))
pp_cxx_unqualified_id (pp, TYPE_IDENTIFIER (t));
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
else
pp_cxx_canonical_template_parameter (pp, t);
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case TEMPLATE_PARM_INDEX:
pp_cxx_unqualified_id (pp, TEMPLATE_PARM_DECL (t));
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
case BOUND_TEMPLATE_TEMPLATE_PARM:
pp_cxx_cv_qualifier_seq (pp, t);
pp_cxx_unqualified_id (pp, TYPE_IDENTIFIER (t));
pp_cxx_begin_template_argument_list (pp);
pp_cxx_template_argument_list (pp, TYPE_TI_ARGS (t));
pp_cxx_end_template_argument_list (pp);
break;
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
default:
pp_unsupported_tree (pp, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
}
}
/* Pretty-print out the token sequence ":: template" in template codes
where it is needed to "inline declare" the (following) member as
a template. This situation arises when SCOPE of T is dependent
on template parameters. */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static inline void
pp_cxx_template_keyword_if_needed (cxx_pretty_printer *pp, tree scope, tree t)
{
if (TREE_CODE (t) == TEMPLATE_ID_EXPR
&& TYPE_P (scope) && dependent_type_p (scope))
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "template");
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
/* nested-name-specifier:
class-or-namespace-name :: nested-name-specifier(opt)
class-or-namespace-name :: template nested-name-specifier */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void
pp_cxx_nested_name_specifier (cxx_pretty_printer *pp, tree t)
{
if (!SCOPE_FILE_SCOPE_P (t) && t != pp->enclosing_scope)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
tree scope = get_containing_scope (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_nested_name_specifier (pp, scope);
pp_cxx_template_keyword_if_needed (pp, scope, t);
pp_cxx_unqualified_id (pp, t);
pp_cxx_colon_colon (pp);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
}
}
/* qualified-id:
nested-name-specifier template(opt) unqualified-id */
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
static void
pp_cxx_qualified_id (cxx_pretty_printer *pp, tree t)
{
switch (TREE_CODE (t))
{
/* A pointer-to-member is always qualified. */
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
case PTRMEM_CST:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_nested_name_specifier (pp, PTRMEM_CST_CLASS (t));
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
pp_cxx_unqualified_id (pp, PTRMEM_CST_MEMBER (t));
break;
/* In Standard C++, functions cannot possibly be used as
nested-name-specifiers. However, there are situations where
is "makes sense" to output the surrounding function name for the
purpose of emphasizing on the scope kind. Just printing the
function name might not be sufficient as it may be overloaded; so,
we decorate the function with its signature too.
FIXME: This is probably the wrong pretty-printing for conversion
functions and some function templates. */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case OVERLOAD:
t = OVL_CURRENT (t);
re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. From-SVN: r239410
2016-08-12 12:30:47 +02:00
/* FALLTHRU */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case FUNCTION_DECL:
if (DECL_FUNCTION_MEMBER_P (t))
pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_unqualified_id
(pp, DECL_CONSTRUCTOR_P (t) ? DECL_CONTEXT (t) : t);
pp_cxx_parameter_declaration_clause (pp, TREE_TYPE (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
case OFFSET_REF:
case SCOPE_REF:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_nested_name_specifier (pp, TREE_OPERAND (t, 0));
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
pp_cxx_unqualified_id (pp, TREE_OPERAND (t, 1));
break;
default:
{
tree scope = get_containing_scope (t);
if (scope != pp->enclosing_scope)
{
pp_cxx_nested_name_specifier (pp, scope);
pp_cxx_template_keyword_if_needed (pp, scope, t);
}
pp_cxx_unqualified_id (pp, t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
}
break;
}
}
void
cxx_pretty_printer::constant (tree t)
{
switch (TREE_CODE (t))
{
case STRING_CST:
{
2006-06-06 13:44:09 +02:00
const bool in_parens = PAREN_STRING_LITERAL_P (t);
if (in_parens)
pp_cxx_left_paren (this);
c_pretty_printer::constant (t);
2006-06-06 13:44:09 +02:00
if (in_parens)
pp_cxx_right_paren (this);
}
break;
case INTEGER_CST:
if (NULLPTR_TYPE_P (TREE_TYPE (t)))
{
pp_string (this, "nullptr");
break;
}
re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. From-SVN: r239410
2016-08-12 12:30:47 +02:00
/* fall through. */
default:
c_pretty_printer::constant (t);
break;
}
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
/* id-expression:
unqualified-id
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
qualified-id */
void
cxx_pretty_printer::id_expression (tree t)
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
{
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (TREE_CODE (t) == OVERLOAD)
t = OVL_CURRENT (t);
if (DECL_P (t) && DECL_CONTEXT (t))
pp_cxx_qualified_id (this, t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
else
pp_cxx_unqualified_id (this, t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
}
Implement C++11 user-defined literals. libcpp/ * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix, cpp_userdef_string_remove_type, cpp_userdef_string_add_type, cpp_userdef_char_remove_type, cpp_userdef_char_add_type, cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New. (cpp_classify_number): Classify unrecognized tokens as user-defined literals. * include/cpplib.h: Add new tokens for user-defined literals. * init.c: Add new preprocessor flag (cxx11). * lex.c: (lex_string, lex_raw_string): Handle user-defined literals including concatenation and promotion with suffixes. c-family/ * c-common.c (build_userdef_literal): New. * c-common.def: New tree code. * c-common.h (tree_userdef_literal): New tree struct and accessors. * c-lex.c (interpret_float): Add suffix parm. (c_lex_with_flags): Build literal tokens. cp/ * cp-objcp-common.c: (cp_tree_size) Return size of USERDEF_LITERAL tree. * cp-tree.h: (UDLIT_OP_*, UDLIT_OPER_P): Literal operator name tools. New tree code for user-defined literals. * cxx-pretty-print.h: (pp_cxx_userdef_literal) New. * cxx-pretty-print.c: (pp_cxx_userdef_literal) New. (pp_cxx_primary_expression, pp_cxx_expression): Use it. * decl.c: (cp_tree_node_structure): Return new tree code. (duplicate_decls): Check for raw vs. template operator conflicts. (grokfndecl, grokdeclarator): New checks for literal operators. * error.c: (dump_expr): Warn about user-defined literals in C++98 mode. (dump_function_name): Pretty printing. * mangle.c: (write_literal_operator_name): New. (write_unqualified_id, write_unqualified_name): Use it. * parser.c: (cp_parser_operator): Handle operator"". (cp_parser_userdef_char_literal, cp_parser_userdef_numeric_literal, cp_parser_userdef_string_literal): New. (cp_parser_primary_expression): Handle new user-defined literal tokens with new functions. * semantics.c: (potential_constant_expression_1): Add user-defined literals. * typeck.c (check_raw_literal_operator, check_literal_operator_args): New. From-SVN: r180536
2011-10-26 21:30:59 +02:00
/* user-defined literal:
literal ud-suffix */
void
pp_cxx_userdef_literal (cxx_pretty_printer *pp, tree t)
{
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->constant (USERDEF_LITERAL_VALUE (t));
pp->id_expression (USERDEF_LITERAL_SUFFIX_ID (t));
Implement C++11 user-defined literals. libcpp/ * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix, cpp_userdef_string_remove_type, cpp_userdef_string_add_type, cpp_userdef_char_remove_type, cpp_userdef_char_add_type, cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New. (cpp_classify_number): Classify unrecognized tokens as user-defined literals. * include/cpplib.h: Add new tokens for user-defined literals. * init.c: Add new preprocessor flag (cxx11). * lex.c: (lex_string, lex_raw_string): Handle user-defined literals including concatenation and promotion with suffixes. c-family/ * c-common.c (build_userdef_literal): New. * c-common.def: New tree code. * c-common.h (tree_userdef_literal): New tree struct and accessors. * c-lex.c (interpret_float): Add suffix parm. (c_lex_with_flags): Build literal tokens. cp/ * cp-objcp-common.c: (cp_tree_size) Return size of USERDEF_LITERAL tree. * cp-tree.h: (UDLIT_OP_*, UDLIT_OPER_P): Literal operator name tools. New tree code for user-defined literals. * cxx-pretty-print.h: (pp_cxx_userdef_literal) New. * cxx-pretty-print.c: (pp_cxx_userdef_literal) New. (pp_cxx_primary_expression, pp_cxx_expression): Use it. * decl.c: (cp_tree_node_structure): Return new tree code. (duplicate_decls): Check for raw vs. template operator conflicts. (grokfndecl, grokdeclarator): New checks for literal operators. * error.c: (dump_expr): Warn about user-defined literals in C++98 mode. (dump_function_name): Pretty printing. * mangle.c: (write_literal_operator_name): New. (write_unqualified_id, write_unqualified_name): Use it. * parser.c: (cp_parser_operator): Handle operator"". (cp_parser_userdef_char_literal, cp_parser_userdef_numeric_literal, cp_parser_userdef_string_literal): New. (cp_parser_primary_expression): Handle new user-defined literal tokens with new functions. * semantics.c: (potential_constant_expression_1): Add user-defined literals. * typeck.c (check_raw_literal_operator, check_literal_operator_args): New. From-SVN: r180536
2011-10-26 21:30:59 +02:00
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
/* primary-expression:
literal
this
:: identifier
:: operator-function-id
:: qualifier-id
( expression )
id-expression
GNU Extensions:
__builtin_va_arg ( assignment-expression , type-id )
__builtin_offsetof ( type-id, offsetof-expression )
__builtin_addressof ( expression )
__has_nothrow_assign ( type-id )
__has_nothrow_constructor ( type-id )
__has_nothrow_copy ( type-id )
__has_trivial_assign ( type-id )
__has_trivial_constructor ( type-id )
__has_trivial_copy ( type-id )
__has_unique_object_representations ( type-id )
__has_trivial_destructor ( type-id )
__has_virtual_destructor ( type-id )
__is_abstract ( type-id )
__is_base_of ( type-id , type-id )
__is_class ( type-id )
__is_empty ( type-id )
__is_enum ( type-id )
__is_literal_type ( type-id )
__is_pod ( type-id )
__is_polymorphic ( type-id )
__is_std_layout ( type-id )
__is_trivial ( type-id )
__is_union ( type-id ) */
void
cxx_pretty_printer::primary_expression (tree t)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
{
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
switch (TREE_CODE (t))
{
tree.def (VOID_CST): New. gcc/ * tree.def (VOID_CST): New. * tree-core.h (TI_VOID): New. * tree.h (void_node): New. * tree.c (tree_node_structure_for_code, tree_code_size) (iterative_hash_expr): Handle VOID_CST. (build_common_tree_nodes): Initialize void_node. gcc/c-family/ * c-common.h (CTI_VOID_ZERO, void_zero_node): Delete. * c-common.c (c_common_nodes_and_builtins): Don't initialize void_zero_node. * c-pretty-print.c (pp_c_void_constant): New function. (c_pretty_printer::constant, c_pretty_printer::primary_expression) (c_pretty_printer::expression): Handle VOID_CST. * cilk.c (extract_free_variables): Likewise. * c-ubsan.c (ubsan_instrument_division, ubsan_instrument_shift) (ubsan_instrument_vla): Use void_node instead of void_zero_node. gcc/c/ * c-array-notation.c (expand_array_notations): Use void_node instead of void_zero_node. gcc/cp/ * cvt.c (convert_to_void): Use void_node instead of void_zero_node. * cp-array-notation.c (replace_invariant_exprs): Likewise. (expand_array_notation): Handle VOID_CST. * error.c (dump_expr): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Likewise. (pp_cxx_new_expression): Use void_node instead of void_zero_node. * decl.c (register_dtor_fn): Likewise. * init.c (build_raw_new_expr, build_new_1, build_vec_init) (build_delete, push_base_cleanups): Likewise. * mangle.c (write_expression): Likewise. * semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise. * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise. (tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST. * tree.c (cp_tree_equal): Likewise. (build_dummy_object, is_dummy_object, stabilize_expr): Use void_node instead of void_zero_node. * typeck.c (check_return_expr): Likewise. * typeck2.c (build_functional_cast): Likewise. From-SVN: r210692
2014-05-21 13:00:35 +02:00
case VOID_CST:
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
case INTEGER_CST:
case REAL_CST:
case COMPLEX_CST:
case STRING_CST:
constant (t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
Implement C++11 user-defined literals. libcpp/ * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix, cpp_userdef_string_remove_type, cpp_userdef_string_add_type, cpp_userdef_char_remove_type, cpp_userdef_char_add_type, cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New. (cpp_classify_number): Classify unrecognized tokens as user-defined literals. * include/cpplib.h: Add new tokens for user-defined literals. * init.c: Add new preprocessor flag (cxx11). * lex.c: (lex_string, lex_raw_string): Handle user-defined literals including concatenation and promotion with suffixes. c-family/ * c-common.c (build_userdef_literal): New. * c-common.def: New tree code. * c-common.h (tree_userdef_literal): New tree struct and accessors. * c-lex.c (interpret_float): Add suffix parm. (c_lex_with_flags): Build literal tokens. cp/ * cp-objcp-common.c: (cp_tree_size) Return size of USERDEF_LITERAL tree. * cp-tree.h: (UDLIT_OP_*, UDLIT_OPER_P): Literal operator name tools. New tree code for user-defined literals. * cxx-pretty-print.h: (pp_cxx_userdef_literal) New. * cxx-pretty-print.c: (pp_cxx_userdef_literal) New. (pp_cxx_primary_expression, pp_cxx_expression): Use it. * decl.c: (cp_tree_node_structure): Return new tree code. (duplicate_decls): Check for raw vs. template operator conflicts. (grokfndecl, grokdeclarator): New checks for literal operators. * error.c: (dump_expr): Warn about user-defined literals in C++98 mode. (dump_function_name): Pretty printing. * mangle.c: (write_literal_operator_name): New. (write_unqualified_id, write_unqualified_name): Use it. * parser.c: (cp_parser_operator): Handle operator"". (cp_parser_userdef_char_literal, cp_parser_userdef_numeric_literal, cp_parser_userdef_string_literal): New. (cp_parser_primary_expression): Handle new user-defined literal tokens with new functions. * semantics.c: (potential_constant_expression_1): Add user-defined literals. * typeck.c (check_raw_literal_operator, check_literal_operator_args): New. From-SVN: r180536
2011-10-26 21:30:59 +02:00
case USERDEF_LITERAL:
pp_cxx_userdef_literal (this, t);
Implement C++11 user-defined literals. libcpp/ * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix, cpp_userdef_string_remove_type, cpp_userdef_string_add_type, cpp_userdef_char_remove_type, cpp_userdef_char_add_type, cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New. (cpp_classify_number): Classify unrecognized tokens as user-defined literals. * include/cpplib.h: Add new tokens for user-defined literals. * init.c: Add new preprocessor flag (cxx11). * lex.c: (lex_string, lex_raw_string): Handle user-defined literals including concatenation and promotion with suffixes. c-family/ * c-common.c (build_userdef_literal): New. * c-common.def: New tree code. * c-common.h (tree_userdef_literal): New tree struct and accessors. * c-lex.c (interpret_float): Add suffix parm. (c_lex_with_flags): Build literal tokens. cp/ * cp-objcp-common.c: (cp_tree_size) Return size of USERDEF_LITERAL tree. * cp-tree.h: (UDLIT_OP_*, UDLIT_OPER_P): Literal operator name tools. New tree code for user-defined literals. * cxx-pretty-print.h: (pp_cxx_userdef_literal) New. * cxx-pretty-print.c: (pp_cxx_userdef_literal) New. (pp_cxx_primary_expression, pp_cxx_expression): Use it. * decl.c: (cp_tree_node_structure): Return new tree code. (duplicate_decls): Check for raw vs. template operator conflicts. (grokfndecl, grokdeclarator): New checks for literal operators. * error.c: (dump_expr): Warn about user-defined literals in C++98 mode. (dump_function_name): Pretty printing. * mangle.c: (write_literal_operator_name): New. (write_unqualified_id, write_unqualified_name): Use it. * parser.c: (cp_parser_operator): Handle operator"". (cp_parser_userdef_char_literal, cp_parser_userdef_numeric_literal, cp_parser_userdef_string_literal): New. (cp_parser_primary_expression): Handle new user-defined literal tokens with new functions. * semantics.c: (potential_constant_expression_1): Add user-defined literals. * typeck.c (check_raw_literal_operator, check_literal_operator_args): New. From-SVN: r180536
2011-10-26 21:30:59 +02:00
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case BASELINK:
t = BASELINK_FUNCTIONS (t);
re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. From-SVN: r239410
2016-08-12 12:30:47 +02:00
/* FALLTHRU */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case VAR_DECL:
case PARM_DECL:
case FIELD_DECL:
case FUNCTION_DECL:
case OVERLOAD:
case CONST_DECL:
case TEMPLATE_DECL:
id_expression (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case RESULT_DECL:
case TEMPLATE_TYPE_PARM:
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
case TEMPLATE_TEMPLATE_PARM:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case TEMPLATE_PARM_INDEX:
pp_cxx_unqualified_id (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case STMT_EXPR:
pp_cxx_left_paren (this);
statement (STMT_EXPR_STMT (t));
pp_cxx_right_paren (this);
break;
case TRAIT_EXPR:
pp_cxx_trait_expression (this, t);
break;
case VA_ARG_EXPR:
pp_cxx_va_arg_expression (this, t);
break;
case OFFSETOF_EXPR:
pp_cxx_offsetof_expression (this, t);
break;
case ADDRESSOF_EXPR:
pp_cxx_addressof_expression (this, t);
break;
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
case REQUIRES_EXPR:
pp_cxx_requires_expr (this, t);
break;
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
default:
c_pretty_printer::primary_expression (t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
}
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
/* postfix-expression:
primary-expression
postfix-expression [ expression ]
postfix-expression ( expression-list(opt) )
simple-type-specifier ( expression-list(opt) )
typename ::(opt) nested-name-specifier identifier ( expression-list(opt) )
typename ::(opt) nested-name-specifier template(opt)
template-id ( expression-list(opt) )
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
postfix-expression . template(opt) ::(opt) id-expression
postfix-expression -> template(opt) ::(opt) id-expression
postfix-expression . pseudo-destructor-name
postfix-expression -> pseudo-destructor-name
postfix-expression ++
postfix-expression --
dynamic_cast < type-id > ( expression )
static_cast < type-id > ( expression )
reinterpret_cast < type-id > ( expression )
const_cast < type-id > ( expression )
typeid ( expression )
typeid ( type-id ) */
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
void
cxx_pretty_printer::postfix_expression (tree t)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
{
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
enum tree_code code = TREE_CODE (t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
switch (code)
{
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case AGGR_INIT_EXPR:
case CALL_EXPR:
{
tree fun = cp_get_callee (t);
tree saved_scope = enclosing_scope;
tree.h (enum tree_code_class): Add tcc_vl_exp. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree.h (enum tree_code_class): Add tcc_vl_exp. (VL_EXP_CLASS_P): New. (TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (TREE_OPERAND_CHECK_CODE): Likewise. (GIMPLE_STMT_OPERAND_CHECK): Likewise. (TREE_RTL_OPERAND_CHECK): Likewise. (tree_operand_check_failed): Make second parameter the whole tree instead of its code. Fixed callers. (VL_EXP_CHECK): New. (TREE_OPERAND_LENGTH): New. (VL_EXP_OPERAND_LENGTH): New. (CALL_EXPR_FN): New. (CALL_EXPR_STATIC_CHAIN): New. (CALL_EXPR_ARGS): New. (CALL_EXPR_ARG): New. (call_expr_nargs): New. (CALL_EXPR_ARGP): New. (build_nt_call_list): Declare. (build_vl_exp_stat): Declare. (build_vl_exp): New. (build_call_list): Declare. (build_call_nary): Declare. (build_call_valist): Declare. (build_call_array): Declare. (call_expr_arg): Declare. (call_expr_argp): Declare. (call_expr_arglist): Declare. (fold_build_call_list): Declare. (fold_build_call_list_initializer): Declare. (fold_call_expr): Declare to replace fold_builtin. (fold_builtin_fputs): Update to agree with modified definition. (fold_builtin_strcpy): Likewise. (fold_builtin_strncpy): Likewise. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_next_arg): Likewise. (fold_build_call_expr): Declare. (fold_builtin_call_list): Declare. (fold_builtin_call_valist): Declare. (build_call_expr): Declare. (validate_arglist): Update to agree with modified definition. (tree_operand_length): New. (call_expr_arg_iterator): New. (init_call_expr_arg_iterator): New. (next_call_expr_arg): New. (first_call_expr_arg): New. (more_call_expr_args_p): New. (FOR_EACH_CALL_EXPR_ARG): New. * tree.c (tree_code_class_string): Add entries for tcc_vl_exp and tcc_gimple_stmt. (tree_code_size): Update documentation. Use sizeof (tree) rather than sizeof (char *). (tree_size): Likewise. Add case for tcc_vl_exp. (tree_node_structure): Add case for tcc_vl_exp. (contains_placeholder_p): Likewise. (substitute_in_expr): Likewise. (substitute_placeholder_in_expr): Likewise. (stabilize_reference_1): Likewise. (build3_stat): Remove logic for CALL_EXPRs. Replace with assertion to diagnose breakage of this interface for constructing CALL_EXPRs. (build_nt): Add similar assertion here. (build_nt_call_list): New. (simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors. (iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (get_callee_fndecl): Use new CALL_EXPR accessors. (tree_operand_check_failed): Change parameters to pass entire node instead of its code, so that we can call TREE_OPERAND_LENGTH on it. (process_call_operands): New. (build_vl_exp_stat): New. (build_call_list): New. (build_call_nary): New. (build_call_valist): New. (build_call_array): New. (walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (call_expr_arglist): New. * tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use tcc_vl_exp instead of a fixed-size tcc_expression. * doc/c-tree.texi (CALL_EXPR): Document new representation and accessors for CALL_EXPRs. (AGGR_INIT_EXPR): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * builtins.c (c_strlen): Return NULL_TREE instead of 0. (expand_builtin_nonlocal_goto): Change parameter to be entire CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors. (expand_builtin_prefetch): Likewise. (expand_builtin_classify_type): Likewise. (mathfn_built_in): Return NULL_TREE instead of 0. (expand_errno_check): Use new CALL_EXPR accessors. (expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_int_roundingfn): Likewise. (expand_builtin_int_roundingfn_2): Likewise. (expand_builtin_pow): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead of arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_strstr): Likewise. (expand_builtin_strchr): Likewise. (expand_builtin_strrchr): Likewise. (expand_builtin_strpbrk): Likewise. (expand_builtin_memcpy): Likewise. (expand_builtin_mempcpy): Likewise. (expand_builtin_mempcpy_args): New. (expand_builtin_memmove): Similarly to expand_builtin_mempcpy. (expand_builtin_memmove_args): New. (expand_builtin_bcopy): Similarly to expand_builtin_mempcpy. (expand_movstr): Likewise. (expand_builtin_strcpy): Likewise. (expand_builtin_strcpy_args): New. (expand_builtin_stpcpy): Similarly to expand_builtin_strcpy. (expand_builtin_strncpy): Likewise. (expand_builtin_memset): Likewise. (expand_builtin_memset_args): New. (expand_builtin_bzero): Similarly to expand_builtin_memset. (expand_builtin_memcmp): Likewise. (expand_builtin_strcmp): Likewise. (expand_builtin_strncmp): Likewise. (expand_builtin_strcat): Likewise. (expand_builtin_strncat): Likewise. (expand_builtin_strspn): Likewise. (expand_builtin_strcspn): Likewise. (expand_builtin_args_info): Likewise. (expand_builtin_va_start): Likewise. (gimplify_va_arg_expr): Likewise. (expand_builtin_va_end): Likewise. (expand_builtin_va_copy): Likewise. (expand_builtin_frame_address): Likewise. (expand_builtin_alloca): Likewise. (expand_builtin_bswap): Likewise. (expand_builtin_unop): Likewise. (expand_builtin_fputs): Likewise. (expand_builtin_expect): Likewise. (expand_builtin_fabs): Likewise. (expand_builtin_copysign): Likewise. (expand_builtin_printf): Likewise. (expand_builtin_fprintf): Likewise. (expand_builtin_sprintf): Likewise. (expand_builtin_init_trampoline): Likewise. (expand_builtin_signbit): Likewise. (expand_builtin_fork_or_exec): Likewise. (expand_builtin_sync_operation): Likewise. (expand_builtin_compare_and_swap): Likewise. (expand_builtin_lock_test_and_set): Likewise. (expand_builtin_lock_release): Likewise. (expand_builtin): Likewise. (builtin_mathfn_code): Likewise. (fold_builtin_constant_p): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_expect): Likewise. (fold_builtin_classify_type): Likewise. (fold_builtin_strlen): Likewise. (fold_builtin_nan): Likewise. (integer_valued_real_p): Likewise. (fold_trunc_transparent_mathfn): Likewise. (fold_fixed_mathfn): Likewise. (fold_builtin_cabs): Likewise. (fold_builtin_sqrt): Likewise. (fold_builtin_cbrt): Likewise. (fold_builtin_cos): Likewise. (fold_builtin_cosh): Likewise. (fold_builtin_tan): Likewise. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. (fold_builtin_trunc): Likewise. (fold_builtin_floor): Likewise. (fold_builtin_ceil): Likewise. (fold_builtin_round): Likewise. (fold_builtin_int_roundingfn): Likewise. (fold_builtin_bitop): Likewise. (fold_builtin_bswap): Likewise. (fold_builtin_logarithm): Likewise. (fold_builtin_hypot): Likewise. (fold_builtin_pow): Likewise. (fold_builtin_powi): Likewise. (fold_builtin_exponent): Likewise. (fold_builtin_memset): Likewise. (fold_builtin_bzero): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_bcopy): Deleted; call site changed to invoke fold_builtin_memory_op directly. (fold_builtin_strcpy): Similarly as for fold_builtin_memory_op. (fold_builtin_strncpy): Likewise. (fold_builtin_memcmp): Likewise. (fold_builtin_strcmp): Likewise. (fold_builtin_strncmp): Likewise. (fold_builtin_signbit): Likewise. (fold_builtin_copysign): Likewise. (fold_builtin_isascii): Likewise. (fold_builtin_toascii): Likewise. (fold_builtin_isdigit): Likewise. (fold_builtin_fabs): Likewise. (fold_builtin_abs): Likewise. (fold_builtin_fmin_fmax): Likewise. (fold_builtin_carg): Likewise. (fold_builtin_classify): Likewise. (fold_builtin_unordered_cmp): Likewise. (fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4): New functions split out from fold_builtin_1. (fold_builtin_n): New. (fold_builtin_varargs): New. (fold_builtin): Deleted. Most callers changed to use fold_call_expr instead. (fold_call_expr): New. (build_function_call_expr): Rewrite to use new helper function. (fold_builtin_call_list): New. (build_call_expr): New. (fold_builtin_call_valist): New. (rewrite_call_expr): New. (validate_arg): New. (validate_arglist): Change parameter to be entire CALL_EXPR instead of an arglist. Change return type to bool. Use new CALL_EXPR accessors. (fold_builtin_strstr): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (fold_builtin_strncat): Likewise. (fold_builtin_strspn): Likewise. (fold_builtin_strcspn): Likewise. (fold_builtin_fputs): Likewise. (fold_builtin_next_arg): Likewise. (fold_builtin_sprintf): Likewise. (expand_builtin_object_size): Use new CALL_EXPR accessors. Use NULL_RTX instead of 0. (expand_builtin_memory_chk): Likewise. (maybe_emit_chk_warning): Likewise. (maybe_emit_sprintf_chk_warning): Likewise. (fold_builtin_object_size): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strncat_chk): Likewise. (fold_builtin_sprintf_chk): Likewise. (fold_builtin_snprintf_chk): Likewise. (fold_builtin_printf): Likewise. (fold_builtin_vprintf): Likewise. * fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and constructors. (operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case. (make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (extract_muldiv_1): Add VL_EXP_CLASS_P case. (fold_mathfn_compare): Use new CALL_EXPR accessors and constructors. (fold_unary): Likewise. (fold_binary): Likewise. (fold_ternary): Remove CALL_EXPR case, since they are no longer ternary expressions. (fold): Add logic for tcc_vl_exp. (fold_checksum_tree): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (fold_build3_stat): Add assertion to flag broken interface for constructing CALL_EXPRs. (fold_build_call_list): New. (fold_build_call_list_initializer): New. (tree_expr_nonnegative_p): Use new CALL_EXPR accessors and constructors. (fold_strip_sign_ops): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR accessors and dump arguments explicitly. * tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (dump_generic_node): Use new CALL_EXPR accessors and walk arguments explicitly. (print_call_name): Use new CALL_EXPR accessors. * print-tree.c (print_node): Add case tcc_vl_exp. Print CALL_EXPR arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors. (vrp_visit_stmt): Likewise. * tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (force_move_till_expr): Likewise. * targhooks.c (default_external_stack_protect_fail): Use build_call_expr instead of build_function_call_expr. (default_hidden_stack_protect_fail): Likewise. * tree-complex.c (expand_complex_libcall): Use build_call_expr to build the call. * cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors and walk arguments explicitly. * tree-ssa-loop-niter.c (simplify_replace_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_simple_operations): Likewise. (infer_loop_bounds_from_array): Use new CALL_EXPR accessors. * gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs. * optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * value_prof.c (tree_ic): Use new CALL_EXPR accessors. (tree_ic_transform): Likewise. (interesting_stringop_to_profile_p): Pass entire CALL_EXPR as parameter instead of arglist. Fix callers. (tree_stringop_fixed_value): Use new CALL_EXPR accessors. (tree_stringops_transform): Likewise. (tree_indirect_call_to_profile): Likewise. (tree_stringops_values_to_profile): Likewise. * tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator. (eliminate_tail_call): Likewise. * ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (instantiate_parameters_1): Can't handle tcc_vl_exp here. * omp-low.c (build_omp_barrier): Use build_call_expr. (lower_rec_input_clauses): Likewise. (lower_reduction_clauses): Likewise. (expand_parallel_call): Likewise. (maybe_catch_exception): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_sections): Likewise. (lower_omp_single_simple): Likewise. (lower_omp_single_copy): Likewise. (lower_omp_master): Likewise. (lower_omp_ordered): Likewise. (lower_omp_critical): Likewise. * ipa-reference.c (check-call): Use new CALL_EXPR iterator. (scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR. * tree-gimple.c (is_gimple_call_addr): Fix doc. (recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. Add tcc_vl_exp case. * tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (chrec_contains_undetermined): Likewise. (tree_contains_chrecs): Likewise. (evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH. * cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors. * tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use fold_call_expr instead of fold_builtin. (ccp_fold_builtin): Likewise. Update calls into builtins.c to match declarations there. (fold_stmt): Use new CALL_EXPR constructor and accessors. Doc updates. * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-pure-const.c (check_call): Use new CALL_EXPR accessors. (scan_function): Add case tcc_vl_exp for CALL_EXPR. * tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR accessors. * tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr. (execute_cse_sincos): Use new CALL_EXPR accessors. * tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator. * gimple-low.c (lower_function_body): Use build_call_expr. (lower_builtin_setjmp): Likewise. * expr.c (emit_block_move_via_libcall): Use build_call_expr. (set_storage_via_libcall): Likewise. (safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_expr_real_1): Use new CALL_EXPR accessors. * tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (TB_parent_eq): Likewise. * predict.c (expr_expected_value): Use new CALL_EXPR accessors. (strip_builtin_expect): Likewise. * function.c (gimplify_parameters): Use build_call_expr. * tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-type-escape.c (check_call): Use new CALL_EXPR iterators. (scan_for_refs): Add case tcc_vl_exp for CALL_EXPR. * tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR iterators. * gimplify.c (build_stack_save_restore): Use build_call_expr. (gimplify_decl_expr): Likewise. (gimplify_call_expr): Use fold_call_expr instead of fold_builtin. Use new CALL_EXPR iterators. (gimplify_modify_expr_to_memcpy): Use build_call_expr. (gimplify_modify_expr_to_memset): Likewise. (gimplify_variable_sized_compare): Likewise. (gimplify_omp_atomic_fetch_op): Likewise. (gimplify_omp_atomic_pipeline): Likewise. (gimplify_omp_atomic_mutex): Likewise. (gimplify_function_tree): Likewise. * calls.c (alloca_call_p): Use new CALL_EXPR accessors. (call_expr_flags): Likewise. (expand_call): Likewise. * except.c (expand_builtin_eh_return_data_regno): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. * coverage.c (create_coverage): Use build_call_expr. * tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete. (temp_call_expr_obstack): New. (pool_copy_list): Delete. (temp_copy_call_expr): New. (phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. Get rid of special goo for copying argument lists and use temp_copy_call_expr instead. (valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. (create_expression_by_pieces): Likewise. Use build_call_array to construct the result instead of fold_build3. (create_value_expr_from): Add tcc_vl_exp. Delete special goo for dealing with argument lists. (init_pre): Remove references to expression_node_pool and list_node_pool. Init temp_call_expr_obstack instead. (fini_pre): Remove references to expression_node_pool and list_node_pool. * tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors and walk arguments explicitly instead of as a list. * tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr. (mx_register_decls): Likewise. (mudflap_register_call): Likewise. (mudflap_finish_file): Likewise. * ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors. (ipa_callsite_compute_param): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR accessors and constructor. * tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR accessors and constructor. (convert_tramp_reference): Likewise. (convert_call_expr): Likewise. (finalize_nesting_tree_1): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR accessors. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr. * tree-inline.c (initialize_inlined_parameters): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. (estimate_num_insns_1): Use new CALL_EXPR accessors. (expand_call_inline): Tidy up call to initialize_inlined_parameters. * tree-vect-transform.c (vect_create_epilog_for_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (vectorizable_reduction): Likewise. (vectorizable_call): Use new CALL_EXPR iterators. (vectorizable_conversion): Use build_call_expr. (vectorizable_operation): Use TREE_OPERAND_LENGTH. (vect_gen_widened_results_half): Use build_call_expr. (vect_setup_realignment): Likewise. (vectorizable_live_operation): Use TREE_OPERAND_LENGTH. * tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors. (pass_through_call): Likewise. (compute_object_sizes): Likewise. Use fold_call_expr instead of fold_builtin. * tree-profile.c (tree_gen_interval_profiler): Use build_call_expr. (tree_gen_pow2_profiler): Likewise. (tree_gen_one_value_profiler): Likewise. (tree_gen_ic_func_profiler): Likewise. (tree_gen_average_profiler): Likewise. (tree_gen_ior_profiler): Likewise. * tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp. (find_func_aliases): Use new CALL_EXPR accessors. Add case tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * convert.c (convert_to_real): Use new CALL_EXPR accessors and constructor. (convert_to_integer): Likewise. * tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR accessors. * config/frv/frv.c (frv_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_builtin): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr. (sparc_expand_builtin): Use new CALL_EXPR accessors. * config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise. (ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors on it. Fix callers. (ix86_expand_store_builtin): Likewise. (ix86_expand_unop_builtin): Likewise. (ix86_expand_unop1_builtin): Likewise. (ix86_expand_sse_compare): Likewise. (ix86_expand_sse_comi): Likewise. (ix86_expand_vec_init_builtin): Likewise. (ix86_expand_vec_ext_builtin): Likewise. (ix86_expand_vec_set_builtin): Likewise. (ix86_expand_builtin): Use new CALL_EXPR accessors. * config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (iq2000_expand_builtin): Use new CALL_EXPR accessors. * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use build_call_expr. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. (rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_abs_builtin): Likewise. (rs6000_expand_binop_builtin): Likewise. (altivec_expand_predicate_builtin): Likewise. (altivec_expand_lv_builtin): Likewise. (spe_expand_stv_builtin): Likewise. (altivec_expand_stv_builtin): Likewise. (rs6000_expand_ternop_builtin): Likewise. (altivec_expand_ld_builtin): Use new CALL_EXPR accessors. (altivec_expand_st_builtin): Likewise. (altivec_expand_dst_builtin): Likewise. (altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_vec_set_builtin): Likewise. (altivec_expand_vec_ext_builtin): Likewise. (altivec_expand_builtin): Use new CALL_EXPR accessors. (spe_expand_builtin): Likewise. (spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (spe_expand_evsel_builtin): Likewise. (rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and FCFSX cases must construct whole new CALL_EXPR, not just arglist. * config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (arm_expand_unop_builtin): Likewise. (arm_expand_builtin): Use new CALL_EXPR accessors. * config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR accessors. * config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (bfin_expand_unop_builtin): Likewise. (bfin_expand_builtin): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * c-semantics.c (build_stmt): Add internal diagnostic check. * c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR accessors. Print arguments explicitly instead of as a list. * c-typeck.c (build_function_call): Use new CALL_EXPR constructors. * c-omp.c (c_finish_omp_barrier): Use build_call_expr. (c_finish_omp_flish): Likewise. * c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (check_function_arguments_recurse): Use new CALL_EXPR accessors. (c_warn_unused_result): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. Change class to tcc_vl_exp. * call.c (build_call): Use build_call_list instead of build3. (build_over_call): Likewise. (build_new_method_call): Use build_min_non_dep_call_list instead of build_min_non_dep. * error.c (dump_call_expr_args): New function. (dump_aggr_init_expr_args): New function. (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. * cvt.c (convert_to_void): Use build_call_array instead of build3; use new AGGR_INIT_EXPR accessor macros. * mangle.c (write_expression): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new AGGR_INIT_EXPR accessor macros. * cp-gimplify.c (cp_gimplify_init_expr): Use AGGR_INIT_EXPR_SLOT to set the slot operand. * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. (AGGR_INIT_EXPR_SLOT): New macro. (AGGR_INIT_EXPR_ARG): New macro. (aggr_init_expr_nargs): New macro. (AGGR_INIT_EXPR_ARGP): New macro. (aggr_init_expr_arg_iterator): New. (init_aggr_init_expr_arg_iterator): New. (next_aggr_init_expr_arg): New. (first_aggr_init_expr_arg): New. (more_aggr_init_expr_args_p): New. (FOR_EACH_AGGR_INIT_EXPR_ARG): New. (stabilize_aggr_init): New declaration. (build_min_non_dep_call_list): Likewise. * tree.c (process_aggr_init_operands): New function. (build_aggr_init_array) New function. (build_cplus_new): Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. Replace use of build3 with build_aggr_init_array. (build_min_non_dep_call_list) New function. (build_min_nt): Assert input code parameter is not a variable length expression class. (build_min, build_min_non_dep): Likewise. (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments to check for equality instead of recursing. Handle tcc_vl_exp tree code classes. (stabilize_call): Update to only handle CALL_EXPRs, not AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. (stabilize_aggr_init): New function. (stabilize_init): Use it. * cxx-pretty-print.c (pp_cxx_postfix_expression) <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros and argument iterators. * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with build_vl_exp. Iterate through the operands, recursively processing each one. (tsubst_copy_and_build) <CALL_EXPR>: Update to use new CALL_EXPR accessor macros. (value_dependent_expression_p) <default>: Handle tcc_vl_exp tree code classes. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * semantics.c (finish_call_expr): Use build_nt_call_list instead of build_nt. (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR accessor macros. Use build_call_array to construct the CALL_EXPR node instead of build3 * decl2.c (build_offset_ref_call_from_tree): Use build_nt_call_list and build_min_non_dep_call_list instead of build_min_nt and build_min_non_dep. * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>: Use build_nt_call_list instead of build_min_nt. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead of build3. (BUILD_MONITOR_EXIT): Likewise. * java-gimplify.c (java_gimplify_component_ref): Use build_call_expr. (java_gimplify_modify_expr): Likewise. * class.c (cache_this_class_ref): Use build_call_expr. (build_static_field_ref): Likewise. (emit_indirect_register_classes): Likewise. (emit_register_classes): Likewise. * resource.c (write_resource_constructor): Use build_call_expr. * builtins.c (builtin_creator_function): Change interpretation of the second parameter to be the whole CALL_EXPR instead of the arglist. (max_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (min_builtin): Likewise. (abs_builtin): Likewise. (java_build_function_call_expr): Likewise. (convert_real): Likewise. (UNMARSHAL3): Likewise. (UNMARSHAL4): Likewise. (UNMARSHAL5): Likewise. (build_arglist_for_builtin): Delete. Fix callers to use build_call_expr instead. (putObject_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (compareAndSwapInt_builtin): Likewise. (compareAndSwapLong_builtin): Likewise. (compareAndSwapObject_builtin): Likewise. (putVolatile_builtin): Likewise. (getVolatile_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. (check_for_builtin): Pass entire CALL_EXPR to builtin expander instead of arglist. * expr.c (build_java_athrow): Use build_call_nary instead of build3. (build_java_throw_out_of_bounds_exception): Likewise. (java_check_reference): Likewise. (build_java_arraystore_check): Likewise. (build_newarray): Likewise. (build_anewarray): Likewise. (expand_java_multinewarray): Use build_call_list instead of build3. (build_java_monitor): Use build_call_nary instead of build3. (java_create_object): Likewise. (expand_java_NEW): Likewise. (build_instanceof): Likewise. (expand_java_CHECKCAST): Likewise. (build_java_soft_divmod): Likewise. (build_java_binop): Likewise. (build_field_ref): Likewise. (build_class_init): Likewise. (rewrite_arglist_getcaller): Use build_call_expr. (build_invokeinterface): Use build_call_nary instead of build3. (expand_invoke): Use build_call_list instead of build3. (build_jni_stub): Use build_call_nary, build_call_list, or build_call_expr instead of build3. (expand_java_field_op): Use build_call_expr instead of build3. (force_evaluation_order): Use new CALL_EXPR accessors. * lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors. (objc_get_callee_fndecl): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * trans-expr.c (gfc_conv_power_op): Use build_call_expr. (gfc_conv_string_tmp): Likewise. (gfc_conv_concat_op): Likewise. (gfc_build_compare_string): Likewise. (gfc_conv_function_call): Use build_call_list instead of build3. * trans-array.c (gfc_trans_allocate_array_storage): Use build_call_expr. (gfc_grow_array): Likewise. (gfc_trans_array_ctor_element): Likewise. (gfc_trans_array_constructor_value): Likewise. (gfc_array_allocate): Likewise. (gfc_array_deallocate): Likewise. (gfc_trans_auto_array_allocation): Likewise. (gfc_trans_dummy_array_bias): Likewise. (gfc_conv_array_parameter): Likewise. (gfc_trans_dealloc_allocated): Likewise. (gfc_duplicate_allocatable): Likewise. * trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr. (gfc_trans_omp_flush): Likewise. * trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr. (gfc_trans_pause): Likewise. (gfc_trans_stop): Likewise. (gfc_trans_character_select): Likewise. (gfc_do_allocate): Likewise. (gfc_trans_assign_need_temp): Likewise. (gfc_trans_pointer_assign_need_temp): Likewise. (gfc_trans_forall_1): Likewise. (gfc_trans_where_2): Likewise. (gfc_trans_allocate): Likewise. (gfc_trans_deallocate): Likewise. * trans.c (gfc_trans_runtime_check): Use build_call_expr. * trans-io.c (gfc_trans_open): Use build_call_expr. (gfc_trans_close): Likewise. (build_filepos): Likewise. (gfc_trans_inquire): Likewise. (NML_FIRST_ARG): Delete. (NML_ADD_ARG): Delete. (transfer_namelist_element): Use build_call_expr. (build_dt): Likewise. (gfc_trans_dt_end): Likewise. (transfer_expr): Likewise. (transfer_array-desc): Likewise. * trans-decl.c (gfc_generate_function_code): Use build_call_expr. (gfc_generate_constructors): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr. (gfc_conv_intrinsic_fdate): Likewise. (gfc_conv_intrinsic_ttynam): Likewise. (gfc_conv_intrinsic_array_transfer): Likewise. (gfc_conv_associated): Likewise. (gfc_conv_intrinsic_si_kind): Likewise. (gfc_conv_intrinsic_trim): Likewise. (gfc_conv_intrinsic_repeat: Likewise. (gfc_conv_intrinsic_iargc): Likewise. Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com> Co-Authored-By: Lee Millward <lee.millward@codesourcery.com> From-SVN: r122018
2007-02-16 00:50:49 +01:00
bool skipfirst = false;
tree arg;
if (TREE_CODE (fun) == ADDR_EXPR)
fun = TREE_OPERAND (fun, 0);
/* In templates, where there is no way to tell whether a given
call uses an actual member function. So the parser builds
FUN as a COMPONENT_REF or a plain IDENTIFIER_NODE until
instantiation time. */
if (TREE_CODE (fun) != FUNCTION_DECL)
;
else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fun))
{
tree.h (enum tree_code_class): Add tcc_vl_exp. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree.h (enum tree_code_class): Add tcc_vl_exp. (VL_EXP_CLASS_P): New. (TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (TREE_OPERAND_CHECK_CODE): Likewise. (GIMPLE_STMT_OPERAND_CHECK): Likewise. (TREE_RTL_OPERAND_CHECK): Likewise. (tree_operand_check_failed): Make second parameter the whole tree instead of its code. Fixed callers. (VL_EXP_CHECK): New. (TREE_OPERAND_LENGTH): New. (VL_EXP_OPERAND_LENGTH): New. (CALL_EXPR_FN): New. (CALL_EXPR_STATIC_CHAIN): New. (CALL_EXPR_ARGS): New. (CALL_EXPR_ARG): New. (call_expr_nargs): New. (CALL_EXPR_ARGP): New. (build_nt_call_list): Declare. (build_vl_exp_stat): Declare. (build_vl_exp): New. (build_call_list): Declare. (build_call_nary): Declare. (build_call_valist): Declare. (build_call_array): Declare. (call_expr_arg): Declare. (call_expr_argp): Declare. (call_expr_arglist): Declare. (fold_build_call_list): Declare. (fold_build_call_list_initializer): Declare. (fold_call_expr): Declare to replace fold_builtin. (fold_builtin_fputs): Update to agree with modified definition. (fold_builtin_strcpy): Likewise. (fold_builtin_strncpy): Likewise. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_next_arg): Likewise. (fold_build_call_expr): Declare. (fold_builtin_call_list): Declare. (fold_builtin_call_valist): Declare. (build_call_expr): Declare. (validate_arglist): Update to agree with modified definition. (tree_operand_length): New. (call_expr_arg_iterator): New. (init_call_expr_arg_iterator): New. (next_call_expr_arg): New. (first_call_expr_arg): New. (more_call_expr_args_p): New. (FOR_EACH_CALL_EXPR_ARG): New. * tree.c (tree_code_class_string): Add entries for tcc_vl_exp and tcc_gimple_stmt. (tree_code_size): Update documentation. Use sizeof (tree) rather than sizeof (char *). (tree_size): Likewise. Add case for tcc_vl_exp. (tree_node_structure): Add case for tcc_vl_exp. (contains_placeholder_p): Likewise. (substitute_in_expr): Likewise. (substitute_placeholder_in_expr): Likewise. (stabilize_reference_1): Likewise. (build3_stat): Remove logic for CALL_EXPRs. Replace with assertion to diagnose breakage of this interface for constructing CALL_EXPRs. (build_nt): Add similar assertion here. (build_nt_call_list): New. (simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors. (iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (get_callee_fndecl): Use new CALL_EXPR accessors. (tree_operand_check_failed): Change parameters to pass entire node instead of its code, so that we can call TREE_OPERAND_LENGTH on it. (process_call_operands): New. (build_vl_exp_stat): New. (build_call_list): New. (build_call_nary): New. (build_call_valist): New. (build_call_array): New. (walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (call_expr_arglist): New. * tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use tcc_vl_exp instead of a fixed-size tcc_expression. * doc/c-tree.texi (CALL_EXPR): Document new representation and accessors for CALL_EXPRs. (AGGR_INIT_EXPR): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * builtins.c (c_strlen): Return NULL_TREE instead of 0. (expand_builtin_nonlocal_goto): Change parameter to be entire CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors. (expand_builtin_prefetch): Likewise. (expand_builtin_classify_type): Likewise. (mathfn_built_in): Return NULL_TREE instead of 0. (expand_errno_check): Use new CALL_EXPR accessors. (expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_int_roundingfn): Likewise. (expand_builtin_int_roundingfn_2): Likewise. (expand_builtin_pow): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead of arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_strstr): Likewise. (expand_builtin_strchr): Likewise. (expand_builtin_strrchr): Likewise. (expand_builtin_strpbrk): Likewise. (expand_builtin_memcpy): Likewise. (expand_builtin_mempcpy): Likewise. (expand_builtin_mempcpy_args): New. (expand_builtin_memmove): Similarly to expand_builtin_mempcpy. (expand_builtin_memmove_args): New. (expand_builtin_bcopy): Similarly to expand_builtin_mempcpy. (expand_movstr): Likewise. (expand_builtin_strcpy): Likewise. (expand_builtin_strcpy_args): New. (expand_builtin_stpcpy): Similarly to expand_builtin_strcpy. (expand_builtin_strncpy): Likewise. (expand_builtin_memset): Likewise. (expand_builtin_memset_args): New. (expand_builtin_bzero): Similarly to expand_builtin_memset. (expand_builtin_memcmp): Likewise. (expand_builtin_strcmp): Likewise. (expand_builtin_strncmp): Likewise. (expand_builtin_strcat): Likewise. (expand_builtin_strncat): Likewise. (expand_builtin_strspn): Likewise. (expand_builtin_strcspn): Likewise. (expand_builtin_args_info): Likewise. (expand_builtin_va_start): Likewise. (gimplify_va_arg_expr): Likewise. (expand_builtin_va_end): Likewise. (expand_builtin_va_copy): Likewise. (expand_builtin_frame_address): Likewise. (expand_builtin_alloca): Likewise. (expand_builtin_bswap): Likewise. (expand_builtin_unop): Likewise. (expand_builtin_fputs): Likewise. (expand_builtin_expect): Likewise. (expand_builtin_fabs): Likewise. (expand_builtin_copysign): Likewise. (expand_builtin_printf): Likewise. (expand_builtin_fprintf): Likewise. (expand_builtin_sprintf): Likewise. (expand_builtin_init_trampoline): Likewise. (expand_builtin_signbit): Likewise. (expand_builtin_fork_or_exec): Likewise. (expand_builtin_sync_operation): Likewise. (expand_builtin_compare_and_swap): Likewise. (expand_builtin_lock_test_and_set): Likewise. (expand_builtin_lock_release): Likewise. (expand_builtin): Likewise. (builtin_mathfn_code): Likewise. (fold_builtin_constant_p): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_expect): Likewise. (fold_builtin_classify_type): Likewise. (fold_builtin_strlen): Likewise. (fold_builtin_nan): Likewise. (integer_valued_real_p): Likewise. (fold_trunc_transparent_mathfn): Likewise. (fold_fixed_mathfn): Likewise. (fold_builtin_cabs): Likewise. (fold_builtin_sqrt): Likewise. (fold_builtin_cbrt): Likewise. (fold_builtin_cos): Likewise. (fold_builtin_cosh): Likewise. (fold_builtin_tan): Likewise. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. (fold_builtin_trunc): Likewise. (fold_builtin_floor): Likewise. (fold_builtin_ceil): Likewise. (fold_builtin_round): Likewise. (fold_builtin_int_roundingfn): Likewise. (fold_builtin_bitop): Likewise. (fold_builtin_bswap): Likewise. (fold_builtin_logarithm): Likewise. (fold_builtin_hypot): Likewise. (fold_builtin_pow): Likewise. (fold_builtin_powi): Likewise. (fold_builtin_exponent): Likewise. (fold_builtin_memset): Likewise. (fold_builtin_bzero): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_bcopy): Deleted; call site changed to invoke fold_builtin_memory_op directly. (fold_builtin_strcpy): Similarly as for fold_builtin_memory_op. (fold_builtin_strncpy): Likewise. (fold_builtin_memcmp): Likewise. (fold_builtin_strcmp): Likewise. (fold_builtin_strncmp): Likewise. (fold_builtin_signbit): Likewise. (fold_builtin_copysign): Likewise. (fold_builtin_isascii): Likewise. (fold_builtin_toascii): Likewise. (fold_builtin_isdigit): Likewise. (fold_builtin_fabs): Likewise. (fold_builtin_abs): Likewise. (fold_builtin_fmin_fmax): Likewise. (fold_builtin_carg): Likewise. (fold_builtin_classify): Likewise. (fold_builtin_unordered_cmp): Likewise. (fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4): New functions split out from fold_builtin_1. (fold_builtin_n): New. (fold_builtin_varargs): New. (fold_builtin): Deleted. Most callers changed to use fold_call_expr instead. (fold_call_expr): New. (build_function_call_expr): Rewrite to use new helper function. (fold_builtin_call_list): New. (build_call_expr): New. (fold_builtin_call_valist): New. (rewrite_call_expr): New. (validate_arg): New. (validate_arglist): Change parameter to be entire CALL_EXPR instead of an arglist. Change return type to bool. Use new CALL_EXPR accessors. (fold_builtin_strstr): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (fold_builtin_strncat): Likewise. (fold_builtin_strspn): Likewise. (fold_builtin_strcspn): Likewise. (fold_builtin_fputs): Likewise. (fold_builtin_next_arg): Likewise. (fold_builtin_sprintf): Likewise. (expand_builtin_object_size): Use new CALL_EXPR accessors. Use NULL_RTX instead of 0. (expand_builtin_memory_chk): Likewise. (maybe_emit_chk_warning): Likewise. (maybe_emit_sprintf_chk_warning): Likewise. (fold_builtin_object_size): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strncat_chk): Likewise. (fold_builtin_sprintf_chk): Likewise. (fold_builtin_snprintf_chk): Likewise. (fold_builtin_printf): Likewise. (fold_builtin_vprintf): Likewise. * fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and constructors. (operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case. (make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (extract_muldiv_1): Add VL_EXP_CLASS_P case. (fold_mathfn_compare): Use new CALL_EXPR accessors and constructors. (fold_unary): Likewise. (fold_binary): Likewise. (fold_ternary): Remove CALL_EXPR case, since they are no longer ternary expressions. (fold): Add logic for tcc_vl_exp. (fold_checksum_tree): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (fold_build3_stat): Add assertion to flag broken interface for constructing CALL_EXPRs. (fold_build_call_list): New. (fold_build_call_list_initializer): New. (tree_expr_nonnegative_p): Use new CALL_EXPR accessors and constructors. (fold_strip_sign_ops): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR accessors and dump arguments explicitly. * tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (dump_generic_node): Use new CALL_EXPR accessors and walk arguments explicitly. (print_call_name): Use new CALL_EXPR accessors. * print-tree.c (print_node): Add case tcc_vl_exp. Print CALL_EXPR arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors. (vrp_visit_stmt): Likewise. * tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (force_move_till_expr): Likewise. * targhooks.c (default_external_stack_protect_fail): Use build_call_expr instead of build_function_call_expr. (default_hidden_stack_protect_fail): Likewise. * tree-complex.c (expand_complex_libcall): Use build_call_expr to build the call. * cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors and walk arguments explicitly. * tree-ssa-loop-niter.c (simplify_replace_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_simple_operations): Likewise. (infer_loop_bounds_from_array): Use new CALL_EXPR accessors. * gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs. * optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * value_prof.c (tree_ic): Use new CALL_EXPR accessors. (tree_ic_transform): Likewise. (interesting_stringop_to_profile_p): Pass entire CALL_EXPR as parameter instead of arglist. Fix callers. (tree_stringop_fixed_value): Use new CALL_EXPR accessors. (tree_stringops_transform): Likewise. (tree_indirect_call_to_profile): Likewise. (tree_stringops_values_to_profile): Likewise. * tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator. (eliminate_tail_call): Likewise. * ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (instantiate_parameters_1): Can't handle tcc_vl_exp here. * omp-low.c (build_omp_barrier): Use build_call_expr. (lower_rec_input_clauses): Likewise. (lower_reduction_clauses): Likewise. (expand_parallel_call): Likewise. (maybe_catch_exception): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_sections): Likewise. (lower_omp_single_simple): Likewise. (lower_omp_single_copy): Likewise. (lower_omp_master): Likewise. (lower_omp_ordered): Likewise. (lower_omp_critical): Likewise. * ipa-reference.c (check-call): Use new CALL_EXPR iterator. (scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR. * tree-gimple.c (is_gimple_call_addr): Fix doc. (recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. Add tcc_vl_exp case. * tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (chrec_contains_undetermined): Likewise. (tree_contains_chrecs): Likewise. (evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH. * cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors. * tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use fold_call_expr instead of fold_builtin. (ccp_fold_builtin): Likewise. Update calls into builtins.c to match declarations there. (fold_stmt): Use new CALL_EXPR constructor and accessors. Doc updates. * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-pure-const.c (check_call): Use new CALL_EXPR accessors. (scan_function): Add case tcc_vl_exp for CALL_EXPR. * tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR accessors. * tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr. (execute_cse_sincos): Use new CALL_EXPR accessors. * tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator. * gimple-low.c (lower_function_body): Use build_call_expr. (lower_builtin_setjmp): Likewise. * expr.c (emit_block_move_via_libcall): Use build_call_expr. (set_storage_via_libcall): Likewise. (safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_expr_real_1): Use new CALL_EXPR accessors. * tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (TB_parent_eq): Likewise. * predict.c (expr_expected_value): Use new CALL_EXPR accessors. (strip_builtin_expect): Likewise. * function.c (gimplify_parameters): Use build_call_expr. * tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-type-escape.c (check_call): Use new CALL_EXPR iterators. (scan_for_refs): Add case tcc_vl_exp for CALL_EXPR. * tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR iterators. * gimplify.c (build_stack_save_restore): Use build_call_expr. (gimplify_decl_expr): Likewise. (gimplify_call_expr): Use fold_call_expr instead of fold_builtin. Use new CALL_EXPR iterators. (gimplify_modify_expr_to_memcpy): Use build_call_expr. (gimplify_modify_expr_to_memset): Likewise. (gimplify_variable_sized_compare): Likewise. (gimplify_omp_atomic_fetch_op): Likewise. (gimplify_omp_atomic_pipeline): Likewise. (gimplify_omp_atomic_mutex): Likewise. (gimplify_function_tree): Likewise. * calls.c (alloca_call_p): Use new CALL_EXPR accessors. (call_expr_flags): Likewise. (expand_call): Likewise. * except.c (expand_builtin_eh_return_data_regno): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. * coverage.c (create_coverage): Use build_call_expr. * tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete. (temp_call_expr_obstack): New. (pool_copy_list): Delete. (temp_copy_call_expr): New. (phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. Get rid of special goo for copying argument lists and use temp_copy_call_expr instead. (valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. (create_expression_by_pieces): Likewise. Use build_call_array to construct the result instead of fold_build3. (create_value_expr_from): Add tcc_vl_exp. Delete special goo for dealing with argument lists. (init_pre): Remove references to expression_node_pool and list_node_pool. Init temp_call_expr_obstack instead. (fini_pre): Remove references to expression_node_pool and list_node_pool. * tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors and walk arguments explicitly instead of as a list. * tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr. (mx_register_decls): Likewise. (mudflap_register_call): Likewise. (mudflap_finish_file): Likewise. * ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors. (ipa_callsite_compute_param): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR accessors and constructor. * tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR accessors and constructor. (convert_tramp_reference): Likewise. (convert_call_expr): Likewise. (finalize_nesting_tree_1): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR accessors. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr. * tree-inline.c (initialize_inlined_parameters): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. (estimate_num_insns_1): Use new CALL_EXPR accessors. (expand_call_inline): Tidy up call to initialize_inlined_parameters. * tree-vect-transform.c (vect_create_epilog_for_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (vectorizable_reduction): Likewise. (vectorizable_call): Use new CALL_EXPR iterators. (vectorizable_conversion): Use build_call_expr. (vectorizable_operation): Use TREE_OPERAND_LENGTH. (vect_gen_widened_results_half): Use build_call_expr. (vect_setup_realignment): Likewise. (vectorizable_live_operation): Use TREE_OPERAND_LENGTH. * tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors. (pass_through_call): Likewise. (compute_object_sizes): Likewise. Use fold_call_expr instead of fold_builtin. * tree-profile.c (tree_gen_interval_profiler): Use build_call_expr. (tree_gen_pow2_profiler): Likewise. (tree_gen_one_value_profiler): Likewise. (tree_gen_ic_func_profiler): Likewise. (tree_gen_average_profiler): Likewise. (tree_gen_ior_profiler): Likewise. * tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp. (find_func_aliases): Use new CALL_EXPR accessors. Add case tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * convert.c (convert_to_real): Use new CALL_EXPR accessors and constructor. (convert_to_integer): Likewise. * tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR accessors. * config/frv/frv.c (frv_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_builtin): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr. (sparc_expand_builtin): Use new CALL_EXPR accessors. * config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise. (ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors on it. Fix callers. (ix86_expand_store_builtin): Likewise. (ix86_expand_unop_builtin): Likewise. (ix86_expand_unop1_builtin): Likewise. (ix86_expand_sse_compare): Likewise. (ix86_expand_sse_comi): Likewise. (ix86_expand_vec_init_builtin): Likewise. (ix86_expand_vec_ext_builtin): Likewise. (ix86_expand_vec_set_builtin): Likewise. (ix86_expand_builtin): Use new CALL_EXPR accessors. * config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (iq2000_expand_builtin): Use new CALL_EXPR accessors. * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use build_call_expr. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. (rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_abs_builtin): Likewise. (rs6000_expand_binop_builtin): Likewise. (altivec_expand_predicate_builtin): Likewise. (altivec_expand_lv_builtin): Likewise. (spe_expand_stv_builtin): Likewise. (altivec_expand_stv_builtin): Likewise. (rs6000_expand_ternop_builtin): Likewise. (altivec_expand_ld_builtin): Use new CALL_EXPR accessors. (altivec_expand_st_builtin): Likewise. (altivec_expand_dst_builtin): Likewise. (altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_vec_set_builtin): Likewise. (altivec_expand_vec_ext_builtin): Likewise. (altivec_expand_builtin): Use new CALL_EXPR accessors. (spe_expand_builtin): Likewise. (spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (spe_expand_evsel_builtin): Likewise. (rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and FCFSX cases must construct whole new CALL_EXPR, not just arglist. * config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (arm_expand_unop_builtin): Likewise. (arm_expand_builtin): Use new CALL_EXPR accessors. * config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR accessors. * config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (bfin_expand_unop_builtin): Likewise. (bfin_expand_builtin): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * c-semantics.c (build_stmt): Add internal diagnostic check. * c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR accessors. Print arguments explicitly instead of as a list. * c-typeck.c (build_function_call): Use new CALL_EXPR constructors. * c-omp.c (c_finish_omp_barrier): Use build_call_expr. (c_finish_omp_flish): Likewise. * c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (check_function_arguments_recurse): Use new CALL_EXPR accessors. (c_warn_unused_result): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. Change class to tcc_vl_exp. * call.c (build_call): Use build_call_list instead of build3. (build_over_call): Likewise. (build_new_method_call): Use build_min_non_dep_call_list instead of build_min_non_dep. * error.c (dump_call_expr_args): New function. (dump_aggr_init_expr_args): New function. (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. * cvt.c (convert_to_void): Use build_call_array instead of build3; use new AGGR_INIT_EXPR accessor macros. * mangle.c (write_expression): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new AGGR_INIT_EXPR accessor macros. * cp-gimplify.c (cp_gimplify_init_expr): Use AGGR_INIT_EXPR_SLOT to set the slot operand. * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. (AGGR_INIT_EXPR_SLOT): New macro. (AGGR_INIT_EXPR_ARG): New macro. (aggr_init_expr_nargs): New macro. (AGGR_INIT_EXPR_ARGP): New macro. (aggr_init_expr_arg_iterator): New. (init_aggr_init_expr_arg_iterator): New. (next_aggr_init_expr_arg): New. (first_aggr_init_expr_arg): New. (more_aggr_init_expr_args_p): New. (FOR_EACH_AGGR_INIT_EXPR_ARG): New. (stabilize_aggr_init): New declaration. (build_min_non_dep_call_list): Likewise. * tree.c (process_aggr_init_operands): New function. (build_aggr_init_array) New function. (build_cplus_new): Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. Replace use of build3 with build_aggr_init_array. (build_min_non_dep_call_list) New function. (build_min_nt): Assert input code parameter is not a variable length expression class. (build_min, build_min_non_dep): Likewise. (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments to check for equality instead of recursing. Handle tcc_vl_exp tree code classes. (stabilize_call): Update to only handle CALL_EXPRs, not AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. (stabilize_aggr_init): New function. (stabilize_init): Use it. * cxx-pretty-print.c (pp_cxx_postfix_expression) <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros and argument iterators. * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with build_vl_exp. Iterate through the operands, recursively processing each one. (tsubst_copy_and_build) <CALL_EXPR>: Update to use new CALL_EXPR accessor macros. (value_dependent_expression_p) <default>: Handle tcc_vl_exp tree code classes. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * semantics.c (finish_call_expr): Use build_nt_call_list instead of build_nt. (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR accessor macros. Use build_call_array to construct the CALL_EXPR node instead of build3 * decl2.c (build_offset_ref_call_from_tree): Use build_nt_call_list and build_min_non_dep_call_list instead of build_min_nt and build_min_non_dep. * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>: Use build_nt_call_list instead of build_min_nt. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead of build3. (BUILD_MONITOR_EXIT): Likewise. * java-gimplify.c (java_gimplify_component_ref): Use build_call_expr. (java_gimplify_modify_expr): Likewise. * class.c (cache_this_class_ref): Use build_call_expr. (build_static_field_ref): Likewise. (emit_indirect_register_classes): Likewise. (emit_register_classes): Likewise. * resource.c (write_resource_constructor): Use build_call_expr. * builtins.c (builtin_creator_function): Change interpretation of the second parameter to be the whole CALL_EXPR instead of the arglist. (max_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (min_builtin): Likewise. (abs_builtin): Likewise. (java_build_function_call_expr): Likewise. (convert_real): Likewise. (UNMARSHAL3): Likewise. (UNMARSHAL4): Likewise. (UNMARSHAL5): Likewise. (build_arglist_for_builtin): Delete. Fix callers to use build_call_expr instead. (putObject_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (compareAndSwapInt_builtin): Likewise. (compareAndSwapLong_builtin): Likewise. (compareAndSwapObject_builtin): Likewise. (putVolatile_builtin): Likewise. (getVolatile_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. (check_for_builtin): Pass entire CALL_EXPR to builtin expander instead of arglist. * expr.c (build_java_athrow): Use build_call_nary instead of build3. (build_java_throw_out_of_bounds_exception): Likewise. (java_check_reference): Likewise. (build_java_arraystore_check): Likewise. (build_newarray): Likewise. (build_anewarray): Likewise. (expand_java_multinewarray): Use build_call_list instead of build3. (build_java_monitor): Use build_call_nary instead of build3. (java_create_object): Likewise. (expand_java_NEW): Likewise. (build_instanceof): Likewise. (expand_java_CHECKCAST): Likewise. (build_java_soft_divmod): Likewise. (build_java_binop): Likewise. (build_field_ref): Likewise. (build_class_init): Likewise. (rewrite_arglist_getcaller): Use build_call_expr. (build_invokeinterface): Use build_call_nary instead of build3. (expand_invoke): Use build_call_list instead of build3. (build_jni_stub): Use build_call_nary, build_call_list, or build_call_expr instead of build3. (expand_java_field_op): Use build_call_expr instead of build3. (force_evaluation_order): Use new CALL_EXPR accessors. * lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors. (objc_get_callee_fndecl): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * trans-expr.c (gfc_conv_power_op): Use build_call_expr. (gfc_conv_string_tmp): Likewise. (gfc_conv_concat_op): Likewise. (gfc_build_compare_string): Likewise. (gfc_conv_function_call): Use build_call_list instead of build3. * trans-array.c (gfc_trans_allocate_array_storage): Use build_call_expr. (gfc_grow_array): Likewise. (gfc_trans_array_ctor_element): Likewise. (gfc_trans_array_constructor_value): Likewise. (gfc_array_allocate): Likewise. (gfc_array_deallocate): Likewise. (gfc_trans_auto_array_allocation): Likewise. (gfc_trans_dummy_array_bias): Likewise. (gfc_conv_array_parameter): Likewise. (gfc_trans_dealloc_allocated): Likewise. (gfc_duplicate_allocatable): Likewise. * trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr. (gfc_trans_omp_flush): Likewise. * trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr. (gfc_trans_pause): Likewise. (gfc_trans_stop): Likewise. (gfc_trans_character_select): Likewise. (gfc_do_allocate): Likewise. (gfc_trans_assign_need_temp): Likewise. (gfc_trans_pointer_assign_need_temp): Likewise. (gfc_trans_forall_1): Likewise. (gfc_trans_where_2): Likewise. (gfc_trans_allocate): Likewise. (gfc_trans_deallocate): Likewise. * trans.c (gfc_trans_runtime_check): Use build_call_expr. * trans-io.c (gfc_trans_open): Use build_call_expr. (gfc_trans_close): Likewise. (build_filepos): Likewise. (gfc_trans_inquire): Likewise. (NML_FIRST_ARG): Delete. (NML_ADD_ARG): Delete. (transfer_namelist_element): Use build_call_expr. (build_dt): Likewise. (gfc_trans_dt_end): Likewise. (transfer_expr): Likewise. (transfer_array-desc): Likewise. * trans-decl.c (gfc_generate_function_code): Use build_call_expr. (gfc_generate_constructors): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr. (gfc_conv_intrinsic_fdate): Likewise. (gfc_conv_intrinsic_ttynam): Likewise. (gfc_conv_intrinsic_array_transfer): Likewise. (gfc_conv_associated): Likewise. (gfc_conv_intrinsic_si_kind): Likewise. (gfc_conv_intrinsic_trim): Likewise. (gfc_conv_intrinsic_repeat: Likewise. (gfc_conv_intrinsic_iargc): Likewise. Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com> Co-Authored-By: Lee Millward <lee.millward@codesourcery.com> From-SVN: r122018
2007-02-16 00:50:49 +01:00
tree object = (code == AGGR_INIT_EXPR
? (AGGR_INIT_VIA_CTOR_P (t)
? AGGR_INIT_EXPR_SLOT (t)
: AGGR_INIT_EXPR_ARG (t, 0))
: CALL_EXPR_ARG (t, 0));
while (TREE_CODE (object) == NOP_EXPR)
object = TREE_OPERAND (object, 0);
if (TREE_CODE (object) == ADDR_EXPR)
object = TREE_OPERAND (object, 0);
call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P. 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com> * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P. (build_op_call_1): Likewise. (build_over_call): Likewise. (compare_ics): Likewise. * class.c (build_base_path): Likewise. (resolve_address_of_overloaded_function): Likewise. * cp-tree.h: Likewise. * cvt.c (cp_convert_to_pointer): Likewise. (convert_to_reference): Likewise. (ocp_convert): Likewise. (convert_force): Likewise, tidy. * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise. (pp_cxx_ptr_operator): Likewise. * decl.c (duplicate_decls): Likewise. (start_decl): Likewise. (grok_op_properties): Likewise. (start_preparsed_function): Likewise. (store_parm_decls): Likewise. (finish_function): Likewise. * decl2.c (delete_sanity): Likewise. (acceptable_java_type): Likewise. (grokbitfield): Likewise. (cp_reconstruct_complex_type): Likewise. * error.c (dump_type_prefix): Likewise. (dump_expr): Likewise. * except.c (push_eh_cleanup): Likewise. (complete_ptr_ref_or_void_ptr_p): Likewise. (can_convert_eh): Likewise. * init.c (build_new_1): Likewise. (build_delete): Likewise. (build_vec_delete): Likewise. * mangle.c (write_type): Likewise. * parser.c (lookup_literal_operator): Likewise. * pt.c (convert_nontype_argument_function): Likewise. (convert_nontype_argument): Likewise. (tsubst): Likewise. (unify): Likewise. (dependent_type_p_r): Likewise. * rtti.c (build_headof): Likewise. (build_typeid): Likewise. (build_dynamic_cast_1): Likewise. (target_incomplete_p): Likewise. (typeinfo_in_lib_p): Likewise. * semantics.c (finish_omp_for): Likewise. (cxx_eval_call_expression): Likewise. (maybe_resolve_dummy): Likewise. * tree.c (build_target_expr): Likewise. (cp_build_qualified_type_real): Likewise. * typeck.c (composite_pointer_type_r): Likewise. (composite_pointer_type): Likewise. (comp_except_types): Likewise. (cxx_sizeof_nowarn): Likewise. (string_conv_p): Likewise. (cp_build_array_ref): Likewise. (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P. (pointer_diff): Likewise. (cp_build_addr_expr_1): Likewise. (cp_build_unary_op): Likewise. (build_static_cast_1): Likewise. (cp_build_c_cast): Likewise. (comp_ptr_ttypes_real): Likewise. (ptr_reasonably_similar): Likewise. (comp_ptr_ttypes_const): Likewise. (casts_away_constness): Likewise. (check_literal_operator_args): Likewise. * typeck2.c (build_x_arrow): Likewise. (add_exception_specifier): Likewise. From-SVN: r197249
2013-03-29 21:29:26 +01:00
if (!TYPE_PTR_P (TREE_TYPE (object)))
{
postfix_expression (object);
pp_cxx_dot (this);
}
else
{
postfix_expression (object);
pp_cxx_arrow (this);
}
tree.h (enum tree_code_class): Add tcc_vl_exp. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree.h (enum tree_code_class): Add tcc_vl_exp. (VL_EXP_CLASS_P): New. (TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (TREE_OPERAND_CHECK_CODE): Likewise. (GIMPLE_STMT_OPERAND_CHECK): Likewise. (TREE_RTL_OPERAND_CHECK): Likewise. (tree_operand_check_failed): Make second parameter the whole tree instead of its code. Fixed callers. (VL_EXP_CHECK): New. (TREE_OPERAND_LENGTH): New. (VL_EXP_OPERAND_LENGTH): New. (CALL_EXPR_FN): New. (CALL_EXPR_STATIC_CHAIN): New. (CALL_EXPR_ARGS): New. (CALL_EXPR_ARG): New. (call_expr_nargs): New. (CALL_EXPR_ARGP): New. (build_nt_call_list): Declare. (build_vl_exp_stat): Declare. (build_vl_exp): New. (build_call_list): Declare. (build_call_nary): Declare. (build_call_valist): Declare. (build_call_array): Declare. (call_expr_arg): Declare. (call_expr_argp): Declare. (call_expr_arglist): Declare. (fold_build_call_list): Declare. (fold_build_call_list_initializer): Declare. (fold_call_expr): Declare to replace fold_builtin. (fold_builtin_fputs): Update to agree with modified definition. (fold_builtin_strcpy): Likewise. (fold_builtin_strncpy): Likewise. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_next_arg): Likewise. (fold_build_call_expr): Declare. (fold_builtin_call_list): Declare. (fold_builtin_call_valist): Declare. (build_call_expr): Declare. (validate_arglist): Update to agree with modified definition. (tree_operand_length): New. (call_expr_arg_iterator): New. (init_call_expr_arg_iterator): New. (next_call_expr_arg): New. (first_call_expr_arg): New. (more_call_expr_args_p): New. (FOR_EACH_CALL_EXPR_ARG): New. * tree.c (tree_code_class_string): Add entries for tcc_vl_exp and tcc_gimple_stmt. (tree_code_size): Update documentation. Use sizeof (tree) rather than sizeof (char *). (tree_size): Likewise. Add case for tcc_vl_exp. (tree_node_structure): Add case for tcc_vl_exp. (contains_placeholder_p): Likewise. (substitute_in_expr): Likewise. (substitute_placeholder_in_expr): Likewise. (stabilize_reference_1): Likewise. (build3_stat): Remove logic for CALL_EXPRs. Replace with assertion to diagnose breakage of this interface for constructing CALL_EXPRs. (build_nt): Add similar assertion here. (build_nt_call_list): New. (simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors. (iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (get_callee_fndecl): Use new CALL_EXPR accessors. (tree_operand_check_failed): Change parameters to pass entire node instead of its code, so that we can call TREE_OPERAND_LENGTH on it. (process_call_operands): New. (build_vl_exp_stat): New. (build_call_list): New. (build_call_nary): New. (build_call_valist): New. (build_call_array): New. (walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (call_expr_arglist): New. * tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use tcc_vl_exp instead of a fixed-size tcc_expression. * doc/c-tree.texi (CALL_EXPR): Document new representation and accessors for CALL_EXPRs. (AGGR_INIT_EXPR): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * builtins.c (c_strlen): Return NULL_TREE instead of 0. (expand_builtin_nonlocal_goto): Change parameter to be entire CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors. (expand_builtin_prefetch): Likewise. (expand_builtin_classify_type): Likewise. (mathfn_built_in): Return NULL_TREE instead of 0. (expand_errno_check): Use new CALL_EXPR accessors. (expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_int_roundingfn): Likewise. (expand_builtin_int_roundingfn_2): Likewise. (expand_builtin_pow): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead of arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_strstr): Likewise. (expand_builtin_strchr): Likewise. (expand_builtin_strrchr): Likewise. (expand_builtin_strpbrk): Likewise. (expand_builtin_memcpy): Likewise. (expand_builtin_mempcpy): Likewise. (expand_builtin_mempcpy_args): New. (expand_builtin_memmove): Similarly to expand_builtin_mempcpy. (expand_builtin_memmove_args): New. (expand_builtin_bcopy): Similarly to expand_builtin_mempcpy. (expand_movstr): Likewise. (expand_builtin_strcpy): Likewise. (expand_builtin_strcpy_args): New. (expand_builtin_stpcpy): Similarly to expand_builtin_strcpy. (expand_builtin_strncpy): Likewise. (expand_builtin_memset): Likewise. (expand_builtin_memset_args): New. (expand_builtin_bzero): Similarly to expand_builtin_memset. (expand_builtin_memcmp): Likewise. (expand_builtin_strcmp): Likewise. (expand_builtin_strncmp): Likewise. (expand_builtin_strcat): Likewise. (expand_builtin_strncat): Likewise. (expand_builtin_strspn): Likewise. (expand_builtin_strcspn): Likewise. (expand_builtin_args_info): Likewise. (expand_builtin_va_start): Likewise. (gimplify_va_arg_expr): Likewise. (expand_builtin_va_end): Likewise. (expand_builtin_va_copy): Likewise. (expand_builtin_frame_address): Likewise. (expand_builtin_alloca): Likewise. (expand_builtin_bswap): Likewise. (expand_builtin_unop): Likewise. (expand_builtin_fputs): Likewise. (expand_builtin_expect): Likewise. (expand_builtin_fabs): Likewise. (expand_builtin_copysign): Likewise. (expand_builtin_printf): Likewise. (expand_builtin_fprintf): Likewise. (expand_builtin_sprintf): Likewise. (expand_builtin_init_trampoline): Likewise. (expand_builtin_signbit): Likewise. (expand_builtin_fork_or_exec): Likewise. (expand_builtin_sync_operation): Likewise. (expand_builtin_compare_and_swap): Likewise. (expand_builtin_lock_test_and_set): Likewise. (expand_builtin_lock_release): Likewise. (expand_builtin): Likewise. (builtin_mathfn_code): Likewise. (fold_builtin_constant_p): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_expect): Likewise. (fold_builtin_classify_type): Likewise. (fold_builtin_strlen): Likewise. (fold_builtin_nan): Likewise. (integer_valued_real_p): Likewise. (fold_trunc_transparent_mathfn): Likewise. (fold_fixed_mathfn): Likewise. (fold_builtin_cabs): Likewise. (fold_builtin_sqrt): Likewise. (fold_builtin_cbrt): Likewise. (fold_builtin_cos): Likewise. (fold_builtin_cosh): Likewise. (fold_builtin_tan): Likewise. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. (fold_builtin_trunc): Likewise. (fold_builtin_floor): Likewise. (fold_builtin_ceil): Likewise. (fold_builtin_round): Likewise. (fold_builtin_int_roundingfn): Likewise. (fold_builtin_bitop): Likewise. (fold_builtin_bswap): Likewise. (fold_builtin_logarithm): Likewise. (fold_builtin_hypot): Likewise. (fold_builtin_pow): Likewise. (fold_builtin_powi): Likewise. (fold_builtin_exponent): Likewise. (fold_builtin_memset): Likewise. (fold_builtin_bzero): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_bcopy): Deleted; call site changed to invoke fold_builtin_memory_op directly. (fold_builtin_strcpy): Similarly as for fold_builtin_memory_op. (fold_builtin_strncpy): Likewise. (fold_builtin_memcmp): Likewise. (fold_builtin_strcmp): Likewise. (fold_builtin_strncmp): Likewise. (fold_builtin_signbit): Likewise. (fold_builtin_copysign): Likewise. (fold_builtin_isascii): Likewise. (fold_builtin_toascii): Likewise. (fold_builtin_isdigit): Likewise. (fold_builtin_fabs): Likewise. (fold_builtin_abs): Likewise. (fold_builtin_fmin_fmax): Likewise. (fold_builtin_carg): Likewise. (fold_builtin_classify): Likewise. (fold_builtin_unordered_cmp): Likewise. (fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4): New functions split out from fold_builtin_1. (fold_builtin_n): New. (fold_builtin_varargs): New. (fold_builtin): Deleted. Most callers changed to use fold_call_expr instead. (fold_call_expr): New. (build_function_call_expr): Rewrite to use new helper function. (fold_builtin_call_list): New. (build_call_expr): New. (fold_builtin_call_valist): New. (rewrite_call_expr): New. (validate_arg): New. (validate_arglist): Change parameter to be entire CALL_EXPR instead of an arglist. Change return type to bool. Use new CALL_EXPR accessors. (fold_builtin_strstr): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (fold_builtin_strncat): Likewise. (fold_builtin_strspn): Likewise. (fold_builtin_strcspn): Likewise. (fold_builtin_fputs): Likewise. (fold_builtin_next_arg): Likewise. (fold_builtin_sprintf): Likewise. (expand_builtin_object_size): Use new CALL_EXPR accessors. Use NULL_RTX instead of 0. (expand_builtin_memory_chk): Likewise. (maybe_emit_chk_warning): Likewise. (maybe_emit_sprintf_chk_warning): Likewise. (fold_builtin_object_size): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strncat_chk): Likewise. (fold_builtin_sprintf_chk): Likewise. (fold_builtin_snprintf_chk): Likewise. (fold_builtin_printf): Likewise. (fold_builtin_vprintf): Likewise. * fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and constructors. (operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case. (make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (extract_muldiv_1): Add VL_EXP_CLASS_P case. (fold_mathfn_compare): Use new CALL_EXPR accessors and constructors. (fold_unary): Likewise. (fold_binary): Likewise. (fold_ternary): Remove CALL_EXPR case, since they are no longer ternary expressions. (fold): Add logic for tcc_vl_exp. (fold_checksum_tree): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (fold_build3_stat): Add assertion to flag broken interface for constructing CALL_EXPRs. (fold_build_call_list): New. (fold_build_call_list_initializer): New. (tree_expr_nonnegative_p): Use new CALL_EXPR accessors and constructors. (fold_strip_sign_ops): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR accessors and dump arguments explicitly. * tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (dump_generic_node): Use new CALL_EXPR accessors and walk arguments explicitly. (print_call_name): Use new CALL_EXPR accessors. * print-tree.c (print_node): Add case tcc_vl_exp. Print CALL_EXPR arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors. (vrp_visit_stmt): Likewise. * tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (force_move_till_expr): Likewise. * targhooks.c (default_external_stack_protect_fail): Use build_call_expr instead of build_function_call_expr. (default_hidden_stack_protect_fail): Likewise. * tree-complex.c (expand_complex_libcall): Use build_call_expr to build the call. * cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors and walk arguments explicitly. * tree-ssa-loop-niter.c (simplify_replace_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_simple_operations): Likewise. (infer_loop_bounds_from_array): Use new CALL_EXPR accessors. * gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs. * optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * value_prof.c (tree_ic): Use new CALL_EXPR accessors. (tree_ic_transform): Likewise. (interesting_stringop_to_profile_p): Pass entire CALL_EXPR as parameter instead of arglist. Fix callers. (tree_stringop_fixed_value): Use new CALL_EXPR accessors. (tree_stringops_transform): Likewise. (tree_indirect_call_to_profile): Likewise. (tree_stringops_values_to_profile): Likewise. * tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator. (eliminate_tail_call): Likewise. * ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (instantiate_parameters_1): Can't handle tcc_vl_exp here. * omp-low.c (build_omp_barrier): Use build_call_expr. (lower_rec_input_clauses): Likewise. (lower_reduction_clauses): Likewise. (expand_parallel_call): Likewise. (maybe_catch_exception): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_sections): Likewise. (lower_omp_single_simple): Likewise. (lower_omp_single_copy): Likewise. (lower_omp_master): Likewise. (lower_omp_ordered): Likewise. (lower_omp_critical): Likewise. * ipa-reference.c (check-call): Use new CALL_EXPR iterator. (scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR. * tree-gimple.c (is_gimple_call_addr): Fix doc. (recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. Add tcc_vl_exp case. * tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (chrec_contains_undetermined): Likewise. (tree_contains_chrecs): Likewise. (evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH. * cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors. * tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use fold_call_expr instead of fold_builtin. (ccp_fold_builtin): Likewise. Update calls into builtins.c to match declarations there. (fold_stmt): Use new CALL_EXPR constructor and accessors. Doc updates. * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-pure-const.c (check_call): Use new CALL_EXPR accessors. (scan_function): Add case tcc_vl_exp for CALL_EXPR. * tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR accessors. * tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr. (execute_cse_sincos): Use new CALL_EXPR accessors. * tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator. * gimple-low.c (lower_function_body): Use build_call_expr. (lower_builtin_setjmp): Likewise. * expr.c (emit_block_move_via_libcall): Use build_call_expr. (set_storage_via_libcall): Likewise. (safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_expr_real_1): Use new CALL_EXPR accessors. * tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (TB_parent_eq): Likewise. * predict.c (expr_expected_value): Use new CALL_EXPR accessors. (strip_builtin_expect): Likewise. * function.c (gimplify_parameters): Use build_call_expr. * tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-type-escape.c (check_call): Use new CALL_EXPR iterators. (scan_for_refs): Add case tcc_vl_exp for CALL_EXPR. * tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR iterators. * gimplify.c (build_stack_save_restore): Use build_call_expr. (gimplify_decl_expr): Likewise. (gimplify_call_expr): Use fold_call_expr instead of fold_builtin. Use new CALL_EXPR iterators. (gimplify_modify_expr_to_memcpy): Use build_call_expr. (gimplify_modify_expr_to_memset): Likewise. (gimplify_variable_sized_compare): Likewise. (gimplify_omp_atomic_fetch_op): Likewise. (gimplify_omp_atomic_pipeline): Likewise. (gimplify_omp_atomic_mutex): Likewise. (gimplify_function_tree): Likewise. * calls.c (alloca_call_p): Use new CALL_EXPR accessors. (call_expr_flags): Likewise. (expand_call): Likewise. * except.c (expand_builtin_eh_return_data_regno): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. * coverage.c (create_coverage): Use build_call_expr. * tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete. (temp_call_expr_obstack): New. (pool_copy_list): Delete. (temp_copy_call_expr): New. (phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. Get rid of special goo for copying argument lists and use temp_copy_call_expr instead. (valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. (create_expression_by_pieces): Likewise. Use build_call_array to construct the result instead of fold_build3. (create_value_expr_from): Add tcc_vl_exp. Delete special goo for dealing with argument lists. (init_pre): Remove references to expression_node_pool and list_node_pool. Init temp_call_expr_obstack instead. (fini_pre): Remove references to expression_node_pool and list_node_pool. * tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors and walk arguments explicitly instead of as a list. * tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr. (mx_register_decls): Likewise. (mudflap_register_call): Likewise. (mudflap_finish_file): Likewise. * ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors. (ipa_callsite_compute_param): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR accessors and constructor. * tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR accessors and constructor. (convert_tramp_reference): Likewise. (convert_call_expr): Likewise. (finalize_nesting_tree_1): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR accessors. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr. * tree-inline.c (initialize_inlined_parameters): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. (estimate_num_insns_1): Use new CALL_EXPR accessors. (expand_call_inline): Tidy up call to initialize_inlined_parameters. * tree-vect-transform.c (vect_create_epilog_for_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (vectorizable_reduction): Likewise. (vectorizable_call): Use new CALL_EXPR iterators. (vectorizable_conversion): Use build_call_expr. (vectorizable_operation): Use TREE_OPERAND_LENGTH. (vect_gen_widened_results_half): Use build_call_expr. (vect_setup_realignment): Likewise. (vectorizable_live_operation): Use TREE_OPERAND_LENGTH. * tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors. (pass_through_call): Likewise. (compute_object_sizes): Likewise. Use fold_call_expr instead of fold_builtin. * tree-profile.c (tree_gen_interval_profiler): Use build_call_expr. (tree_gen_pow2_profiler): Likewise. (tree_gen_one_value_profiler): Likewise. (tree_gen_ic_func_profiler): Likewise. (tree_gen_average_profiler): Likewise. (tree_gen_ior_profiler): Likewise. * tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp. (find_func_aliases): Use new CALL_EXPR accessors. Add case tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * convert.c (convert_to_real): Use new CALL_EXPR accessors and constructor. (convert_to_integer): Likewise. * tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR accessors. * config/frv/frv.c (frv_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_builtin): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr. (sparc_expand_builtin): Use new CALL_EXPR accessors. * config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise. (ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors on it. Fix callers. (ix86_expand_store_builtin): Likewise. (ix86_expand_unop_builtin): Likewise. (ix86_expand_unop1_builtin): Likewise. (ix86_expand_sse_compare): Likewise. (ix86_expand_sse_comi): Likewise. (ix86_expand_vec_init_builtin): Likewise. (ix86_expand_vec_ext_builtin): Likewise. (ix86_expand_vec_set_builtin): Likewise. (ix86_expand_builtin): Use new CALL_EXPR accessors. * config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (iq2000_expand_builtin): Use new CALL_EXPR accessors. * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use build_call_expr. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. (rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_abs_builtin): Likewise. (rs6000_expand_binop_builtin): Likewise. (altivec_expand_predicate_builtin): Likewise. (altivec_expand_lv_builtin): Likewise. (spe_expand_stv_builtin): Likewise. (altivec_expand_stv_builtin): Likewise. (rs6000_expand_ternop_builtin): Likewise. (altivec_expand_ld_builtin): Use new CALL_EXPR accessors. (altivec_expand_st_builtin): Likewise. (altivec_expand_dst_builtin): Likewise. (altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_vec_set_builtin): Likewise. (altivec_expand_vec_ext_builtin): Likewise. (altivec_expand_builtin): Use new CALL_EXPR accessors. (spe_expand_builtin): Likewise. (spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (spe_expand_evsel_builtin): Likewise. (rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and FCFSX cases must construct whole new CALL_EXPR, not just arglist. * config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (arm_expand_unop_builtin): Likewise. (arm_expand_builtin): Use new CALL_EXPR accessors. * config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR accessors. * config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (bfin_expand_unop_builtin): Likewise. (bfin_expand_builtin): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * c-semantics.c (build_stmt): Add internal diagnostic check. * c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR accessors. Print arguments explicitly instead of as a list. * c-typeck.c (build_function_call): Use new CALL_EXPR constructors. * c-omp.c (c_finish_omp_barrier): Use build_call_expr. (c_finish_omp_flish): Likewise. * c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (check_function_arguments_recurse): Use new CALL_EXPR accessors. (c_warn_unused_result): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. Change class to tcc_vl_exp. * call.c (build_call): Use build_call_list instead of build3. (build_over_call): Likewise. (build_new_method_call): Use build_min_non_dep_call_list instead of build_min_non_dep. * error.c (dump_call_expr_args): New function. (dump_aggr_init_expr_args): New function. (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. * cvt.c (convert_to_void): Use build_call_array instead of build3; use new AGGR_INIT_EXPR accessor macros. * mangle.c (write_expression): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new AGGR_INIT_EXPR accessor macros. * cp-gimplify.c (cp_gimplify_init_expr): Use AGGR_INIT_EXPR_SLOT to set the slot operand. * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. (AGGR_INIT_EXPR_SLOT): New macro. (AGGR_INIT_EXPR_ARG): New macro. (aggr_init_expr_nargs): New macro. (AGGR_INIT_EXPR_ARGP): New macro. (aggr_init_expr_arg_iterator): New. (init_aggr_init_expr_arg_iterator): New. (next_aggr_init_expr_arg): New. (first_aggr_init_expr_arg): New. (more_aggr_init_expr_args_p): New. (FOR_EACH_AGGR_INIT_EXPR_ARG): New. (stabilize_aggr_init): New declaration. (build_min_non_dep_call_list): Likewise. * tree.c (process_aggr_init_operands): New function. (build_aggr_init_array) New function. (build_cplus_new): Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. Replace use of build3 with build_aggr_init_array. (build_min_non_dep_call_list) New function. (build_min_nt): Assert input code parameter is not a variable length expression class. (build_min, build_min_non_dep): Likewise. (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments to check for equality instead of recursing. Handle tcc_vl_exp tree code classes. (stabilize_call): Update to only handle CALL_EXPRs, not AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. (stabilize_aggr_init): New function. (stabilize_init): Use it. * cxx-pretty-print.c (pp_cxx_postfix_expression) <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros and argument iterators. * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with build_vl_exp. Iterate through the operands, recursively processing each one. (tsubst_copy_and_build) <CALL_EXPR>: Update to use new CALL_EXPR accessor macros. (value_dependent_expression_p) <default>: Handle tcc_vl_exp tree code classes. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * semantics.c (finish_call_expr): Use build_nt_call_list instead of build_nt. (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR accessor macros. Use build_call_array to construct the CALL_EXPR node instead of build3 * decl2.c (build_offset_ref_call_from_tree): Use build_nt_call_list and build_min_non_dep_call_list instead of build_min_nt and build_min_non_dep. * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>: Use build_nt_call_list instead of build_min_nt. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead of build3. (BUILD_MONITOR_EXIT): Likewise. * java-gimplify.c (java_gimplify_component_ref): Use build_call_expr. (java_gimplify_modify_expr): Likewise. * class.c (cache_this_class_ref): Use build_call_expr. (build_static_field_ref): Likewise. (emit_indirect_register_classes): Likewise. (emit_register_classes): Likewise. * resource.c (write_resource_constructor): Use build_call_expr. * builtins.c (builtin_creator_function): Change interpretation of the second parameter to be the whole CALL_EXPR instead of the arglist. (max_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (min_builtin): Likewise. (abs_builtin): Likewise. (java_build_function_call_expr): Likewise. (convert_real): Likewise. (UNMARSHAL3): Likewise. (UNMARSHAL4): Likewise. (UNMARSHAL5): Likewise. (build_arglist_for_builtin): Delete. Fix callers to use build_call_expr instead. (putObject_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (compareAndSwapInt_builtin): Likewise. (compareAndSwapLong_builtin): Likewise. (compareAndSwapObject_builtin): Likewise. (putVolatile_builtin): Likewise. (getVolatile_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. (check_for_builtin): Pass entire CALL_EXPR to builtin expander instead of arglist. * expr.c (build_java_athrow): Use build_call_nary instead of build3. (build_java_throw_out_of_bounds_exception): Likewise. (java_check_reference): Likewise. (build_java_arraystore_check): Likewise. (build_newarray): Likewise. (build_anewarray): Likewise. (expand_java_multinewarray): Use build_call_list instead of build3. (build_java_monitor): Use build_call_nary instead of build3. (java_create_object): Likewise. (expand_java_NEW): Likewise. (build_instanceof): Likewise. (expand_java_CHECKCAST): Likewise. (build_java_soft_divmod): Likewise. (build_java_binop): Likewise. (build_field_ref): Likewise. (build_class_init): Likewise. (rewrite_arglist_getcaller): Use build_call_expr. (build_invokeinterface): Use build_call_nary instead of build3. (expand_invoke): Use build_call_list instead of build3. (build_jni_stub): Use build_call_nary, build_call_list, or build_call_expr instead of build3. (expand_java_field_op): Use build_call_expr instead of build3. (force_evaluation_order): Use new CALL_EXPR accessors. * lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors. (objc_get_callee_fndecl): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * trans-expr.c (gfc_conv_power_op): Use build_call_expr. (gfc_conv_string_tmp): Likewise. (gfc_conv_concat_op): Likewise. (gfc_build_compare_string): Likewise. (gfc_conv_function_call): Use build_call_list instead of build3. * trans-array.c (gfc_trans_allocate_array_storage): Use build_call_expr. (gfc_grow_array): Likewise. (gfc_trans_array_ctor_element): Likewise. (gfc_trans_array_constructor_value): Likewise. (gfc_array_allocate): Likewise. (gfc_array_deallocate): Likewise. (gfc_trans_auto_array_allocation): Likewise. (gfc_trans_dummy_array_bias): Likewise. (gfc_conv_array_parameter): Likewise. (gfc_trans_dealloc_allocated): Likewise. (gfc_duplicate_allocatable): Likewise. * trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr. (gfc_trans_omp_flush): Likewise. * trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr. (gfc_trans_pause): Likewise. (gfc_trans_stop): Likewise. (gfc_trans_character_select): Likewise. (gfc_do_allocate): Likewise. (gfc_trans_assign_need_temp): Likewise. (gfc_trans_pointer_assign_need_temp): Likewise. (gfc_trans_forall_1): Likewise. (gfc_trans_where_2): Likewise. (gfc_trans_allocate): Likewise. (gfc_trans_deallocate): Likewise. * trans.c (gfc_trans_runtime_check): Use build_call_expr. * trans-io.c (gfc_trans_open): Use build_call_expr. (gfc_trans_close): Likewise. (build_filepos): Likewise. (gfc_trans_inquire): Likewise. (NML_FIRST_ARG): Delete. (NML_ADD_ARG): Delete. (transfer_namelist_element): Use build_call_expr. (build_dt): Likewise. (gfc_trans_dt_end): Likewise. (transfer_expr): Likewise. (transfer_array-desc): Likewise. * trans-decl.c (gfc_generate_function_code): Use build_call_expr. (gfc_generate_constructors): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr. (gfc_conv_intrinsic_fdate): Likewise. (gfc_conv_intrinsic_ttynam): Likewise. (gfc_conv_intrinsic_array_transfer): Likewise. (gfc_conv_associated): Likewise. (gfc_conv_intrinsic_si_kind): Likewise. (gfc_conv_intrinsic_trim): Likewise. (gfc_conv_intrinsic_repeat: Likewise. (gfc_conv_intrinsic_iargc): Likewise. Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com> Co-Authored-By: Lee Millward <lee.millward@codesourcery.com> From-SVN: r122018
2007-02-16 00:50:49 +01:00
skipfirst = true;
enclosing_scope = strip_pointer_operator (TREE_TYPE (object));
}
postfix_expression (fun);
enclosing_scope = saved_scope;
pp_cxx_left_paren (this);
tree.h (enum tree_code_class): Add tcc_vl_exp. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree.h (enum tree_code_class): Add tcc_vl_exp. (VL_EXP_CLASS_P): New. (TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (TREE_OPERAND_CHECK_CODE): Likewise. (GIMPLE_STMT_OPERAND_CHECK): Likewise. (TREE_RTL_OPERAND_CHECK): Likewise. (tree_operand_check_failed): Make second parameter the whole tree instead of its code. Fixed callers. (VL_EXP_CHECK): New. (TREE_OPERAND_LENGTH): New. (VL_EXP_OPERAND_LENGTH): New. (CALL_EXPR_FN): New. (CALL_EXPR_STATIC_CHAIN): New. (CALL_EXPR_ARGS): New. (CALL_EXPR_ARG): New. (call_expr_nargs): New. (CALL_EXPR_ARGP): New. (build_nt_call_list): Declare. (build_vl_exp_stat): Declare. (build_vl_exp): New. (build_call_list): Declare. (build_call_nary): Declare. (build_call_valist): Declare. (build_call_array): Declare. (call_expr_arg): Declare. (call_expr_argp): Declare. (call_expr_arglist): Declare. (fold_build_call_list): Declare. (fold_build_call_list_initializer): Declare. (fold_call_expr): Declare to replace fold_builtin. (fold_builtin_fputs): Update to agree with modified definition. (fold_builtin_strcpy): Likewise. (fold_builtin_strncpy): Likewise. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_next_arg): Likewise. (fold_build_call_expr): Declare. (fold_builtin_call_list): Declare. (fold_builtin_call_valist): Declare. (build_call_expr): Declare. (validate_arglist): Update to agree with modified definition. (tree_operand_length): New. (call_expr_arg_iterator): New. (init_call_expr_arg_iterator): New. (next_call_expr_arg): New. (first_call_expr_arg): New. (more_call_expr_args_p): New. (FOR_EACH_CALL_EXPR_ARG): New. * tree.c (tree_code_class_string): Add entries for tcc_vl_exp and tcc_gimple_stmt. (tree_code_size): Update documentation. Use sizeof (tree) rather than sizeof (char *). (tree_size): Likewise. Add case for tcc_vl_exp. (tree_node_structure): Add case for tcc_vl_exp. (contains_placeholder_p): Likewise. (substitute_in_expr): Likewise. (substitute_placeholder_in_expr): Likewise. (stabilize_reference_1): Likewise. (build3_stat): Remove logic for CALL_EXPRs. Replace with assertion to diagnose breakage of this interface for constructing CALL_EXPRs. (build_nt): Add similar assertion here. (build_nt_call_list): New. (simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors. (iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (get_callee_fndecl): Use new CALL_EXPR accessors. (tree_operand_check_failed): Change parameters to pass entire node instead of its code, so that we can call TREE_OPERAND_LENGTH on it. (process_call_operands): New. (build_vl_exp_stat): New. (build_call_list): New. (build_call_nary): New. (build_call_valist): New. (build_call_array): New. (walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (call_expr_arglist): New. * tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use tcc_vl_exp instead of a fixed-size tcc_expression. * doc/c-tree.texi (CALL_EXPR): Document new representation and accessors for CALL_EXPRs. (AGGR_INIT_EXPR): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * builtins.c (c_strlen): Return NULL_TREE instead of 0. (expand_builtin_nonlocal_goto): Change parameter to be entire CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors. (expand_builtin_prefetch): Likewise. (expand_builtin_classify_type): Likewise. (mathfn_built_in): Return NULL_TREE instead of 0. (expand_errno_check): Use new CALL_EXPR accessors. (expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_int_roundingfn): Likewise. (expand_builtin_int_roundingfn_2): Likewise. (expand_builtin_pow): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead of arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_strstr): Likewise. (expand_builtin_strchr): Likewise. (expand_builtin_strrchr): Likewise. (expand_builtin_strpbrk): Likewise. (expand_builtin_memcpy): Likewise. (expand_builtin_mempcpy): Likewise. (expand_builtin_mempcpy_args): New. (expand_builtin_memmove): Similarly to expand_builtin_mempcpy. (expand_builtin_memmove_args): New. (expand_builtin_bcopy): Similarly to expand_builtin_mempcpy. (expand_movstr): Likewise. (expand_builtin_strcpy): Likewise. (expand_builtin_strcpy_args): New. (expand_builtin_stpcpy): Similarly to expand_builtin_strcpy. (expand_builtin_strncpy): Likewise. (expand_builtin_memset): Likewise. (expand_builtin_memset_args): New. (expand_builtin_bzero): Similarly to expand_builtin_memset. (expand_builtin_memcmp): Likewise. (expand_builtin_strcmp): Likewise. (expand_builtin_strncmp): Likewise. (expand_builtin_strcat): Likewise. (expand_builtin_strncat): Likewise. (expand_builtin_strspn): Likewise. (expand_builtin_strcspn): Likewise. (expand_builtin_args_info): Likewise. (expand_builtin_va_start): Likewise. (gimplify_va_arg_expr): Likewise. (expand_builtin_va_end): Likewise. (expand_builtin_va_copy): Likewise. (expand_builtin_frame_address): Likewise. (expand_builtin_alloca): Likewise. (expand_builtin_bswap): Likewise. (expand_builtin_unop): Likewise. (expand_builtin_fputs): Likewise. (expand_builtin_expect): Likewise. (expand_builtin_fabs): Likewise. (expand_builtin_copysign): Likewise. (expand_builtin_printf): Likewise. (expand_builtin_fprintf): Likewise. (expand_builtin_sprintf): Likewise. (expand_builtin_init_trampoline): Likewise. (expand_builtin_signbit): Likewise. (expand_builtin_fork_or_exec): Likewise. (expand_builtin_sync_operation): Likewise. (expand_builtin_compare_and_swap): Likewise. (expand_builtin_lock_test_and_set): Likewise. (expand_builtin_lock_release): Likewise. (expand_builtin): Likewise. (builtin_mathfn_code): Likewise. (fold_builtin_constant_p): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_expect): Likewise. (fold_builtin_classify_type): Likewise. (fold_builtin_strlen): Likewise. (fold_builtin_nan): Likewise. (integer_valued_real_p): Likewise. (fold_trunc_transparent_mathfn): Likewise. (fold_fixed_mathfn): Likewise. (fold_builtin_cabs): Likewise. (fold_builtin_sqrt): Likewise. (fold_builtin_cbrt): Likewise. (fold_builtin_cos): Likewise. (fold_builtin_cosh): Likewise. (fold_builtin_tan): Likewise. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. (fold_builtin_trunc): Likewise. (fold_builtin_floor): Likewise. (fold_builtin_ceil): Likewise. (fold_builtin_round): Likewise. (fold_builtin_int_roundingfn): Likewise. (fold_builtin_bitop): Likewise. (fold_builtin_bswap): Likewise. (fold_builtin_logarithm): Likewise. (fold_builtin_hypot): Likewise. (fold_builtin_pow): Likewise. (fold_builtin_powi): Likewise. (fold_builtin_exponent): Likewise. (fold_builtin_memset): Likewise. (fold_builtin_bzero): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_bcopy): Deleted; call site changed to invoke fold_builtin_memory_op directly. (fold_builtin_strcpy): Similarly as for fold_builtin_memory_op. (fold_builtin_strncpy): Likewise. (fold_builtin_memcmp): Likewise. (fold_builtin_strcmp): Likewise. (fold_builtin_strncmp): Likewise. (fold_builtin_signbit): Likewise. (fold_builtin_copysign): Likewise. (fold_builtin_isascii): Likewise. (fold_builtin_toascii): Likewise. (fold_builtin_isdigit): Likewise. (fold_builtin_fabs): Likewise. (fold_builtin_abs): Likewise. (fold_builtin_fmin_fmax): Likewise. (fold_builtin_carg): Likewise. (fold_builtin_classify): Likewise. (fold_builtin_unordered_cmp): Likewise. (fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4): New functions split out from fold_builtin_1. (fold_builtin_n): New. (fold_builtin_varargs): New. (fold_builtin): Deleted. Most callers changed to use fold_call_expr instead. (fold_call_expr): New. (build_function_call_expr): Rewrite to use new helper function. (fold_builtin_call_list): New. (build_call_expr): New. (fold_builtin_call_valist): New. (rewrite_call_expr): New. (validate_arg): New. (validate_arglist): Change parameter to be entire CALL_EXPR instead of an arglist. Change return type to bool. Use new CALL_EXPR accessors. (fold_builtin_strstr): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (fold_builtin_strncat): Likewise. (fold_builtin_strspn): Likewise. (fold_builtin_strcspn): Likewise. (fold_builtin_fputs): Likewise. (fold_builtin_next_arg): Likewise. (fold_builtin_sprintf): Likewise. (expand_builtin_object_size): Use new CALL_EXPR accessors. Use NULL_RTX instead of 0. (expand_builtin_memory_chk): Likewise. (maybe_emit_chk_warning): Likewise. (maybe_emit_sprintf_chk_warning): Likewise. (fold_builtin_object_size): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strncat_chk): Likewise. (fold_builtin_sprintf_chk): Likewise. (fold_builtin_snprintf_chk): Likewise. (fold_builtin_printf): Likewise. (fold_builtin_vprintf): Likewise. * fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and constructors. (operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case. (make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (extract_muldiv_1): Add VL_EXP_CLASS_P case. (fold_mathfn_compare): Use new CALL_EXPR accessors and constructors. (fold_unary): Likewise. (fold_binary): Likewise. (fold_ternary): Remove CALL_EXPR case, since they are no longer ternary expressions. (fold): Add logic for tcc_vl_exp. (fold_checksum_tree): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (fold_build3_stat): Add assertion to flag broken interface for constructing CALL_EXPRs. (fold_build_call_list): New. (fold_build_call_list_initializer): New. (tree_expr_nonnegative_p): Use new CALL_EXPR accessors and constructors. (fold_strip_sign_ops): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR accessors and dump arguments explicitly. * tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (dump_generic_node): Use new CALL_EXPR accessors and walk arguments explicitly. (print_call_name): Use new CALL_EXPR accessors. * print-tree.c (print_node): Add case tcc_vl_exp. Print CALL_EXPR arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors. (vrp_visit_stmt): Likewise. * tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (force_move_till_expr): Likewise. * targhooks.c (default_external_stack_protect_fail): Use build_call_expr instead of build_function_call_expr. (default_hidden_stack_protect_fail): Likewise. * tree-complex.c (expand_complex_libcall): Use build_call_expr to build the call. * cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors and walk arguments explicitly. * tree-ssa-loop-niter.c (simplify_replace_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_simple_operations): Likewise. (infer_loop_bounds_from_array): Use new CALL_EXPR accessors. * gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs. * optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * value_prof.c (tree_ic): Use new CALL_EXPR accessors. (tree_ic_transform): Likewise. (interesting_stringop_to_profile_p): Pass entire CALL_EXPR as parameter instead of arglist. Fix callers. (tree_stringop_fixed_value): Use new CALL_EXPR accessors. (tree_stringops_transform): Likewise. (tree_indirect_call_to_profile): Likewise. (tree_stringops_values_to_profile): Likewise. * tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator. (eliminate_tail_call): Likewise. * ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (instantiate_parameters_1): Can't handle tcc_vl_exp here. * omp-low.c (build_omp_barrier): Use build_call_expr. (lower_rec_input_clauses): Likewise. (lower_reduction_clauses): Likewise. (expand_parallel_call): Likewise. (maybe_catch_exception): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_sections): Likewise. (lower_omp_single_simple): Likewise. (lower_omp_single_copy): Likewise. (lower_omp_master): Likewise. (lower_omp_ordered): Likewise. (lower_omp_critical): Likewise. * ipa-reference.c (check-call): Use new CALL_EXPR iterator. (scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR. * tree-gimple.c (is_gimple_call_addr): Fix doc. (recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. Add tcc_vl_exp case. * tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (chrec_contains_undetermined): Likewise. (tree_contains_chrecs): Likewise. (evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH. * cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors. * tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use fold_call_expr instead of fold_builtin. (ccp_fold_builtin): Likewise. Update calls into builtins.c to match declarations there. (fold_stmt): Use new CALL_EXPR constructor and accessors. Doc updates. * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-pure-const.c (check_call): Use new CALL_EXPR accessors. (scan_function): Add case tcc_vl_exp for CALL_EXPR. * tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR accessors. * tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr. (execute_cse_sincos): Use new CALL_EXPR accessors. * tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator. * gimple-low.c (lower_function_body): Use build_call_expr. (lower_builtin_setjmp): Likewise. * expr.c (emit_block_move_via_libcall): Use build_call_expr. (set_storage_via_libcall): Likewise. (safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_expr_real_1): Use new CALL_EXPR accessors. * tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (TB_parent_eq): Likewise. * predict.c (expr_expected_value): Use new CALL_EXPR accessors. (strip_builtin_expect): Likewise. * function.c (gimplify_parameters): Use build_call_expr. * tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-type-escape.c (check_call): Use new CALL_EXPR iterators. (scan_for_refs): Add case tcc_vl_exp for CALL_EXPR. * tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR iterators. * gimplify.c (build_stack_save_restore): Use build_call_expr. (gimplify_decl_expr): Likewise. (gimplify_call_expr): Use fold_call_expr instead of fold_builtin. Use new CALL_EXPR iterators. (gimplify_modify_expr_to_memcpy): Use build_call_expr. (gimplify_modify_expr_to_memset): Likewise. (gimplify_variable_sized_compare): Likewise. (gimplify_omp_atomic_fetch_op): Likewise. (gimplify_omp_atomic_pipeline): Likewise. (gimplify_omp_atomic_mutex): Likewise. (gimplify_function_tree): Likewise. * calls.c (alloca_call_p): Use new CALL_EXPR accessors. (call_expr_flags): Likewise. (expand_call): Likewise. * except.c (expand_builtin_eh_return_data_regno): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. * coverage.c (create_coverage): Use build_call_expr. * tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete. (temp_call_expr_obstack): New. (pool_copy_list): Delete. (temp_copy_call_expr): New. (phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. Get rid of special goo for copying argument lists and use temp_copy_call_expr instead. (valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. (create_expression_by_pieces): Likewise. Use build_call_array to construct the result instead of fold_build3. (create_value_expr_from): Add tcc_vl_exp. Delete special goo for dealing with argument lists. (init_pre): Remove references to expression_node_pool and list_node_pool. Init temp_call_expr_obstack instead. (fini_pre): Remove references to expression_node_pool and list_node_pool. * tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors and walk arguments explicitly instead of as a list. * tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr. (mx_register_decls): Likewise. (mudflap_register_call): Likewise. (mudflap_finish_file): Likewise. * ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors. (ipa_callsite_compute_param): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR accessors and constructor. * tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR accessors and constructor. (convert_tramp_reference): Likewise. (convert_call_expr): Likewise. (finalize_nesting_tree_1): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR accessors. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr. * tree-inline.c (initialize_inlined_parameters): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. (estimate_num_insns_1): Use new CALL_EXPR accessors. (expand_call_inline): Tidy up call to initialize_inlined_parameters. * tree-vect-transform.c (vect_create_epilog_for_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (vectorizable_reduction): Likewise. (vectorizable_call): Use new CALL_EXPR iterators. (vectorizable_conversion): Use build_call_expr. (vectorizable_operation): Use TREE_OPERAND_LENGTH. (vect_gen_widened_results_half): Use build_call_expr. (vect_setup_realignment): Likewise. (vectorizable_live_operation): Use TREE_OPERAND_LENGTH. * tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors. (pass_through_call): Likewise. (compute_object_sizes): Likewise. Use fold_call_expr instead of fold_builtin. * tree-profile.c (tree_gen_interval_profiler): Use build_call_expr. (tree_gen_pow2_profiler): Likewise. (tree_gen_one_value_profiler): Likewise. (tree_gen_ic_func_profiler): Likewise. (tree_gen_average_profiler): Likewise. (tree_gen_ior_profiler): Likewise. * tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp. (find_func_aliases): Use new CALL_EXPR accessors. Add case tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * convert.c (convert_to_real): Use new CALL_EXPR accessors and constructor. (convert_to_integer): Likewise. * tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR accessors. * config/frv/frv.c (frv_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_builtin): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr. (sparc_expand_builtin): Use new CALL_EXPR accessors. * config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise. (ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors on it. Fix callers. (ix86_expand_store_builtin): Likewise. (ix86_expand_unop_builtin): Likewise. (ix86_expand_unop1_builtin): Likewise. (ix86_expand_sse_compare): Likewise. (ix86_expand_sse_comi): Likewise. (ix86_expand_vec_init_builtin): Likewise. (ix86_expand_vec_ext_builtin): Likewise. (ix86_expand_vec_set_builtin): Likewise. (ix86_expand_builtin): Use new CALL_EXPR accessors. * config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (iq2000_expand_builtin): Use new CALL_EXPR accessors. * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use build_call_expr. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. (rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_abs_builtin): Likewise. (rs6000_expand_binop_builtin): Likewise. (altivec_expand_predicate_builtin): Likewise. (altivec_expand_lv_builtin): Likewise. (spe_expand_stv_builtin): Likewise. (altivec_expand_stv_builtin): Likewise. (rs6000_expand_ternop_builtin): Likewise. (altivec_expand_ld_builtin): Use new CALL_EXPR accessors. (altivec_expand_st_builtin): Likewise. (altivec_expand_dst_builtin): Likewise. (altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_vec_set_builtin): Likewise. (altivec_expand_vec_ext_builtin): Likewise. (altivec_expand_builtin): Use new CALL_EXPR accessors. (spe_expand_builtin): Likewise. (spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (spe_expand_evsel_builtin): Likewise. (rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and FCFSX cases must construct whole new CALL_EXPR, not just arglist. * config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (arm_expand_unop_builtin): Likewise. (arm_expand_builtin): Use new CALL_EXPR accessors. * config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR accessors. * config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (bfin_expand_unop_builtin): Likewise. (bfin_expand_builtin): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * c-semantics.c (build_stmt): Add internal diagnostic check. * c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR accessors. Print arguments explicitly instead of as a list. * c-typeck.c (build_function_call): Use new CALL_EXPR constructors. * c-omp.c (c_finish_omp_barrier): Use build_call_expr. (c_finish_omp_flish): Likewise. * c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (check_function_arguments_recurse): Use new CALL_EXPR accessors. (c_warn_unused_result): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. Change class to tcc_vl_exp. * call.c (build_call): Use build_call_list instead of build3. (build_over_call): Likewise. (build_new_method_call): Use build_min_non_dep_call_list instead of build_min_non_dep. * error.c (dump_call_expr_args): New function. (dump_aggr_init_expr_args): New function. (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. * cvt.c (convert_to_void): Use build_call_array instead of build3; use new AGGR_INIT_EXPR accessor macros. * mangle.c (write_expression): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new AGGR_INIT_EXPR accessor macros. * cp-gimplify.c (cp_gimplify_init_expr): Use AGGR_INIT_EXPR_SLOT to set the slot operand. * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. (AGGR_INIT_EXPR_SLOT): New macro. (AGGR_INIT_EXPR_ARG): New macro. (aggr_init_expr_nargs): New macro. (AGGR_INIT_EXPR_ARGP): New macro. (aggr_init_expr_arg_iterator): New. (init_aggr_init_expr_arg_iterator): New. (next_aggr_init_expr_arg): New. (first_aggr_init_expr_arg): New. (more_aggr_init_expr_args_p): New. (FOR_EACH_AGGR_INIT_EXPR_ARG): New. (stabilize_aggr_init): New declaration. (build_min_non_dep_call_list): Likewise. * tree.c (process_aggr_init_operands): New function. (build_aggr_init_array) New function. (build_cplus_new): Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. Replace use of build3 with build_aggr_init_array. (build_min_non_dep_call_list) New function. (build_min_nt): Assert input code parameter is not a variable length expression class. (build_min, build_min_non_dep): Likewise. (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments to check for equality instead of recursing. Handle tcc_vl_exp tree code classes. (stabilize_call): Update to only handle CALL_EXPRs, not AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. (stabilize_aggr_init): New function. (stabilize_init): Use it. * cxx-pretty-print.c (pp_cxx_postfix_expression) <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros and argument iterators. * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with build_vl_exp. Iterate through the operands, recursively processing each one. (tsubst_copy_and_build) <CALL_EXPR>: Update to use new CALL_EXPR accessor macros. (value_dependent_expression_p) <default>: Handle tcc_vl_exp tree code classes. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * semantics.c (finish_call_expr): Use build_nt_call_list instead of build_nt. (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR accessor macros. Use build_call_array to construct the CALL_EXPR node instead of build3 * decl2.c (build_offset_ref_call_from_tree): Use build_nt_call_list and build_min_non_dep_call_list instead of build_min_nt and build_min_non_dep. * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>: Use build_nt_call_list instead of build_min_nt. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead of build3. (BUILD_MONITOR_EXIT): Likewise. * java-gimplify.c (java_gimplify_component_ref): Use build_call_expr. (java_gimplify_modify_expr): Likewise. * class.c (cache_this_class_ref): Use build_call_expr. (build_static_field_ref): Likewise. (emit_indirect_register_classes): Likewise. (emit_register_classes): Likewise. * resource.c (write_resource_constructor): Use build_call_expr. * builtins.c (builtin_creator_function): Change interpretation of the second parameter to be the whole CALL_EXPR instead of the arglist. (max_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (min_builtin): Likewise. (abs_builtin): Likewise. (java_build_function_call_expr): Likewise. (convert_real): Likewise. (UNMARSHAL3): Likewise. (UNMARSHAL4): Likewise. (UNMARSHAL5): Likewise. (build_arglist_for_builtin): Delete. Fix callers to use build_call_expr instead. (putObject_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (compareAndSwapInt_builtin): Likewise. (compareAndSwapLong_builtin): Likewise. (compareAndSwapObject_builtin): Likewise. (putVolatile_builtin): Likewise. (getVolatile_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. (check_for_builtin): Pass entire CALL_EXPR to builtin expander instead of arglist. * expr.c (build_java_athrow): Use build_call_nary instead of build3. (build_java_throw_out_of_bounds_exception): Likewise. (java_check_reference): Likewise. (build_java_arraystore_check): Likewise. (build_newarray): Likewise. (build_anewarray): Likewise. (expand_java_multinewarray): Use build_call_list instead of build3. (build_java_monitor): Use build_call_nary instead of build3. (java_create_object): Likewise. (expand_java_NEW): Likewise. (build_instanceof): Likewise. (expand_java_CHECKCAST): Likewise. (build_java_soft_divmod): Likewise. (build_java_binop): Likewise. (build_field_ref): Likewise. (build_class_init): Likewise. (rewrite_arglist_getcaller): Use build_call_expr. (build_invokeinterface): Use build_call_nary instead of build3. (expand_invoke): Use build_call_list instead of build3. (build_jni_stub): Use build_call_nary, build_call_list, or build_call_expr instead of build3. (expand_java_field_op): Use build_call_expr instead of build3. (force_evaluation_order): Use new CALL_EXPR accessors. * lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors. (objc_get_callee_fndecl): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * trans-expr.c (gfc_conv_power_op): Use build_call_expr. (gfc_conv_string_tmp): Likewise. (gfc_conv_concat_op): Likewise. (gfc_build_compare_string): Likewise. (gfc_conv_function_call): Use build_call_list instead of build3. * trans-array.c (gfc_trans_allocate_array_storage): Use build_call_expr. (gfc_grow_array): Likewise. (gfc_trans_array_ctor_element): Likewise. (gfc_trans_array_constructor_value): Likewise. (gfc_array_allocate): Likewise. (gfc_array_deallocate): Likewise. (gfc_trans_auto_array_allocation): Likewise. (gfc_trans_dummy_array_bias): Likewise. (gfc_conv_array_parameter): Likewise. (gfc_trans_dealloc_allocated): Likewise. (gfc_duplicate_allocatable): Likewise. * trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr. (gfc_trans_omp_flush): Likewise. * trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr. (gfc_trans_pause): Likewise. (gfc_trans_stop): Likewise. (gfc_trans_character_select): Likewise. (gfc_do_allocate): Likewise. (gfc_trans_assign_need_temp): Likewise. (gfc_trans_pointer_assign_need_temp): Likewise. (gfc_trans_forall_1): Likewise. (gfc_trans_where_2): Likewise. (gfc_trans_allocate): Likewise. (gfc_trans_deallocate): Likewise. * trans.c (gfc_trans_runtime_check): Use build_call_expr. * trans-io.c (gfc_trans_open): Use build_call_expr. (gfc_trans_close): Likewise. (build_filepos): Likewise. (gfc_trans_inquire): Likewise. (NML_FIRST_ARG): Delete. (NML_ADD_ARG): Delete. (transfer_namelist_element): Use build_call_expr. (build_dt): Likewise. (gfc_trans_dt_end): Likewise. (transfer_expr): Likewise. (transfer_array-desc): Likewise. * trans-decl.c (gfc_generate_function_code): Use build_call_expr. (gfc_generate_constructors): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr. (gfc_conv_intrinsic_fdate): Likewise. (gfc_conv_intrinsic_ttynam): Likewise. (gfc_conv_intrinsic_array_transfer): Likewise. (gfc_conv_associated): Likewise. (gfc_conv_intrinsic_si_kind): Likewise. (gfc_conv_intrinsic_trim): Likewise. (gfc_conv_intrinsic_repeat: Likewise. (gfc_conv_intrinsic_iargc): Likewise. Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com> Co-Authored-By: Lee Millward <lee.millward@codesourcery.com> From-SVN: r122018
2007-02-16 00:50:49 +01:00
if (code == AGGR_INIT_EXPR)
{
aggr_init_expr_arg_iterator iter;
FOR_EACH_AGGR_INIT_EXPR_ARG (arg, iter, t)
{
if (skipfirst)
skipfirst = false;
else
{
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
expression (arg);
tree.h (enum tree_code_class): Add tcc_vl_exp. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree.h (enum tree_code_class): Add tcc_vl_exp. (VL_EXP_CLASS_P): New. (TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (TREE_OPERAND_CHECK_CODE): Likewise. (GIMPLE_STMT_OPERAND_CHECK): Likewise. (TREE_RTL_OPERAND_CHECK): Likewise. (tree_operand_check_failed): Make second parameter the whole tree instead of its code. Fixed callers. (VL_EXP_CHECK): New. (TREE_OPERAND_LENGTH): New. (VL_EXP_OPERAND_LENGTH): New. (CALL_EXPR_FN): New. (CALL_EXPR_STATIC_CHAIN): New. (CALL_EXPR_ARGS): New. (CALL_EXPR_ARG): New. (call_expr_nargs): New. (CALL_EXPR_ARGP): New. (build_nt_call_list): Declare. (build_vl_exp_stat): Declare. (build_vl_exp): New. (build_call_list): Declare. (build_call_nary): Declare. (build_call_valist): Declare. (build_call_array): Declare. (call_expr_arg): Declare. (call_expr_argp): Declare. (call_expr_arglist): Declare. (fold_build_call_list): Declare. (fold_build_call_list_initializer): Declare. (fold_call_expr): Declare to replace fold_builtin. (fold_builtin_fputs): Update to agree with modified definition. (fold_builtin_strcpy): Likewise. (fold_builtin_strncpy): Likewise. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_next_arg): Likewise. (fold_build_call_expr): Declare. (fold_builtin_call_list): Declare. (fold_builtin_call_valist): Declare. (build_call_expr): Declare. (validate_arglist): Update to agree with modified definition. (tree_operand_length): New. (call_expr_arg_iterator): New. (init_call_expr_arg_iterator): New. (next_call_expr_arg): New. (first_call_expr_arg): New. (more_call_expr_args_p): New. (FOR_EACH_CALL_EXPR_ARG): New. * tree.c (tree_code_class_string): Add entries for tcc_vl_exp and tcc_gimple_stmt. (tree_code_size): Update documentation. Use sizeof (tree) rather than sizeof (char *). (tree_size): Likewise. Add case for tcc_vl_exp. (tree_node_structure): Add case for tcc_vl_exp. (contains_placeholder_p): Likewise. (substitute_in_expr): Likewise. (substitute_placeholder_in_expr): Likewise. (stabilize_reference_1): Likewise. (build3_stat): Remove logic for CALL_EXPRs. Replace with assertion to diagnose breakage of this interface for constructing CALL_EXPRs. (build_nt): Add similar assertion here. (build_nt_call_list): New. (simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors. (iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (get_callee_fndecl): Use new CALL_EXPR accessors. (tree_operand_check_failed): Change parameters to pass entire node instead of its code, so that we can call TREE_OPERAND_LENGTH on it. (process_call_operands): New. (build_vl_exp_stat): New. (build_call_list): New. (build_call_nary): New. (build_call_valist): New. (build_call_array): New. (walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (call_expr_arglist): New. * tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use tcc_vl_exp instead of a fixed-size tcc_expression. * doc/c-tree.texi (CALL_EXPR): Document new representation and accessors for CALL_EXPRs. (AGGR_INIT_EXPR): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * builtins.c (c_strlen): Return NULL_TREE instead of 0. (expand_builtin_nonlocal_goto): Change parameter to be entire CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors. (expand_builtin_prefetch): Likewise. (expand_builtin_classify_type): Likewise. (mathfn_built_in): Return NULL_TREE instead of 0. (expand_errno_check): Use new CALL_EXPR accessors. (expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_int_roundingfn): Likewise. (expand_builtin_int_roundingfn_2): Likewise. (expand_builtin_pow): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead of arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_strstr): Likewise. (expand_builtin_strchr): Likewise. (expand_builtin_strrchr): Likewise. (expand_builtin_strpbrk): Likewise. (expand_builtin_memcpy): Likewise. (expand_builtin_mempcpy): Likewise. (expand_builtin_mempcpy_args): New. (expand_builtin_memmove): Similarly to expand_builtin_mempcpy. (expand_builtin_memmove_args): New. (expand_builtin_bcopy): Similarly to expand_builtin_mempcpy. (expand_movstr): Likewise. (expand_builtin_strcpy): Likewise. (expand_builtin_strcpy_args): New. (expand_builtin_stpcpy): Similarly to expand_builtin_strcpy. (expand_builtin_strncpy): Likewise. (expand_builtin_memset): Likewise. (expand_builtin_memset_args): New. (expand_builtin_bzero): Similarly to expand_builtin_memset. (expand_builtin_memcmp): Likewise. (expand_builtin_strcmp): Likewise. (expand_builtin_strncmp): Likewise. (expand_builtin_strcat): Likewise. (expand_builtin_strncat): Likewise. (expand_builtin_strspn): Likewise. (expand_builtin_strcspn): Likewise. (expand_builtin_args_info): Likewise. (expand_builtin_va_start): Likewise. (gimplify_va_arg_expr): Likewise. (expand_builtin_va_end): Likewise. (expand_builtin_va_copy): Likewise. (expand_builtin_frame_address): Likewise. (expand_builtin_alloca): Likewise. (expand_builtin_bswap): Likewise. (expand_builtin_unop): Likewise. (expand_builtin_fputs): Likewise. (expand_builtin_expect): Likewise. (expand_builtin_fabs): Likewise. (expand_builtin_copysign): Likewise. (expand_builtin_printf): Likewise. (expand_builtin_fprintf): Likewise. (expand_builtin_sprintf): Likewise. (expand_builtin_init_trampoline): Likewise. (expand_builtin_signbit): Likewise. (expand_builtin_fork_or_exec): Likewise. (expand_builtin_sync_operation): Likewise. (expand_builtin_compare_and_swap): Likewise. (expand_builtin_lock_test_and_set): Likewise. (expand_builtin_lock_release): Likewise. (expand_builtin): Likewise. (builtin_mathfn_code): Likewise. (fold_builtin_constant_p): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_expect): Likewise. (fold_builtin_classify_type): Likewise. (fold_builtin_strlen): Likewise. (fold_builtin_nan): Likewise. (integer_valued_real_p): Likewise. (fold_trunc_transparent_mathfn): Likewise. (fold_fixed_mathfn): Likewise. (fold_builtin_cabs): Likewise. (fold_builtin_sqrt): Likewise. (fold_builtin_cbrt): Likewise. (fold_builtin_cos): Likewise. (fold_builtin_cosh): Likewise. (fold_builtin_tan): Likewise. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. (fold_builtin_trunc): Likewise. (fold_builtin_floor): Likewise. (fold_builtin_ceil): Likewise. (fold_builtin_round): Likewise. (fold_builtin_int_roundingfn): Likewise. (fold_builtin_bitop): Likewise. (fold_builtin_bswap): Likewise. (fold_builtin_logarithm): Likewise. (fold_builtin_hypot): Likewise. (fold_builtin_pow): Likewise. (fold_builtin_powi): Likewise. (fold_builtin_exponent): Likewise. (fold_builtin_memset): Likewise. (fold_builtin_bzero): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_bcopy): Deleted; call site changed to invoke fold_builtin_memory_op directly. (fold_builtin_strcpy): Similarly as for fold_builtin_memory_op. (fold_builtin_strncpy): Likewise. (fold_builtin_memcmp): Likewise. (fold_builtin_strcmp): Likewise. (fold_builtin_strncmp): Likewise. (fold_builtin_signbit): Likewise. (fold_builtin_copysign): Likewise. (fold_builtin_isascii): Likewise. (fold_builtin_toascii): Likewise. (fold_builtin_isdigit): Likewise. (fold_builtin_fabs): Likewise. (fold_builtin_abs): Likewise. (fold_builtin_fmin_fmax): Likewise. (fold_builtin_carg): Likewise. (fold_builtin_classify): Likewise. (fold_builtin_unordered_cmp): Likewise. (fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4): New functions split out from fold_builtin_1. (fold_builtin_n): New. (fold_builtin_varargs): New. (fold_builtin): Deleted. Most callers changed to use fold_call_expr instead. (fold_call_expr): New. (build_function_call_expr): Rewrite to use new helper function. (fold_builtin_call_list): New. (build_call_expr): New. (fold_builtin_call_valist): New. (rewrite_call_expr): New. (validate_arg): New. (validate_arglist): Change parameter to be entire CALL_EXPR instead of an arglist. Change return type to bool. Use new CALL_EXPR accessors. (fold_builtin_strstr): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (fold_builtin_strncat): Likewise. (fold_builtin_strspn): Likewise. (fold_builtin_strcspn): Likewise. (fold_builtin_fputs): Likewise. (fold_builtin_next_arg): Likewise. (fold_builtin_sprintf): Likewise. (expand_builtin_object_size): Use new CALL_EXPR accessors. Use NULL_RTX instead of 0. (expand_builtin_memory_chk): Likewise. (maybe_emit_chk_warning): Likewise. (maybe_emit_sprintf_chk_warning): Likewise. (fold_builtin_object_size): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strncat_chk): Likewise. (fold_builtin_sprintf_chk): Likewise. (fold_builtin_snprintf_chk): Likewise. (fold_builtin_printf): Likewise. (fold_builtin_vprintf): Likewise. * fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and constructors. (operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case. (make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (extract_muldiv_1): Add VL_EXP_CLASS_P case. (fold_mathfn_compare): Use new CALL_EXPR accessors and constructors. (fold_unary): Likewise. (fold_binary): Likewise. (fold_ternary): Remove CALL_EXPR case, since they are no longer ternary expressions. (fold): Add logic for tcc_vl_exp. (fold_checksum_tree): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (fold_build3_stat): Add assertion to flag broken interface for constructing CALL_EXPRs. (fold_build_call_list): New. (fold_build_call_list_initializer): New. (tree_expr_nonnegative_p): Use new CALL_EXPR accessors and constructors. (fold_strip_sign_ops): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR accessors and dump arguments explicitly. * tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (dump_generic_node): Use new CALL_EXPR accessors and walk arguments explicitly. (print_call_name): Use new CALL_EXPR accessors. * print-tree.c (print_node): Add case tcc_vl_exp. Print CALL_EXPR arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors. (vrp_visit_stmt): Likewise. * tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (force_move_till_expr): Likewise. * targhooks.c (default_external_stack_protect_fail): Use build_call_expr instead of build_function_call_expr. (default_hidden_stack_protect_fail): Likewise. * tree-complex.c (expand_complex_libcall): Use build_call_expr to build the call. * cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors and walk arguments explicitly. * tree-ssa-loop-niter.c (simplify_replace_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_simple_operations): Likewise. (infer_loop_bounds_from_array): Use new CALL_EXPR accessors. * gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs. * optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * value_prof.c (tree_ic): Use new CALL_EXPR accessors. (tree_ic_transform): Likewise. (interesting_stringop_to_profile_p): Pass entire CALL_EXPR as parameter instead of arglist. Fix callers. (tree_stringop_fixed_value): Use new CALL_EXPR accessors. (tree_stringops_transform): Likewise. (tree_indirect_call_to_profile): Likewise. (tree_stringops_values_to_profile): Likewise. * tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator. (eliminate_tail_call): Likewise. * ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (instantiate_parameters_1): Can't handle tcc_vl_exp here. * omp-low.c (build_omp_barrier): Use build_call_expr. (lower_rec_input_clauses): Likewise. (lower_reduction_clauses): Likewise. (expand_parallel_call): Likewise. (maybe_catch_exception): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_sections): Likewise. (lower_omp_single_simple): Likewise. (lower_omp_single_copy): Likewise. (lower_omp_master): Likewise. (lower_omp_ordered): Likewise. (lower_omp_critical): Likewise. * ipa-reference.c (check-call): Use new CALL_EXPR iterator. (scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR. * tree-gimple.c (is_gimple_call_addr): Fix doc. (recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. Add tcc_vl_exp case. * tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (chrec_contains_undetermined): Likewise. (tree_contains_chrecs): Likewise. (evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH. * cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors. * tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use fold_call_expr instead of fold_builtin. (ccp_fold_builtin): Likewise. Update calls into builtins.c to match declarations there. (fold_stmt): Use new CALL_EXPR constructor and accessors. Doc updates. * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-pure-const.c (check_call): Use new CALL_EXPR accessors. (scan_function): Add case tcc_vl_exp for CALL_EXPR. * tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR accessors. * tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr. (execute_cse_sincos): Use new CALL_EXPR accessors. * tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator. * gimple-low.c (lower_function_body): Use build_call_expr. (lower_builtin_setjmp): Likewise. * expr.c (emit_block_move_via_libcall): Use build_call_expr. (set_storage_via_libcall): Likewise. (safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_expr_real_1): Use new CALL_EXPR accessors. * tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (TB_parent_eq): Likewise. * predict.c (expr_expected_value): Use new CALL_EXPR accessors. (strip_builtin_expect): Likewise. * function.c (gimplify_parameters): Use build_call_expr. * tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-type-escape.c (check_call): Use new CALL_EXPR iterators. (scan_for_refs): Add case tcc_vl_exp for CALL_EXPR. * tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR iterators. * gimplify.c (build_stack_save_restore): Use build_call_expr. (gimplify_decl_expr): Likewise. (gimplify_call_expr): Use fold_call_expr instead of fold_builtin. Use new CALL_EXPR iterators. (gimplify_modify_expr_to_memcpy): Use build_call_expr. (gimplify_modify_expr_to_memset): Likewise. (gimplify_variable_sized_compare): Likewise. (gimplify_omp_atomic_fetch_op): Likewise. (gimplify_omp_atomic_pipeline): Likewise. (gimplify_omp_atomic_mutex): Likewise. (gimplify_function_tree): Likewise. * calls.c (alloca_call_p): Use new CALL_EXPR accessors. (call_expr_flags): Likewise. (expand_call): Likewise. * except.c (expand_builtin_eh_return_data_regno): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. * coverage.c (create_coverage): Use build_call_expr. * tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete. (temp_call_expr_obstack): New. (pool_copy_list): Delete. (temp_copy_call_expr): New. (phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. Get rid of special goo for copying argument lists and use temp_copy_call_expr instead. (valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. (create_expression_by_pieces): Likewise. Use build_call_array to construct the result instead of fold_build3. (create_value_expr_from): Add tcc_vl_exp. Delete special goo for dealing with argument lists. (init_pre): Remove references to expression_node_pool and list_node_pool. Init temp_call_expr_obstack instead. (fini_pre): Remove references to expression_node_pool and list_node_pool. * tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors and walk arguments explicitly instead of as a list. * tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr. (mx_register_decls): Likewise. (mudflap_register_call): Likewise. (mudflap_finish_file): Likewise. * ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors. (ipa_callsite_compute_param): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR accessors and constructor. * tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR accessors and constructor. (convert_tramp_reference): Likewise. (convert_call_expr): Likewise. (finalize_nesting_tree_1): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR accessors. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr. * tree-inline.c (initialize_inlined_parameters): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. (estimate_num_insns_1): Use new CALL_EXPR accessors. (expand_call_inline): Tidy up call to initialize_inlined_parameters. * tree-vect-transform.c (vect_create_epilog_for_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (vectorizable_reduction): Likewise. (vectorizable_call): Use new CALL_EXPR iterators. (vectorizable_conversion): Use build_call_expr. (vectorizable_operation): Use TREE_OPERAND_LENGTH. (vect_gen_widened_results_half): Use build_call_expr. (vect_setup_realignment): Likewise. (vectorizable_live_operation): Use TREE_OPERAND_LENGTH. * tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors. (pass_through_call): Likewise. (compute_object_sizes): Likewise. Use fold_call_expr instead of fold_builtin. * tree-profile.c (tree_gen_interval_profiler): Use build_call_expr. (tree_gen_pow2_profiler): Likewise. (tree_gen_one_value_profiler): Likewise. (tree_gen_ic_func_profiler): Likewise. (tree_gen_average_profiler): Likewise. (tree_gen_ior_profiler): Likewise. * tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp. (find_func_aliases): Use new CALL_EXPR accessors. Add case tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * convert.c (convert_to_real): Use new CALL_EXPR accessors and constructor. (convert_to_integer): Likewise. * tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR accessors. * config/frv/frv.c (frv_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_builtin): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr. (sparc_expand_builtin): Use new CALL_EXPR accessors. * config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise. (ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors on it. Fix callers. (ix86_expand_store_builtin): Likewise. (ix86_expand_unop_builtin): Likewise. (ix86_expand_unop1_builtin): Likewise. (ix86_expand_sse_compare): Likewise. (ix86_expand_sse_comi): Likewise. (ix86_expand_vec_init_builtin): Likewise. (ix86_expand_vec_ext_builtin): Likewise. (ix86_expand_vec_set_builtin): Likewise. (ix86_expand_builtin): Use new CALL_EXPR accessors. * config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (iq2000_expand_builtin): Use new CALL_EXPR accessors. * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use build_call_expr. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. (rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_abs_builtin): Likewise. (rs6000_expand_binop_builtin): Likewise. (altivec_expand_predicate_builtin): Likewise. (altivec_expand_lv_builtin): Likewise. (spe_expand_stv_builtin): Likewise. (altivec_expand_stv_builtin): Likewise. (rs6000_expand_ternop_builtin): Likewise. (altivec_expand_ld_builtin): Use new CALL_EXPR accessors. (altivec_expand_st_builtin): Likewise. (altivec_expand_dst_builtin): Likewise. (altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_vec_set_builtin): Likewise. (altivec_expand_vec_ext_builtin): Likewise. (altivec_expand_builtin): Use new CALL_EXPR accessors. (spe_expand_builtin): Likewise. (spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (spe_expand_evsel_builtin): Likewise. (rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and FCFSX cases must construct whole new CALL_EXPR, not just arglist. * config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (arm_expand_unop_builtin): Likewise. (arm_expand_builtin): Use new CALL_EXPR accessors. * config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR accessors. * config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (bfin_expand_unop_builtin): Likewise. (bfin_expand_builtin): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * c-semantics.c (build_stmt): Add internal diagnostic check. * c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR accessors. Print arguments explicitly instead of as a list. * c-typeck.c (build_function_call): Use new CALL_EXPR constructors. * c-omp.c (c_finish_omp_barrier): Use build_call_expr. (c_finish_omp_flish): Likewise. * c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (check_function_arguments_recurse): Use new CALL_EXPR accessors. (c_warn_unused_result): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. Change class to tcc_vl_exp. * call.c (build_call): Use build_call_list instead of build3. (build_over_call): Likewise. (build_new_method_call): Use build_min_non_dep_call_list instead of build_min_non_dep. * error.c (dump_call_expr_args): New function. (dump_aggr_init_expr_args): New function. (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. * cvt.c (convert_to_void): Use build_call_array instead of build3; use new AGGR_INIT_EXPR accessor macros. * mangle.c (write_expression): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new AGGR_INIT_EXPR accessor macros. * cp-gimplify.c (cp_gimplify_init_expr): Use AGGR_INIT_EXPR_SLOT to set the slot operand. * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. (AGGR_INIT_EXPR_SLOT): New macro. (AGGR_INIT_EXPR_ARG): New macro. (aggr_init_expr_nargs): New macro. (AGGR_INIT_EXPR_ARGP): New macro. (aggr_init_expr_arg_iterator): New. (init_aggr_init_expr_arg_iterator): New. (next_aggr_init_expr_arg): New. (first_aggr_init_expr_arg): New. (more_aggr_init_expr_args_p): New. (FOR_EACH_AGGR_INIT_EXPR_ARG): New. (stabilize_aggr_init): New declaration. (build_min_non_dep_call_list): Likewise. * tree.c (process_aggr_init_operands): New function. (build_aggr_init_array) New function. (build_cplus_new): Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. Replace use of build3 with build_aggr_init_array. (build_min_non_dep_call_list) New function. (build_min_nt): Assert input code parameter is not a variable length expression class. (build_min, build_min_non_dep): Likewise. (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments to check for equality instead of recursing. Handle tcc_vl_exp tree code classes. (stabilize_call): Update to only handle CALL_EXPRs, not AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. (stabilize_aggr_init): New function. (stabilize_init): Use it. * cxx-pretty-print.c (pp_cxx_postfix_expression) <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros and argument iterators. * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with build_vl_exp. Iterate through the operands, recursively processing each one. (tsubst_copy_and_build) <CALL_EXPR>: Update to use new CALL_EXPR accessor macros. (value_dependent_expression_p) <default>: Handle tcc_vl_exp tree code classes. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * semantics.c (finish_call_expr): Use build_nt_call_list instead of build_nt. (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR accessor macros. Use build_call_array to construct the CALL_EXPR node instead of build3 * decl2.c (build_offset_ref_call_from_tree): Use build_nt_call_list and build_min_non_dep_call_list instead of build_min_nt and build_min_non_dep. * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>: Use build_nt_call_list instead of build_min_nt. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead of build3. (BUILD_MONITOR_EXIT): Likewise. * java-gimplify.c (java_gimplify_component_ref): Use build_call_expr. (java_gimplify_modify_expr): Likewise. * class.c (cache_this_class_ref): Use build_call_expr. (build_static_field_ref): Likewise. (emit_indirect_register_classes): Likewise. (emit_register_classes): Likewise. * resource.c (write_resource_constructor): Use build_call_expr. * builtins.c (builtin_creator_function): Change interpretation of the second parameter to be the whole CALL_EXPR instead of the arglist. (max_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (min_builtin): Likewise. (abs_builtin): Likewise. (java_build_function_call_expr): Likewise. (convert_real): Likewise. (UNMARSHAL3): Likewise. (UNMARSHAL4): Likewise. (UNMARSHAL5): Likewise. (build_arglist_for_builtin): Delete. Fix callers to use build_call_expr instead. (putObject_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (compareAndSwapInt_builtin): Likewise. (compareAndSwapLong_builtin): Likewise. (compareAndSwapObject_builtin): Likewise. (putVolatile_builtin): Likewise. (getVolatile_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. (check_for_builtin): Pass entire CALL_EXPR to builtin expander instead of arglist. * expr.c (build_java_athrow): Use build_call_nary instead of build3. (build_java_throw_out_of_bounds_exception): Likewise. (java_check_reference): Likewise. (build_java_arraystore_check): Likewise. (build_newarray): Likewise. (build_anewarray): Likewise. (expand_java_multinewarray): Use build_call_list instead of build3. (build_java_monitor): Use build_call_nary instead of build3. (java_create_object): Likewise. (expand_java_NEW): Likewise. (build_instanceof): Likewise. (expand_java_CHECKCAST): Likewise. (build_java_soft_divmod): Likewise. (build_java_binop): Likewise. (build_field_ref): Likewise. (build_class_init): Likewise. (rewrite_arglist_getcaller): Use build_call_expr. (build_invokeinterface): Use build_call_nary instead of build3. (expand_invoke): Use build_call_list instead of build3. (build_jni_stub): Use build_call_nary, build_call_list, or build_call_expr instead of build3. (expand_java_field_op): Use build_call_expr instead of build3. (force_evaluation_order): Use new CALL_EXPR accessors. * lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors. (objc_get_callee_fndecl): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * trans-expr.c (gfc_conv_power_op): Use build_call_expr. (gfc_conv_string_tmp): Likewise. (gfc_conv_concat_op): Likewise. (gfc_build_compare_string): Likewise. (gfc_conv_function_call): Use build_call_list instead of build3. * trans-array.c (gfc_trans_allocate_array_storage): Use build_call_expr. (gfc_grow_array): Likewise. (gfc_trans_array_ctor_element): Likewise. (gfc_trans_array_constructor_value): Likewise. (gfc_array_allocate): Likewise. (gfc_array_deallocate): Likewise. (gfc_trans_auto_array_allocation): Likewise. (gfc_trans_dummy_array_bias): Likewise. (gfc_conv_array_parameter): Likewise. (gfc_trans_dealloc_allocated): Likewise. (gfc_duplicate_allocatable): Likewise. * trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr. (gfc_trans_omp_flush): Likewise. * trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr. (gfc_trans_pause): Likewise. (gfc_trans_stop): Likewise. (gfc_trans_character_select): Likewise. (gfc_do_allocate): Likewise. (gfc_trans_assign_need_temp): Likewise. (gfc_trans_pointer_assign_need_temp): Likewise. (gfc_trans_forall_1): Likewise. (gfc_trans_where_2): Likewise. (gfc_trans_allocate): Likewise. (gfc_trans_deallocate): Likewise. * trans.c (gfc_trans_runtime_check): Use build_call_expr. * trans-io.c (gfc_trans_open): Use build_call_expr. (gfc_trans_close): Likewise. (build_filepos): Likewise. (gfc_trans_inquire): Likewise. (NML_FIRST_ARG): Delete. (NML_ADD_ARG): Delete. (transfer_namelist_element): Use build_call_expr. (build_dt): Likewise. (gfc_trans_dt_end): Likewise. (transfer_expr): Likewise. (transfer_array-desc): Likewise. * trans-decl.c (gfc_generate_function_code): Use build_call_expr. (gfc_generate_constructors): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr. (gfc_conv_intrinsic_fdate): Likewise. (gfc_conv_intrinsic_ttynam): Likewise. (gfc_conv_intrinsic_array_transfer): Likewise. (gfc_conv_associated): Likewise. (gfc_conv_intrinsic_si_kind): Likewise. (gfc_conv_intrinsic_trim): Likewise. (gfc_conv_intrinsic_repeat: Likewise. (gfc_conv_intrinsic_iargc): Likewise. Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com> Co-Authored-By: Lee Millward <lee.millward@codesourcery.com> From-SVN: r122018
2007-02-16 00:50:49 +01:00
if (more_aggr_init_expr_args_p (&iter))
pp_cxx_separate_with (this, ',');
tree.h (enum tree_code_class): Add tcc_vl_exp. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree.h (enum tree_code_class): Add tcc_vl_exp. (VL_EXP_CLASS_P): New. (TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (TREE_OPERAND_CHECK_CODE): Likewise. (GIMPLE_STMT_OPERAND_CHECK): Likewise. (TREE_RTL_OPERAND_CHECK): Likewise. (tree_operand_check_failed): Make second parameter the whole tree instead of its code. Fixed callers. (VL_EXP_CHECK): New. (TREE_OPERAND_LENGTH): New. (VL_EXP_OPERAND_LENGTH): New. (CALL_EXPR_FN): New. (CALL_EXPR_STATIC_CHAIN): New. (CALL_EXPR_ARGS): New. (CALL_EXPR_ARG): New. (call_expr_nargs): New. (CALL_EXPR_ARGP): New. (build_nt_call_list): Declare. (build_vl_exp_stat): Declare. (build_vl_exp): New. (build_call_list): Declare. (build_call_nary): Declare. (build_call_valist): Declare. (build_call_array): Declare. (call_expr_arg): Declare. (call_expr_argp): Declare. (call_expr_arglist): Declare. (fold_build_call_list): Declare. (fold_build_call_list_initializer): Declare. (fold_call_expr): Declare to replace fold_builtin. (fold_builtin_fputs): Update to agree with modified definition. (fold_builtin_strcpy): Likewise. (fold_builtin_strncpy): Likewise. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_next_arg): Likewise. (fold_build_call_expr): Declare. (fold_builtin_call_list): Declare. (fold_builtin_call_valist): Declare. (build_call_expr): Declare. (validate_arglist): Update to agree with modified definition. (tree_operand_length): New. (call_expr_arg_iterator): New. (init_call_expr_arg_iterator): New. (next_call_expr_arg): New. (first_call_expr_arg): New. (more_call_expr_args_p): New. (FOR_EACH_CALL_EXPR_ARG): New. * tree.c (tree_code_class_string): Add entries for tcc_vl_exp and tcc_gimple_stmt. (tree_code_size): Update documentation. Use sizeof (tree) rather than sizeof (char *). (tree_size): Likewise. Add case for tcc_vl_exp. (tree_node_structure): Add case for tcc_vl_exp. (contains_placeholder_p): Likewise. (substitute_in_expr): Likewise. (substitute_placeholder_in_expr): Likewise. (stabilize_reference_1): Likewise. (build3_stat): Remove logic for CALL_EXPRs. Replace with assertion to diagnose breakage of this interface for constructing CALL_EXPRs. (build_nt): Add similar assertion here. (build_nt_call_list): New. (simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors. (iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (get_callee_fndecl): Use new CALL_EXPR accessors. (tree_operand_check_failed): Change parameters to pass entire node instead of its code, so that we can call TREE_OPERAND_LENGTH on it. (process_call_operands): New. (build_vl_exp_stat): New. (build_call_list): New. (build_call_nary): New. (build_call_valist): New. (build_call_array): New. (walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (call_expr_arglist): New. * tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use tcc_vl_exp instead of a fixed-size tcc_expression. * doc/c-tree.texi (CALL_EXPR): Document new representation and accessors for CALL_EXPRs. (AGGR_INIT_EXPR): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * builtins.c (c_strlen): Return NULL_TREE instead of 0. (expand_builtin_nonlocal_goto): Change parameter to be entire CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors. (expand_builtin_prefetch): Likewise. (expand_builtin_classify_type): Likewise. (mathfn_built_in): Return NULL_TREE instead of 0. (expand_errno_check): Use new CALL_EXPR accessors. (expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_int_roundingfn): Likewise. (expand_builtin_int_roundingfn_2): Likewise. (expand_builtin_pow): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead of arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_strstr): Likewise. (expand_builtin_strchr): Likewise. (expand_builtin_strrchr): Likewise. (expand_builtin_strpbrk): Likewise. (expand_builtin_memcpy): Likewise. (expand_builtin_mempcpy): Likewise. (expand_builtin_mempcpy_args): New. (expand_builtin_memmove): Similarly to expand_builtin_mempcpy. (expand_builtin_memmove_args): New. (expand_builtin_bcopy): Similarly to expand_builtin_mempcpy. (expand_movstr): Likewise. (expand_builtin_strcpy): Likewise. (expand_builtin_strcpy_args): New. (expand_builtin_stpcpy): Similarly to expand_builtin_strcpy. (expand_builtin_strncpy): Likewise. (expand_builtin_memset): Likewise. (expand_builtin_memset_args): New. (expand_builtin_bzero): Similarly to expand_builtin_memset. (expand_builtin_memcmp): Likewise. (expand_builtin_strcmp): Likewise. (expand_builtin_strncmp): Likewise. (expand_builtin_strcat): Likewise. (expand_builtin_strncat): Likewise. (expand_builtin_strspn): Likewise. (expand_builtin_strcspn): Likewise. (expand_builtin_args_info): Likewise. (expand_builtin_va_start): Likewise. (gimplify_va_arg_expr): Likewise. (expand_builtin_va_end): Likewise. (expand_builtin_va_copy): Likewise. (expand_builtin_frame_address): Likewise. (expand_builtin_alloca): Likewise. (expand_builtin_bswap): Likewise. (expand_builtin_unop): Likewise. (expand_builtin_fputs): Likewise. (expand_builtin_expect): Likewise. (expand_builtin_fabs): Likewise. (expand_builtin_copysign): Likewise. (expand_builtin_printf): Likewise. (expand_builtin_fprintf): Likewise. (expand_builtin_sprintf): Likewise. (expand_builtin_init_trampoline): Likewise. (expand_builtin_signbit): Likewise. (expand_builtin_fork_or_exec): Likewise. (expand_builtin_sync_operation): Likewise. (expand_builtin_compare_and_swap): Likewise. (expand_builtin_lock_test_and_set): Likewise. (expand_builtin_lock_release): Likewise. (expand_builtin): Likewise. (builtin_mathfn_code): Likewise. (fold_builtin_constant_p): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_expect): Likewise. (fold_builtin_classify_type): Likewise. (fold_builtin_strlen): Likewise. (fold_builtin_nan): Likewise. (integer_valued_real_p): Likewise. (fold_trunc_transparent_mathfn): Likewise. (fold_fixed_mathfn): Likewise. (fold_builtin_cabs): Likewise. (fold_builtin_sqrt): Likewise. (fold_builtin_cbrt): Likewise. (fold_builtin_cos): Likewise. (fold_builtin_cosh): Likewise. (fold_builtin_tan): Likewise. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. (fold_builtin_trunc): Likewise. (fold_builtin_floor): Likewise. (fold_builtin_ceil): Likewise. (fold_builtin_round): Likewise. (fold_builtin_int_roundingfn): Likewise. (fold_builtin_bitop): Likewise. (fold_builtin_bswap): Likewise. (fold_builtin_logarithm): Likewise. (fold_builtin_hypot): Likewise. (fold_builtin_pow): Likewise. (fold_builtin_powi): Likewise. (fold_builtin_exponent): Likewise. (fold_builtin_memset): Likewise. (fold_builtin_bzero): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_bcopy): Deleted; call site changed to invoke fold_builtin_memory_op directly. (fold_builtin_strcpy): Similarly as for fold_builtin_memory_op. (fold_builtin_strncpy): Likewise. (fold_builtin_memcmp): Likewise. (fold_builtin_strcmp): Likewise. (fold_builtin_strncmp): Likewise. (fold_builtin_signbit): Likewise. (fold_builtin_copysign): Likewise. (fold_builtin_isascii): Likewise. (fold_builtin_toascii): Likewise. (fold_builtin_isdigit): Likewise. (fold_builtin_fabs): Likewise. (fold_builtin_abs): Likewise. (fold_builtin_fmin_fmax): Likewise. (fold_builtin_carg): Likewise. (fold_builtin_classify): Likewise. (fold_builtin_unordered_cmp): Likewise. (fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4): New functions split out from fold_builtin_1. (fold_builtin_n): New. (fold_builtin_varargs): New. (fold_builtin): Deleted. Most callers changed to use fold_call_expr instead. (fold_call_expr): New. (build_function_call_expr): Rewrite to use new helper function. (fold_builtin_call_list): New. (build_call_expr): New. (fold_builtin_call_valist): New. (rewrite_call_expr): New. (validate_arg): New. (validate_arglist): Change parameter to be entire CALL_EXPR instead of an arglist. Change return type to bool. Use new CALL_EXPR accessors. (fold_builtin_strstr): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (fold_builtin_strncat): Likewise. (fold_builtin_strspn): Likewise. (fold_builtin_strcspn): Likewise. (fold_builtin_fputs): Likewise. (fold_builtin_next_arg): Likewise. (fold_builtin_sprintf): Likewise. (expand_builtin_object_size): Use new CALL_EXPR accessors. Use NULL_RTX instead of 0. (expand_builtin_memory_chk): Likewise. (maybe_emit_chk_warning): Likewise. (maybe_emit_sprintf_chk_warning): Likewise. (fold_builtin_object_size): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strncat_chk): Likewise. (fold_builtin_sprintf_chk): Likewise. (fold_builtin_snprintf_chk): Likewise. (fold_builtin_printf): Likewise. (fold_builtin_vprintf): Likewise. * fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and constructors. (operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case. (make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (extract_muldiv_1): Add VL_EXP_CLASS_P case. (fold_mathfn_compare): Use new CALL_EXPR accessors and constructors. (fold_unary): Likewise. (fold_binary): Likewise. (fold_ternary): Remove CALL_EXPR case, since they are no longer ternary expressions. (fold): Add logic for tcc_vl_exp. (fold_checksum_tree): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (fold_build3_stat): Add assertion to flag broken interface for constructing CALL_EXPRs. (fold_build_call_list): New. (fold_build_call_list_initializer): New. (tree_expr_nonnegative_p): Use new CALL_EXPR accessors and constructors. (fold_strip_sign_ops): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR accessors and dump arguments explicitly. * tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (dump_generic_node): Use new CALL_EXPR accessors and walk arguments explicitly. (print_call_name): Use new CALL_EXPR accessors. * print-tree.c (print_node): Add case tcc_vl_exp. Print CALL_EXPR arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors. (vrp_visit_stmt): Likewise. * tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (force_move_till_expr): Likewise. * targhooks.c (default_external_stack_protect_fail): Use build_call_expr instead of build_function_call_expr. (default_hidden_stack_protect_fail): Likewise. * tree-complex.c (expand_complex_libcall): Use build_call_expr to build the call. * cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors and walk arguments explicitly. * tree-ssa-loop-niter.c (simplify_replace_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_simple_operations): Likewise. (infer_loop_bounds_from_array): Use new CALL_EXPR accessors. * gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs. * optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * value_prof.c (tree_ic): Use new CALL_EXPR accessors. (tree_ic_transform): Likewise. (interesting_stringop_to_profile_p): Pass entire CALL_EXPR as parameter instead of arglist. Fix callers. (tree_stringop_fixed_value): Use new CALL_EXPR accessors. (tree_stringops_transform): Likewise. (tree_indirect_call_to_profile): Likewise. (tree_stringops_values_to_profile): Likewise. * tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator. (eliminate_tail_call): Likewise. * ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (instantiate_parameters_1): Can't handle tcc_vl_exp here. * omp-low.c (build_omp_barrier): Use build_call_expr. (lower_rec_input_clauses): Likewise. (lower_reduction_clauses): Likewise. (expand_parallel_call): Likewise. (maybe_catch_exception): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_sections): Likewise. (lower_omp_single_simple): Likewise. (lower_omp_single_copy): Likewise. (lower_omp_master): Likewise. (lower_omp_ordered): Likewise. (lower_omp_critical): Likewise. * ipa-reference.c (check-call): Use new CALL_EXPR iterator. (scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR. * tree-gimple.c (is_gimple_call_addr): Fix doc. (recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. Add tcc_vl_exp case. * tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (chrec_contains_undetermined): Likewise. (tree_contains_chrecs): Likewise. (evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH. * cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors. * tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use fold_call_expr instead of fold_builtin. (ccp_fold_builtin): Likewise. Update calls into builtins.c to match declarations there. (fold_stmt): Use new CALL_EXPR constructor and accessors. Doc updates. * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-pure-const.c (check_call): Use new CALL_EXPR accessors. (scan_function): Add case tcc_vl_exp for CALL_EXPR. * tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR accessors. * tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr. (execute_cse_sincos): Use new CALL_EXPR accessors. * tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator. * gimple-low.c (lower_function_body): Use build_call_expr. (lower_builtin_setjmp): Likewise. * expr.c (emit_block_move_via_libcall): Use build_call_expr. (set_storage_via_libcall): Likewise. (safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_expr_real_1): Use new CALL_EXPR accessors. * tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (TB_parent_eq): Likewise. * predict.c (expr_expected_value): Use new CALL_EXPR accessors. (strip_builtin_expect): Likewise. * function.c (gimplify_parameters): Use build_call_expr. * tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-type-escape.c (check_call): Use new CALL_EXPR iterators. (scan_for_refs): Add case tcc_vl_exp for CALL_EXPR. * tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR iterators. * gimplify.c (build_stack_save_restore): Use build_call_expr. (gimplify_decl_expr): Likewise. (gimplify_call_expr): Use fold_call_expr instead of fold_builtin. Use new CALL_EXPR iterators. (gimplify_modify_expr_to_memcpy): Use build_call_expr. (gimplify_modify_expr_to_memset): Likewise. (gimplify_variable_sized_compare): Likewise. (gimplify_omp_atomic_fetch_op): Likewise. (gimplify_omp_atomic_pipeline): Likewise. (gimplify_omp_atomic_mutex): Likewise. (gimplify_function_tree): Likewise. * calls.c (alloca_call_p): Use new CALL_EXPR accessors. (call_expr_flags): Likewise. (expand_call): Likewise. * except.c (expand_builtin_eh_return_data_regno): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. * coverage.c (create_coverage): Use build_call_expr. * tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete. (temp_call_expr_obstack): New. (pool_copy_list): Delete. (temp_copy_call_expr): New. (phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. Get rid of special goo for copying argument lists and use temp_copy_call_expr instead. (valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. (create_expression_by_pieces): Likewise. Use build_call_array to construct the result instead of fold_build3. (create_value_expr_from): Add tcc_vl_exp. Delete special goo for dealing with argument lists. (init_pre): Remove references to expression_node_pool and list_node_pool. Init temp_call_expr_obstack instead. (fini_pre): Remove references to expression_node_pool and list_node_pool. * tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors and walk arguments explicitly instead of as a list. * tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr. (mx_register_decls): Likewise. (mudflap_register_call): Likewise. (mudflap_finish_file): Likewise. * ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors. (ipa_callsite_compute_param): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR accessors and constructor. * tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR accessors and constructor. (convert_tramp_reference): Likewise. (convert_call_expr): Likewise. (finalize_nesting_tree_1): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR accessors. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr. * tree-inline.c (initialize_inlined_parameters): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. (estimate_num_insns_1): Use new CALL_EXPR accessors. (expand_call_inline): Tidy up call to initialize_inlined_parameters. * tree-vect-transform.c (vect_create_epilog_for_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (vectorizable_reduction): Likewise. (vectorizable_call): Use new CALL_EXPR iterators. (vectorizable_conversion): Use build_call_expr. (vectorizable_operation): Use TREE_OPERAND_LENGTH. (vect_gen_widened_results_half): Use build_call_expr. (vect_setup_realignment): Likewise. (vectorizable_live_operation): Use TREE_OPERAND_LENGTH. * tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors. (pass_through_call): Likewise. (compute_object_sizes): Likewise. Use fold_call_expr instead of fold_builtin. * tree-profile.c (tree_gen_interval_profiler): Use build_call_expr. (tree_gen_pow2_profiler): Likewise. (tree_gen_one_value_profiler): Likewise. (tree_gen_ic_func_profiler): Likewise. (tree_gen_average_profiler): Likewise. (tree_gen_ior_profiler): Likewise. * tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp. (find_func_aliases): Use new CALL_EXPR accessors. Add case tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * convert.c (convert_to_real): Use new CALL_EXPR accessors and constructor. (convert_to_integer): Likewise. * tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR accessors. * config/frv/frv.c (frv_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_builtin): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr. (sparc_expand_builtin): Use new CALL_EXPR accessors. * config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise. (ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors on it. Fix callers. (ix86_expand_store_builtin): Likewise. (ix86_expand_unop_builtin): Likewise. (ix86_expand_unop1_builtin): Likewise. (ix86_expand_sse_compare): Likewise. (ix86_expand_sse_comi): Likewise. (ix86_expand_vec_init_builtin): Likewise. (ix86_expand_vec_ext_builtin): Likewise. (ix86_expand_vec_set_builtin): Likewise. (ix86_expand_builtin): Use new CALL_EXPR accessors. * config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (iq2000_expand_builtin): Use new CALL_EXPR accessors. * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use build_call_expr. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. (rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_abs_builtin): Likewise. (rs6000_expand_binop_builtin): Likewise. (altivec_expand_predicate_builtin): Likewise. (altivec_expand_lv_builtin): Likewise. (spe_expand_stv_builtin): Likewise. (altivec_expand_stv_builtin): Likewise. (rs6000_expand_ternop_builtin): Likewise. (altivec_expand_ld_builtin): Use new CALL_EXPR accessors. (altivec_expand_st_builtin): Likewise. (altivec_expand_dst_builtin): Likewise. (altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_vec_set_builtin): Likewise. (altivec_expand_vec_ext_builtin): Likewise. (altivec_expand_builtin): Use new CALL_EXPR accessors. (spe_expand_builtin): Likewise. (spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (spe_expand_evsel_builtin): Likewise. (rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and FCFSX cases must construct whole new CALL_EXPR, not just arglist. * config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (arm_expand_unop_builtin): Likewise. (arm_expand_builtin): Use new CALL_EXPR accessors. * config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR accessors. * config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (bfin_expand_unop_builtin): Likewise. (bfin_expand_builtin): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * c-semantics.c (build_stmt): Add internal diagnostic check. * c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR accessors. Print arguments explicitly instead of as a list. * c-typeck.c (build_function_call): Use new CALL_EXPR constructors. * c-omp.c (c_finish_omp_barrier): Use build_call_expr. (c_finish_omp_flish): Likewise. * c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (check_function_arguments_recurse): Use new CALL_EXPR accessors. (c_warn_unused_result): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. Change class to tcc_vl_exp. * call.c (build_call): Use build_call_list instead of build3. (build_over_call): Likewise. (build_new_method_call): Use build_min_non_dep_call_list instead of build_min_non_dep. * error.c (dump_call_expr_args): New function. (dump_aggr_init_expr_args): New function. (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. * cvt.c (convert_to_void): Use build_call_array instead of build3; use new AGGR_INIT_EXPR accessor macros. * mangle.c (write_expression): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new AGGR_INIT_EXPR accessor macros. * cp-gimplify.c (cp_gimplify_init_expr): Use AGGR_INIT_EXPR_SLOT to set the slot operand. * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. (AGGR_INIT_EXPR_SLOT): New macro. (AGGR_INIT_EXPR_ARG): New macro. (aggr_init_expr_nargs): New macro. (AGGR_INIT_EXPR_ARGP): New macro. (aggr_init_expr_arg_iterator): New. (init_aggr_init_expr_arg_iterator): New. (next_aggr_init_expr_arg): New. (first_aggr_init_expr_arg): New. (more_aggr_init_expr_args_p): New. (FOR_EACH_AGGR_INIT_EXPR_ARG): New. (stabilize_aggr_init): New declaration. (build_min_non_dep_call_list): Likewise. * tree.c (process_aggr_init_operands): New function. (build_aggr_init_array) New function. (build_cplus_new): Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. Replace use of build3 with build_aggr_init_array. (build_min_non_dep_call_list) New function. (build_min_nt): Assert input code parameter is not a variable length expression class. (build_min, build_min_non_dep): Likewise. (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments to check for equality instead of recursing. Handle tcc_vl_exp tree code classes. (stabilize_call): Update to only handle CALL_EXPRs, not AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. (stabilize_aggr_init): New function. (stabilize_init): Use it. * cxx-pretty-print.c (pp_cxx_postfix_expression) <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros and argument iterators. * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with build_vl_exp. Iterate through the operands, recursively processing each one. (tsubst_copy_and_build) <CALL_EXPR>: Update to use new CALL_EXPR accessor macros. (value_dependent_expression_p) <default>: Handle tcc_vl_exp tree code classes. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * semantics.c (finish_call_expr): Use build_nt_call_list instead of build_nt. (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR accessor macros. Use build_call_array to construct the CALL_EXPR node instead of build3 * decl2.c (build_offset_ref_call_from_tree): Use build_nt_call_list and build_min_non_dep_call_list instead of build_min_nt and build_min_non_dep. * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>: Use build_nt_call_list instead of build_min_nt. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead of build3. (BUILD_MONITOR_EXIT): Likewise. * java-gimplify.c (java_gimplify_component_ref): Use build_call_expr. (java_gimplify_modify_expr): Likewise. * class.c (cache_this_class_ref): Use build_call_expr. (build_static_field_ref): Likewise. (emit_indirect_register_classes): Likewise. (emit_register_classes): Likewise. * resource.c (write_resource_constructor): Use build_call_expr. * builtins.c (builtin_creator_function): Change interpretation of the second parameter to be the whole CALL_EXPR instead of the arglist. (max_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (min_builtin): Likewise. (abs_builtin): Likewise. (java_build_function_call_expr): Likewise. (convert_real): Likewise. (UNMARSHAL3): Likewise. (UNMARSHAL4): Likewise. (UNMARSHAL5): Likewise. (build_arglist_for_builtin): Delete. Fix callers to use build_call_expr instead. (putObject_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (compareAndSwapInt_builtin): Likewise. (compareAndSwapLong_builtin): Likewise. (compareAndSwapObject_builtin): Likewise. (putVolatile_builtin): Likewise. (getVolatile_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. (check_for_builtin): Pass entire CALL_EXPR to builtin expander instead of arglist. * expr.c (build_java_athrow): Use build_call_nary instead of build3. (build_java_throw_out_of_bounds_exception): Likewise. (java_check_reference): Likewise. (build_java_arraystore_check): Likewise. (build_newarray): Likewise. (build_anewarray): Likewise. (expand_java_multinewarray): Use build_call_list instead of build3. (build_java_monitor): Use build_call_nary instead of build3. (java_create_object): Likewise. (expand_java_NEW): Likewise. (build_instanceof): Likewise. (expand_java_CHECKCAST): Likewise. (build_java_soft_divmod): Likewise. (build_java_binop): Likewise. (build_field_ref): Likewise. (build_class_init): Likewise. (rewrite_arglist_getcaller): Use build_call_expr. (build_invokeinterface): Use build_call_nary instead of build3. (expand_invoke): Use build_call_list instead of build3. (build_jni_stub): Use build_call_nary, build_call_list, or build_call_expr instead of build3. (expand_java_field_op): Use build_call_expr instead of build3. (force_evaluation_order): Use new CALL_EXPR accessors. * lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors. (objc_get_callee_fndecl): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * trans-expr.c (gfc_conv_power_op): Use build_call_expr. (gfc_conv_string_tmp): Likewise. (gfc_conv_concat_op): Likewise. (gfc_build_compare_string): Likewise. (gfc_conv_function_call): Use build_call_list instead of build3. * trans-array.c (gfc_trans_allocate_array_storage): Use build_call_expr. (gfc_grow_array): Likewise. (gfc_trans_array_ctor_element): Likewise. (gfc_trans_array_constructor_value): Likewise. (gfc_array_allocate): Likewise. (gfc_array_deallocate): Likewise. (gfc_trans_auto_array_allocation): Likewise. (gfc_trans_dummy_array_bias): Likewise. (gfc_conv_array_parameter): Likewise. (gfc_trans_dealloc_allocated): Likewise. (gfc_duplicate_allocatable): Likewise. * trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr. (gfc_trans_omp_flush): Likewise. * trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr. (gfc_trans_pause): Likewise. (gfc_trans_stop): Likewise. (gfc_trans_character_select): Likewise. (gfc_do_allocate): Likewise. (gfc_trans_assign_need_temp): Likewise. (gfc_trans_pointer_assign_need_temp): Likewise. (gfc_trans_forall_1): Likewise. (gfc_trans_where_2): Likewise. (gfc_trans_allocate): Likewise. (gfc_trans_deallocate): Likewise. * trans.c (gfc_trans_runtime_check): Use build_call_expr. * trans-io.c (gfc_trans_open): Use build_call_expr. (gfc_trans_close): Likewise. (build_filepos): Likewise. (gfc_trans_inquire): Likewise. (NML_FIRST_ARG): Delete. (NML_ADD_ARG): Delete. (transfer_namelist_element): Use build_call_expr. (build_dt): Likewise. (gfc_trans_dt_end): Likewise. (transfer_expr): Likewise. (transfer_array-desc): Likewise. * trans-decl.c (gfc_generate_function_code): Use build_call_expr. (gfc_generate_constructors): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr. (gfc_conv_intrinsic_fdate): Likewise. (gfc_conv_intrinsic_ttynam): Likewise. (gfc_conv_intrinsic_array_transfer): Likewise. (gfc_conv_associated): Likewise. (gfc_conv_intrinsic_si_kind): Likewise. (gfc_conv_intrinsic_trim): Likewise. (gfc_conv_intrinsic_repeat: Likewise. (gfc_conv_intrinsic_iargc): Likewise. Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com> Co-Authored-By: Lee Millward <lee.millward@codesourcery.com> From-SVN: r122018
2007-02-16 00:50:49 +01:00
}
}
}
else
{
call_expr_arg_iterator iter;
FOR_EACH_CALL_EXPR_ARG (arg, iter, t)
{
if (skipfirst)
skipfirst = false;
else
{
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
expression (arg);
tree.h (enum tree_code_class): Add tcc_vl_exp. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree.h (enum tree_code_class): Add tcc_vl_exp. (VL_EXP_CLASS_P): New. (TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (TREE_OPERAND_CHECK_CODE): Likewise. (GIMPLE_STMT_OPERAND_CHECK): Likewise. (TREE_RTL_OPERAND_CHECK): Likewise. (tree_operand_check_failed): Make second parameter the whole tree instead of its code. Fixed callers. (VL_EXP_CHECK): New. (TREE_OPERAND_LENGTH): New. (VL_EXP_OPERAND_LENGTH): New. (CALL_EXPR_FN): New. (CALL_EXPR_STATIC_CHAIN): New. (CALL_EXPR_ARGS): New. (CALL_EXPR_ARG): New. (call_expr_nargs): New. (CALL_EXPR_ARGP): New. (build_nt_call_list): Declare. (build_vl_exp_stat): Declare. (build_vl_exp): New. (build_call_list): Declare. (build_call_nary): Declare. (build_call_valist): Declare. (build_call_array): Declare. (call_expr_arg): Declare. (call_expr_argp): Declare. (call_expr_arglist): Declare. (fold_build_call_list): Declare. (fold_build_call_list_initializer): Declare. (fold_call_expr): Declare to replace fold_builtin. (fold_builtin_fputs): Update to agree with modified definition. (fold_builtin_strcpy): Likewise. (fold_builtin_strncpy): Likewise. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_next_arg): Likewise. (fold_build_call_expr): Declare. (fold_builtin_call_list): Declare. (fold_builtin_call_valist): Declare. (build_call_expr): Declare. (validate_arglist): Update to agree with modified definition. (tree_operand_length): New. (call_expr_arg_iterator): New. (init_call_expr_arg_iterator): New. (next_call_expr_arg): New. (first_call_expr_arg): New. (more_call_expr_args_p): New. (FOR_EACH_CALL_EXPR_ARG): New. * tree.c (tree_code_class_string): Add entries for tcc_vl_exp and tcc_gimple_stmt. (tree_code_size): Update documentation. Use sizeof (tree) rather than sizeof (char *). (tree_size): Likewise. Add case for tcc_vl_exp. (tree_node_structure): Add case for tcc_vl_exp. (contains_placeholder_p): Likewise. (substitute_in_expr): Likewise. (substitute_placeholder_in_expr): Likewise. (stabilize_reference_1): Likewise. (build3_stat): Remove logic for CALL_EXPRs. Replace with assertion to diagnose breakage of this interface for constructing CALL_EXPRs. (build_nt): Add similar assertion here. (build_nt_call_list): New. (simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors. (iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (get_callee_fndecl): Use new CALL_EXPR accessors. (tree_operand_check_failed): Change parameters to pass entire node instead of its code, so that we can call TREE_OPERAND_LENGTH on it. (process_call_operands): New. (build_vl_exp_stat): New. (build_call_list): New. (build_call_nary): New. (build_call_valist): New. (build_call_array): New. (walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (call_expr_arglist): New. * tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use tcc_vl_exp instead of a fixed-size tcc_expression. * doc/c-tree.texi (CALL_EXPR): Document new representation and accessors for CALL_EXPRs. (AGGR_INIT_EXPR): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * builtins.c (c_strlen): Return NULL_TREE instead of 0. (expand_builtin_nonlocal_goto): Change parameter to be entire CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors. (expand_builtin_prefetch): Likewise. (expand_builtin_classify_type): Likewise. (mathfn_built_in): Return NULL_TREE instead of 0. (expand_errno_check): Use new CALL_EXPR accessors. (expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_int_roundingfn): Likewise. (expand_builtin_int_roundingfn_2): Likewise. (expand_builtin_pow): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead of arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_strstr): Likewise. (expand_builtin_strchr): Likewise. (expand_builtin_strrchr): Likewise. (expand_builtin_strpbrk): Likewise. (expand_builtin_memcpy): Likewise. (expand_builtin_mempcpy): Likewise. (expand_builtin_mempcpy_args): New. (expand_builtin_memmove): Similarly to expand_builtin_mempcpy. (expand_builtin_memmove_args): New. (expand_builtin_bcopy): Similarly to expand_builtin_mempcpy. (expand_movstr): Likewise. (expand_builtin_strcpy): Likewise. (expand_builtin_strcpy_args): New. (expand_builtin_stpcpy): Similarly to expand_builtin_strcpy. (expand_builtin_strncpy): Likewise. (expand_builtin_memset): Likewise. (expand_builtin_memset_args): New. (expand_builtin_bzero): Similarly to expand_builtin_memset. (expand_builtin_memcmp): Likewise. (expand_builtin_strcmp): Likewise. (expand_builtin_strncmp): Likewise. (expand_builtin_strcat): Likewise. (expand_builtin_strncat): Likewise. (expand_builtin_strspn): Likewise. (expand_builtin_strcspn): Likewise. (expand_builtin_args_info): Likewise. (expand_builtin_va_start): Likewise. (gimplify_va_arg_expr): Likewise. (expand_builtin_va_end): Likewise. (expand_builtin_va_copy): Likewise. (expand_builtin_frame_address): Likewise. (expand_builtin_alloca): Likewise. (expand_builtin_bswap): Likewise. (expand_builtin_unop): Likewise. (expand_builtin_fputs): Likewise. (expand_builtin_expect): Likewise. (expand_builtin_fabs): Likewise. (expand_builtin_copysign): Likewise. (expand_builtin_printf): Likewise. (expand_builtin_fprintf): Likewise. (expand_builtin_sprintf): Likewise. (expand_builtin_init_trampoline): Likewise. (expand_builtin_signbit): Likewise. (expand_builtin_fork_or_exec): Likewise. (expand_builtin_sync_operation): Likewise. (expand_builtin_compare_and_swap): Likewise. (expand_builtin_lock_test_and_set): Likewise. (expand_builtin_lock_release): Likewise. (expand_builtin): Likewise. (builtin_mathfn_code): Likewise. (fold_builtin_constant_p): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_expect): Likewise. (fold_builtin_classify_type): Likewise. (fold_builtin_strlen): Likewise. (fold_builtin_nan): Likewise. (integer_valued_real_p): Likewise. (fold_trunc_transparent_mathfn): Likewise. (fold_fixed_mathfn): Likewise. (fold_builtin_cabs): Likewise. (fold_builtin_sqrt): Likewise. (fold_builtin_cbrt): Likewise. (fold_builtin_cos): Likewise. (fold_builtin_cosh): Likewise. (fold_builtin_tan): Likewise. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. (fold_builtin_trunc): Likewise. (fold_builtin_floor): Likewise. (fold_builtin_ceil): Likewise. (fold_builtin_round): Likewise. (fold_builtin_int_roundingfn): Likewise. (fold_builtin_bitop): Likewise. (fold_builtin_bswap): Likewise. (fold_builtin_logarithm): Likewise. (fold_builtin_hypot): Likewise. (fold_builtin_pow): Likewise. (fold_builtin_powi): Likewise. (fold_builtin_exponent): Likewise. (fold_builtin_memset): Likewise. (fold_builtin_bzero): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_bcopy): Deleted; call site changed to invoke fold_builtin_memory_op directly. (fold_builtin_strcpy): Similarly as for fold_builtin_memory_op. (fold_builtin_strncpy): Likewise. (fold_builtin_memcmp): Likewise. (fold_builtin_strcmp): Likewise. (fold_builtin_strncmp): Likewise. (fold_builtin_signbit): Likewise. (fold_builtin_copysign): Likewise. (fold_builtin_isascii): Likewise. (fold_builtin_toascii): Likewise. (fold_builtin_isdigit): Likewise. (fold_builtin_fabs): Likewise. (fold_builtin_abs): Likewise. (fold_builtin_fmin_fmax): Likewise. (fold_builtin_carg): Likewise. (fold_builtin_classify): Likewise. (fold_builtin_unordered_cmp): Likewise. (fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4): New functions split out from fold_builtin_1. (fold_builtin_n): New. (fold_builtin_varargs): New. (fold_builtin): Deleted. Most callers changed to use fold_call_expr instead. (fold_call_expr): New. (build_function_call_expr): Rewrite to use new helper function. (fold_builtin_call_list): New. (build_call_expr): New. (fold_builtin_call_valist): New. (rewrite_call_expr): New. (validate_arg): New. (validate_arglist): Change parameter to be entire CALL_EXPR instead of an arglist. Change return type to bool. Use new CALL_EXPR accessors. (fold_builtin_strstr): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (fold_builtin_strncat): Likewise. (fold_builtin_strspn): Likewise. (fold_builtin_strcspn): Likewise. (fold_builtin_fputs): Likewise. (fold_builtin_next_arg): Likewise. (fold_builtin_sprintf): Likewise. (expand_builtin_object_size): Use new CALL_EXPR accessors. Use NULL_RTX instead of 0. (expand_builtin_memory_chk): Likewise. (maybe_emit_chk_warning): Likewise. (maybe_emit_sprintf_chk_warning): Likewise. (fold_builtin_object_size): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strncat_chk): Likewise. (fold_builtin_sprintf_chk): Likewise. (fold_builtin_snprintf_chk): Likewise. (fold_builtin_printf): Likewise. (fold_builtin_vprintf): Likewise. * fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and constructors. (operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case. (make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (extract_muldiv_1): Add VL_EXP_CLASS_P case. (fold_mathfn_compare): Use new CALL_EXPR accessors and constructors. (fold_unary): Likewise. (fold_binary): Likewise. (fold_ternary): Remove CALL_EXPR case, since they are no longer ternary expressions. (fold): Add logic for tcc_vl_exp. (fold_checksum_tree): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (fold_build3_stat): Add assertion to flag broken interface for constructing CALL_EXPRs. (fold_build_call_list): New. (fold_build_call_list_initializer): New. (tree_expr_nonnegative_p): Use new CALL_EXPR accessors and constructors. (fold_strip_sign_ops): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR accessors and dump arguments explicitly. * tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (dump_generic_node): Use new CALL_EXPR accessors and walk arguments explicitly. (print_call_name): Use new CALL_EXPR accessors. * print-tree.c (print_node): Add case tcc_vl_exp. Print CALL_EXPR arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors. (vrp_visit_stmt): Likewise. * tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (force_move_till_expr): Likewise. * targhooks.c (default_external_stack_protect_fail): Use build_call_expr instead of build_function_call_expr. (default_hidden_stack_protect_fail): Likewise. * tree-complex.c (expand_complex_libcall): Use build_call_expr to build the call. * cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors and walk arguments explicitly. * tree-ssa-loop-niter.c (simplify_replace_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_simple_operations): Likewise. (infer_loop_bounds_from_array): Use new CALL_EXPR accessors. * gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs. * optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * value_prof.c (tree_ic): Use new CALL_EXPR accessors. (tree_ic_transform): Likewise. (interesting_stringop_to_profile_p): Pass entire CALL_EXPR as parameter instead of arglist. Fix callers. (tree_stringop_fixed_value): Use new CALL_EXPR accessors. (tree_stringops_transform): Likewise. (tree_indirect_call_to_profile): Likewise. (tree_stringops_values_to_profile): Likewise. * tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator. (eliminate_tail_call): Likewise. * ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (instantiate_parameters_1): Can't handle tcc_vl_exp here. * omp-low.c (build_omp_barrier): Use build_call_expr. (lower_rec_input_clauses): Likewise. (lower_reduction_clauses): Likewise. (expand_parallel_call): Likewise. (maybe_catch_exception): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_sections): Likewise. (lower_omp_single_simple): Likewise. (lower_omp_single_copy): Likewise. (lower_omp_master): Likewise. (lower_omp_ordered): Likewise. (lower_omp_critical): Likewise. * ipa-reference.c (check-call): Use new CALL_EXPR iterator. (scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR. * tree-gimple.c (is_gimple_call_addr): Fix doc. (recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. Add tcc_vl_exp case. * tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (chrec_contains_undetermined): Likewise. (tree_contains_chrecs): Likewise. (evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH. * cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors. * tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use fold_call_expr instead of fold_builtin. (ccp_fold_builtin): Likewise. Update calls into builtins.c to match declarations there. (fold_stmt): Use new CALL_EXPR constructor and accessors. Doc updates. * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-pure-const.c (check_call): Use new CALL_EXPR accessors. (scan_function): Add case tcc_vl_exp for CALL_EXPR. * tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR accessors. * tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr. (execute_cse_sincos): Use new CALL_EXPR accessors. * tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator. * gimple-low.c (lower_function_body): Use build_call_expr. (lower_builtin_setjmp): Likewise. * expr.c (emit_block_move_via_libcall): Use build_call_expr. (set_storage_via_libcall): Likewise. (safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_expr_real_1): Use new CALL_EXPR accessors. * tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (TB_parent_eq): Likewise. * predict.c (expr_expected_value): Use new CALL_EXPR accessors. (strip_builtin_expect): Likewise. * function.c (gimplify_parameters): Use build_call_expr. * tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-type-escape.c (check_call): Use new CALL_EXPR iterators. (scan_for_refs): Add case tcc_vl_exp for CALL_EXPR. * tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR iterators. * gimplify.c (build_stack_save_restore): Use build_call_expr. (gimplify_decl_expr): Likewise. (gimplify_call_expr): Use fold_call_expr instead of fold_builtin. Use new CALL_EXPR iterators. (gimplify_modify_expr_to_memcpy): Use build_call_expr. (gimplify_modify_expr_to_memset): Likewise. (gimplify_variable_sized_compare): Likewise. (gimplify_omp_atomic_fetch_op): Likewise. (gimplify_omp_atomic_pipeline): Likewise. (gimplify_omp_atomic_mutex): Likewise. (gimplify_function_tree): Likewise. * calls.c (alloca_call_p): Use new CALL_EXPR accessors. (call_expr_flags): Likewise. (expand_call): Likewise. * except.c (expand_builtin_eh_return_data_regno): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. * coverage.c (create_coverage): Use build_call_expr. * tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete. (temp_call_expr_obstack): New. (pool_copy_list): Delete. (temp_copy_call_expr): New. (phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. Get rid of special goo for copying argument lists and use temp_copy_call_expr instead. (valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. (create_expression_by_pieces): Likewise. Use build_call_array to construct the result instead of fold_build3. (create_value_expr_from): Add tcc_vl_exp. Delete special goo for dealing with argument lists. (init_pre): Remove references to expression_node_pool and list_node_pool. Init temp_call_expr_obstack instead. (fini_pre): Remove references to expression_node_pool and list_node_pool. * tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors and walk arguments explicitly instead of as a list. * tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr. (mx_register_decls): Likewise. (mudflap_register_call): Likewise. (mudflap_finish_file): Likewise. * ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors. (ipa_callsite_compute_param): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR accessors and constructor. * tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR accessors and constructor. (convert_tramp_reference): Likewise. (convert_call_expr): Likewise. (finalize_nesting_tree_1): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR accessors. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr. * tree-inline.c (initialize_inlined_parameters): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. (estimate_num_insns_1): Use new CALL_EXPR accessors. (expand_call_inline): Tidy up call to initialize_inlined_parameters. * tree-vect-transform.c (vect_create_epilog_for_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (vectorizable_reduction): Likewise. (vectorizable_call): Use new CALL_EXPR iterators. (vectorizable_conversion): Use build_call_expr. (vectorizable_operation): Use TREE_OPERAND_LENGTH. (vect_gen_widened_results_half): Use build_call_expr. (vect_setup_realignment): Likewise. (vectorizable_live_operation): Use TREE_OPERAND_LENGTH. * tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors. (pass_through_call): Likewise. (compute_object_sizes): Likewise. Use fold_call_expr instead of fold_builtin. * tree-profile.c (tree_gen_interval_profiler): Use build_call_expr. (tree_gen_pow2_profiler): Likewise. (tree_gen_one_value_profiler): Likewise. (tree_gen_ic_func_profiler): Likewise. (tree_gen_average_profiler): Likewise. (tree_gen_ior_profiler): Likewise. * tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp. (find_func_aliases): Use new CALL_EXPR accessors. Add case tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * convert.c (convert_to_real): Use new CALL_EXPR accessors and constructor. (convert_to_integer): Likewise. * tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR accessors. * config/frv/frv.c (frv_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_builtin): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr. (sparc_expand_builtin): Use new CALL_EXPR accessors. * config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise. (ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors on it. Fix callers. (ix86_expand_store_builtin): Likewise. (ix86_expand_unop_builtin): Likewise. (ix86_expand_unop1_builtin): Likewise. (ix86_expand_sse_compare): Likewise. (ix86_expand_sse_comi): Likewise. (ix86_expand_vec_init_builtin): Likewise. (ix86_expand_vec_ext_builtin): Likewise. (ix86_expand_vec_set_builtin): Likewise. (ix86_expand_builtin): Use new CALL_EXPR accessors. * config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (iq2000_expand_builtin): Use new CALL_EXPR accessors. * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use build_call_expr. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. (rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_abs_builtin): Likewise. (rs6000_expand_binop_builtin): Likewise. (altivec_expand_predicate_builtin): Likewise. (altivec_expand_lv_builtin): Likewise. (spe_expand_stv_builtin): Likewise. (altivec_expand_stv_builtin): Likewise. (rs6000_expand_ternop_builtin): Likewise. (altivec_expand_ld_builtin): Use new CALL_EXPR accessors. (altivec_expand_st_builtin): Likewise. (altivec_expand_dst_builtin): Likewise. (altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_vec_set_builtin): Likewise. (altivec_expand_vec_ext_builtin): Likewise. (altivec_expand_builtin): Use new CALL_EXPR accessors. (spe_expand_builtin): Likewise. (spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (spe_expand_evsel_builtin): Likewise. (rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and FCFSX cases must construct whole new CALL_EXPR, not just arglist. * config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (arm_expand_unop_builtin): Likewise. (arm_expand_builtin): Use new CALL_EXPR accessors. * config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR accessors. * config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (bfin_expand_unop_builtin): Likewise. (bfin_expand_builtin): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * c-semantics.c (build_stmt): Add internal diagnostic check. * c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR accessors. Print arguments explicitly instead of as a list. * c-typeck.c (build_function_call): Use new CALL_EXPR constructors. * c-omp.c (c_finish_omp_barrier): Use build_call_expr. (c_finish_omp_flish): Likewise. * c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (check_function_arguments_recurse): Use new CALL_EXPR accessors. (c_warn_unused_result): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. Change class to tcc_vl_exp. * call.c (build_call): Use build_call_list instead of build3. (build_over_call): Likewise. (build_new_method_call): Use build_min_non_dep_call_list instead of build_min_non_dep. * error.c (dump_call_expr_args): New function. (dump_aggr_init_expr_args): New function. (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. * cvt.c (convert_to_void): Use build_call_array instead of build3; use new AGGR_INIT_EXPR accessor macros. * mangle.c (write_expression): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new AGGR_INIT_EXPR accessor macros. * cp-gimplify.c (cp_gimplify_init_expr): Use AGGR_INIT_EXPR_SLOT to set the slot operand. * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. (AGGR_INIT_EXPR_SLOT): New macro. (AGGR_INIT_EXPR_ARG): New macro. (aggr_init_expr_nargs): New macro. (AGGR_INIT_EXPR_ARGP): New macro. (aggr_init_expr_arg_iterator): New. (init_aggr_init_expr_arg_iterator): New. (next_aggr_init_expr_arg): New. (first_aggr_init_expr_arg): New. (more_aggr_init_expr_args_p): New. (FOR_EACH_AGGR_INIT_EXPR_ARG): New. (stabilize_aggr_init): New declaration. (build_min_non_dep_call_list): Likewise. * tree.c (process_aggr_init_operands): New function. (build_aggr_init_array) New function. (build_cplus_new): Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. Replace use of build3 with build_aggr_init_array. (build_min_non_dep_call_list) New function. (build_min_nt): Assert input code parameter is not a variable length expression class. (build_min, build_min_non_dep): Likewise. (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments to check for equality instead of recursing. Handle tcc_vl_exp tree code classes. (stabilize_call): Update to only handle CALL_EXPRs, not AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. (stabilize_aggr_init): New function. (stabilize_init): Use it. * cxx-pretty-print.c (pp_cxx_postfix_expression) <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros and argument iterators. * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with build_vl_exp. Iterate through the operands, recursively processing each one. (tsubst_copy_and_build) <CALL_EXPR>: Update to use new CALL_EXPR accessor macros. (value_dependent_expression_p) <default>: Handle tcc_vl_exp tree code classes. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * semantics.c (finish_call_expr): Use build_nt_call_list instead of build_nt. (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR accessor macros. Use build_call_array to construct the CALL_EXPR node instead of build3 * decl2.c (build_offset_ref_call_from_tree): Use build_nt_call_list and build_min_non_dep_call_list instead of build_min_nt and build_min_non_dep. * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>: Use build_nt_call_list instead of build_min_nt. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead of build3. (BUILD_MONITOR_EXIT): Likewise. * java-gimplify.c (java_gimplify_component_ref): Use build_call_expr. (java_gimplify_modify_expr): Likewise. * class.c (cache_this_class_ref): Use build_call_expr. (build_static_field_ref): Likewise. (emit_indirect_register_classes): Likewise. (emit_register_classes): Likewise. * resource.c (write_resource_constructor): Use build_call_expr. * builtins.c (builtin_creator_function): Change interpretation of the second parameter to be the whole CALL_EXPR instead of the arglist. (max_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (min_builtin): Likewise. (abs_builtin): Likewise. (java_build_function_call_expr): Likewise. (convert_real): Likewise. (UNMARSHAL3): Likewise. (UNMARSHAL4): Likewise. (UNMARSHAL5): Likewise. (build_arglist_for_builtin): Delete. Fix callers to use build_call_expr instead. (putObject_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (compareAndSwapInt_builtin): Likewise. (compareAndSwapLong_builtin): Likewise. (compareAndSwapObject_builtin): Likewise. (putVolatile_builtin): Likewise. (getVolatile_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. (check_for_builtin): Pass entire CALL_EXPR to builtin expander instead of arglist. * expr.c (build_java_athrow): Use build_call_nary instead of build3. (build_java_throw_out_of_bounds_exception): Likewise. (java_check_reference): Likewise. (build_java_arraystore_check): Likewise. (build_newarray): Likewise. (build_anewarray): Likewise. (expand_java_multinewarray): Use build_call_list instead of build3. (build_java_monitor): Use build_call_nary instead of build3. (java_create_object): Likewise. (expand_java_NEW): Likewise. (build_instanceof): Likewise. (expand_java_CHECKCAST): Likewise. (build_java_soft_divmod): Likewise. (build_java_binop): Likewise. (build_field_ref): Likewise. (build_class_init): Likewise. (rewrite_arglist_getcaller): Use build_call_expr. (build_invokeinterface): Use build_call_nary instead of build3. (expand_invoke): Use build_call_list instead of build3. (build_jni_stub): Use build_call_nary, build_call_list, or build_call_expr instead of build3. (expand_java_field_op): Use build_call_expr instead of build3. (force_evaluation_order): Use new CALL_EXPR accessors. * lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors. (objc_get_callee_fndecl): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * trans-expr.c (gfc_conv_power_op): Use build_call_expr. (gfc_conv_string_tmp): Likewise. (gfc_conv_concat_op): Likewise. (gfc_build_compare_string): Likewise. (gfc_conv_function_call): Use build_call_list instead of build3. * trans-array.c (gfc_trans_allocate_array_storage): Use build_call_expr. (gfc_grow_array): Likewise. (gfc_trans_array_ctor_element): Likewise. (gfc_trans_array_constructor_value): Likewise. (gfc_array_allocate): Likewise. (gfc_array_deallocate): Likewise. (gfc_trans_auto_array_allocation): Likewise. (gfc_trans_dummy_array_bias): Likewise. (gfc_conv_array_parameter): Likewise. (gfc_trans_dealloc_allocated): Likewise. (gfc_duplicate_allocatable): Likewise. * trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr. (gfc_trans_omp_flush): Likewise. * trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr. (gfc_trans_pause): Likewise. (gfc_trans_stop): Likewise. (gfc_trans_character_select): Likewise. (gfc_do_allocate): Likewise. (gfc_trans_assign_need_temp): Likewise. (gfc_trans_pointer_assign_need_temp): Likewise. (gfc_trans_forall_1): Likewise. (gfc_trans_where_2): Likewise. (gfc_trans_allocate): Likewise. (gfc_trans_deallocate): Likewise. * trans.c (gfc_trans_runtime_check): Use build_call_expr. * trans-io.c (gfc_trans_open): Use build_call_expr. (gfc_trans_close): Likewise. (build_filepos): Likewise. (gfc_trans_inquire): Likewise. (NML_FIRST_ARG): Delete. (NML_ADD_ARG): Delete. (transfer_namelist_element): Use build_call_expr. (build_dt): Likewise. (gfc_trans_dt_end): Likewise. (transfer_expr): Likewise. (transfer_array-desc): Likewise. * trans-decl.c (gfc_generate_function_code): Use build_call_expr. (gfc_generate_constructors): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr. (gfc_conv_intrinsic_fdate): Likewise. (gfc_conv_intrinsic_ttynam): Likewise. (gfc_conv_intrinsic_array_transfer): Likewise. (gfc_conv_associated): Likewise. (gfc_conv_intrinsic_si_kind): Likewise. (gfc_conv_intrinsic_trim): Likewise. (gfc_conv_intrinsic_repeat: Likewise. (gfc_conv_intrinsic_iargc): Likewise. Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com> Co-Authored-By: Lee Millward <lee.millward@codesourcery.com> From-SVN: r122018
2007-02-16 00:50:49 +01:00
if (more_call_expr_args_p (&iter))
pp_cxx_separate_with (this, ',');
tree.h (enum tree_code_class): Add tcc_vl_exp. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree.h (enum tree_code_class): Add tcc_vl_exp. (VL_EXP_CLASS_P): New. (TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (TREE_OPERAND_CHECK_CODE): Likewise. (GIMPLE_STMT_OPERAND_CHECK): Likewise. (TREE_RTL_OPERAND_CHECK): Likewise. (tree_operand_check_failed): Make second parameter the whole tree instead of its code. Fixed callers. (VL_EXP_CHECK): New. (TREE_OPERAND_LENGTH): New. (VL_EXP_OPERAND_LENGTH): New. (CALL_EXPR_FN): New. (CALL_EXPR_STATIC_CHAIN): New. (CALL_EXPR_ARGS): New. (CALL_EXPR_ARG): New. (call_expr_nargs): New. (CALL_EXPR_ARGP): New. (build_nt_call_list): Declare. (build_vl_exp_stat): Declare. (build_vl_exp): New. (build_call_list): Declare. (build_call_nary): Declare. (build_call_valist): Declare. (build_call_array): Declare. (call_expr_arg): Declare. (call_expr_argp): Declare. (call_expr_arglist): Declare. (fold_build_call_list): Declare. (fold_build_call_list_initializer): Declare. (fold_call_expr): Declare to replace fold_builtin. (fold_builtin_fputs): Update to agree with modified definition. (fold_builtin_strcpy): Likewise. (fold_builtin_strncpy): Likewise. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_next_arg): Likewise. (fold_build_call_expr): Declare. (fold_builtin_call_list): Declare. (fold_builtin_call_valist): Declare. (build_call_expr): Declare. (validate_arglist): Update to agree with modified definition. (tree_operand_length): New. (call_expr_arg_iterator): New. (init_call_expr_arg_iterator): New. (next_call_expr_arg): New. (first_call_expr_arg): New. (more_call_expr_args_p): New. (FOR_EACH_CALL_EXPR_ARG): New. * tree.c (tree_code_class_string): Add entries for tcc_vl_exp and tcc_gimple_stmt. (tree_code_size): Update documentation. Use sizeof (tree) rather than sizeof (char *). (tree_size): Likewise. Add case for tcc_vl_exp. (tree_node_structure): Add case for tcc_vl_exp. (contains_placeholder_p): Likewise. (substitute_in_expr): Likewise. (substitute_placeholder_in_expr): Likewise. (stabilize_reference_1): Likewise. (build3_stat): Remove logic for CALL_EXPRs. Replace with assertion to diagnose breakage of this interface for constructing CALL_EXPRs. (build_nt): Add similar assertion here. (build_nt_call_list): New. (simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors. (iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (get_callee_fndecl): Use new CALL_EXPR accessors. (tree_operand_check_failed): Change parameters to pass entire node instead of its code, so that we can call TREE_OPERAND_LENGTH on it. (process_call_operands): New. (build_vl_exp_stat): New. (build_call_list): New. (build_call_nary): New. (build_call_valist): New. (build_call_array): New. (walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (call_expr_arglist): New. * tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use tcc_vl_exp instead of a fixed-size tcc_expression. * doc/c-tree.texi (CALL_EXPR): Document new representation and accessors for CALL_EXPRs. (AGGR_INIT_EXPR): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * builtins.c (c_strlen): Return NULL_TREE instead of 0. (expand_builtin_nonlocal_goto): Change parameter to be entire CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors. (expand_builtin_prefetch): Likewise. (expand_builtin_classify_type): Likewise. (mathfn_built_in): Return NULL_TREE instead of 0. (expand_errno_check): Use new CALL_EXPR accessors. (expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_int_roundingfn): Likewise. (expand_builtin_int_roundingfn_2): Likewise. (expand_builtin_pow): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead of arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_strstr): Likewise. (expand_builtin_strchr): Likewise. (expand_builtin_strrchr): Likewise. (expand_builtin_strpbrk): Likewise. (expand_builtin_memcpy): Likewise. (expand_builtin_mempcpy): Likewise. (expand_builtin_mempcpy_args): New. (expand_builtin_memmove): Similarly to expand_builtin_mempcpy. (expand_builtin_memmove_args): New. (expand_builtin_bcopy): Similarly to expand_builtin_mempcpy. (expand_movstr): Likewise. (expand_builtin_strcpy): Likewise. (expand_builtin_strcpy_args): New. (expand_builtin_stpcpy): Similarly to expand_builtin_strcpy. (expand_builtin_strncpy): Likewise. (expand_builtin_memset): Likewise. (expand_builtin_memset_args): New. (expand_builtin_bzero): Similarly to expand_builtin_memset. (expand_builtin_memcmp): Likewise. (expand_builtin_strcmp): Likewise. (expand_builtin_strncmp): Likewise. (expand_builtin_strcat): Likewise. (expand_builtin_strncat): Likewise. (expand_builtin_strspn): Likewise. (expand_builtin_strcspn): Likewise. (expand_builtin_args_info): Likewise. (expand_builtin_va_start): Likewise. (gimplify_va_arg_expr): Likewise. (expand_builtin_va_end): Likewise. (expand_builtin_va_copy): Likewise. (expand_builtin_frame_address): Likewise. (expand_builtin_alloca): Likewise. (expand_builtin_bswap): Likewise. (expand_builtin_unop): Likewise. (expand_builtin_fputs): Likewise. (expand_builtin_expect): Likewise. (expand_builtin_fabs): Likewise. (expand_builtin_copysign): Likewise. (expand_builtin_printf): Likewise. (expand_builtin_fprintf): Likewise. (expand_builtin_sprintf): Likewise. (expand_builtin_init_trampoline): Likewise. (expand_builtin_signbit): Likewise. (expand_builtin_fork_or_exec): Likewise. (expand_builtin_sync_operation): Likewise. (expand_builtin_compare_and_swap): Likewise. (expand_builtin_lock_test_and_set): Likewise. (expand_builtin_lock_release): Likewise. (expand_builtin): Likewise. (builtin_mathfn_code): Likewise. (fold_builtin_constant_p): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_expect): Likewise. (fold_builtin_classify_type): Likewise. (fold_builtin_strlen): Likewise. (fold_builtin_nan): Likewise. (integer_valued_real_p): Likewise. (fold_trunc_transparent_mathfn): Likewise. (fold_fixed_mathfn): Likewise. (fold_builtin_cabs): Likewise. (fold_builtin_sqrt): Likewise. (fold_builtin_cbrt): Likewise. (fold_builtin_cos): Likewise. (fold_builtin_cosh): Likewise. (fold_builtin_tan): Likewise. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. (fold_builtin_trunc): Likewise. (fold_builtin_floor): Likewise. (fold_builtin_ceil): Likewise. (fold_builtin_round): Likewise. (fold_builtin_int_roundingfn): Likewise. (fold_builtin_bitop): Likewise. (fold_builtin_bswap): Likewise. (fold_builtin_logarithm): Likewise. (fold_builtin_hypot): Likewise. (fold_builtin_pow): Likewise. (fold_builtin_powi): Likewise. (fold_builtin_exponent): Likewise. (fold_builtin_memset): Likewise. (fold_builtin_bzero): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_bcopy): Deleted; call site changed to invoke fold_builtin_memory_op directly. (fold_builtin_strcpy): Similarly as for fold_builtin_memory_op. (fold_builtin_strncpy): Likewise. (fold_builtin_memcmp): Likewise. (fold_builtin_strcmp): Likewise. (fold_builtin_strncmp): Likewise. (fold_builtin_signbit): Likewise. (fold_builtin_copysign): Likewise. (fold_builtin_isascii): Likewise. (fold_builtin_toascii): Likewise. (fold_builtin_isdigit): Likewise. (fold_builtin_fabs): Likewise. (fold_builtin_abs): Likewise. (fold_builtin_fmin_fmax): Likewise. (fold_builtin_carg): Likewise. (fold_builtin_classify): Likewise. (fold_builtin_unordered_cmp): Likewise. (fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4): New functions split out from fold_builtin_1. (fold_builtin_n): New. (fold_builtin_varargs): New. (fold_builtin): Deleted. Most callers changed to use fold_call_expr instead. (fold_call_expr): New. (build_function_call_expr): Rewrite to use new helper function. (fold_builtin_call_list): New. (build_call_expr): New. (fold_builtin_call_valist): New. (rewrite_call_expr): New. (validate_arg): New. (validate_arglist): Change parameter to be entire CALL_EXPR instead of an arglist. Change return type to bool. Use new CALL_EXPR accessors. (fold_builtin_strstr): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (fold_builtin_strncat): Likewise. (fold_builtin_strspn): Likewise. (fold_builtin_strcspn): Likewise. (fold_builtin_fputs): Likewise. (fold_builtin_next_arg): Likewise. (fold_builtin_sprintf): Likewise. (expand_builtin_object_size): Use new CALL_EXPR accessors. Use NULL_RTX instead of 0. (expand_builtin_memory_chk): Likewise. (maybe_emit_chk_warning): Likewise. (maybe_emit_sprintf_chk_warning): Likewise. (fold_builtin_object_size): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strncat_chk): Likewise. (fold_builtin_sprintf_chk): Likewise. (fold_builtin_snprintf_chk): Likewise. (fold_builtin_printf): Likewise. (fold_builtin_vprintf): Likewise. * fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and constructors. (operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case. (make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (extract_muldiv_1): Add VL_EXP_CLASS_P case. (fold_mathfn_compare): Use new CALL_EXPR accessors and constructors. (fold_unary): Likewise. (fold_binary): Likewise. (fold_ternary): Remove CALL_EXPR case, since they are no longer ternary expressions. (fold): Add logic for tcc_vl_exp. (fold_checksum_tree): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (fold_build3_stat): Add assertion to flag broken interface for constructing CALL_EXPRs. (fold_build_call_list): New. (fold_build_call_list_initializer): New. (tree_expr_nonnegative_p): Use new CALL_EXPR accessors and constructors. (fold_strip_sign_ops): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR accessors and dump arguments explicitly. * tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (dump_generic_node): Use new CALL_EXPR accessors and walk arguments explicitly. (print_call_name): Use new CALL_EXPR accessors. * print-tree.c (print_node): Add case tcc_vl_exp. Print CALL_EXPR arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors. (vrp_visit_stmt): Likewise. * tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (force_move_till_expr): Likewise. * targhooks.c (default_external_stack_protect_fail): Use build_call_expr instead of build_function_call_expr. (default_hidden_stack_protect_fail): Likewise. * tree-complex.c (expand_complex_libcall): Use build_call_expr to build the call. * cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors and walk arguments explicitly. * tree-ssa-loop-niter.c (simplify_replace_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_simple_operations): Likewise. (infer_loop_bounds_from_array): Use new CALL_EXPR accessors. * gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs. * optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * value_prof.c (tree_ic): Use new CALL_EXPR accessors. (tree_ic_transform): Likewise. (interesting_stringop_to_profile_p): Pass entire CALL_EXPR as parameter instead of arglist. Fix callers. (tree_stringop_fixed_value): Use new CALL_EXPR accessors. (tree_stringops_transform): Likewise. (tree_indirect_call_to_profile): Likewise. (tree_stringops_values_to_profile): Likewise. * tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator. (eliminate_tail_call): Likewise. * ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (instantiate_parameters_1): Can't handle tcc_vl_exp here. * omp-low.c (build_omp_barrier): Use build_call_expr. (lower_rec_input_clauses): Likewise. (lower_reduction_clauses): Likewise. (expand_parallel_call): Likewise. (maybe_catch_exception): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_sections): Likewise. (lower_omp_single_simple): Likewise. (lower_omp_single_copy): Likewise. (lower_omp_master): Likewise. (lower_omp_ordered): Likewise. (lower_omp_critical): Likewise. * ipa-reference.c (check-call): Use new CALL_EXPR iterator. (scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR. * tree-gimple.c (is_gimple_call_addr): Fix doc. (recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. Add tcc_vl_exp case. * tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (chrec_contains_undetermined): Likewise. (tree_contains_chrecs): Likewise. (evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH. * cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors. * tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use fold_call_expr instead of fold_builtin. (ccp_fold_builtin): Likewise. Update calls into builtins.c to match declarations there. (fold_stmt): Use new CALL_EXPR constructor and accessors. Doc updates. * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-pure-const.c (check_call): Use new CALL_EXPR accessors. (scan_function): Add case tcc_vl_exp for CALL_EXPR. * tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR accessors. * tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr. (execute_cse_sincos): Use new CALL_EXPR accessors. * tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator. * gimple-low.c (lower_function_body): Use build_call_expr. (lower_builtin_setjmp): Likewise. * expr.c (emit_block_move_via_libcall): Use build_call_expr. (set_storage_via_libcall): Likewise. (safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_expr_real_1): Use new CALL_EXPR accessors. * tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (TB_parent_eq): Likewise. * predict.c (expr_expected_value): Use new CALL_EXPR accessors. (strip_builtin_expect): Likewise. * function.c (gimplify_parameters): Use build_call_expr. * tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-type-escape.c (check_call): Use new CALL_EXPR iterators. (scan_for_refs): Add case tcc_vl_exp for CALL_EXPR. * tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR iterators. * gimplify.c (build_stack_save_restore): Use build_call_expr. (gimplify_decl_expr): Likewise. (gimplify_call_expr): Use fold_call_expr instead of fold_builtin. Use new CALL_EXPR iterators. (gimplify_modify_expr_to_memcpy): Use build_call_expr. (gimplify_modify_expr_to_memset): Likewise. (gimplify_variable_sized_compare): Likewise. (gimplify_omp_atomic_fetch_op): Likewise. (gimplify_omp_atomic_pipeline): Likewise. (gimplify_omp_atomic_mutex): Likewise. (gimplify_function_tree): Likewise. * calls.c (alloca_call_p): Use new CALL_EXPR accessors. (call_expr_flags): Likewise. (expand_call): Likewise. * except.c (expand_builtin_eh_return_data_regno): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. * coverage.c (create_coverage): Use build_call_expr. * tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete. (temp_call_expr_obstack): New. (pool_copy_list): Delete. (temp_copy_call_expr): New. (phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. Get rid of special goo for copying argument lists and use temp_copy_call_expr instead. (valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. (create_expression_by_pieces): Likewise. Use build_call_array to construct the result instead of fold_build3. (create_value_expr_from): Add tcc_vl_exp. Delete special goo for dealing with argument lists. (init_pre): Remove references to expression_node_pool and list_node_pool. Init temp_call_expr_obstack instead. (fini_pre): Remove references to expression_node_pool and list_node_pool. * tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors and walk arguments explicitly instead of as a list. * tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr. (mx_register_decls): Likewise. (mudflap_register_call): Likewise. (mudflap_finish_file): Likewise. * ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors. (ipa_callsite_compute_param): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR accessors and constructor. * tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR accessors and constructor. (convert_tramp_reference): Likewise. (convert_call_expr): Likewise. (finalize_nesting_tree_1): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR accessors. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr. * tree-inline.c (initialize_inlined_parameters): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. (estimate_num_insns_1): Use new CALL_EXPR accessors. (expand_call_inline): Tidy up call to initialize_inlined_parameters. * tree-vect-transform.c (vect_create_epilog_for_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (vectorizable_reduction): Likewise. (vectorizable_call): Use new CALL_EXPR iterators. (vectorizable_conversion): Use build_call_expr. (vectorizable_operation): Use TREE_OPERAND_LENGTH. (vect_gen_widened_results_half): Use build_call_expr. (vect_setup_realignment): Likewise. (vectorizable_live_operation): Use TREE_OPERAND_LENGTH. * tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors. (pass_through_call): Likewise. (compute_object_sizes): Likewise. Use fold_call_expr instead of fold_builtin. * tree-profile.c (tree_gen_interval_profiler): Use build_call_expr. (tree_gen_pow2_profiler): Likewise. (tree_gen_one_value_profiler): Likewise. (tree_gen_ic_func_profiler): Likewise. (tree_gen_average_profiler): Likewise. (tree_gen_ior_profiler): Likewise. * tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp. (find_func_aliases): Use new CALL_EXPR accessors. Add case tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * convert.c (convert_to_real): Use new CALL_EXPR accessors and constructor. (convert_to_integer): Likewise. * tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR accessors. * config/frv/frv.c (frv_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_builtin): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr. (sparc_expand_builtin): Use new CALL_EXPR accessors. * config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise. (ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors on it. Fix callers. (ix86_expand_store_builtin): Likewise. (ix86_expand_unop_builtin): Likewise. (ix86_expand_unop1_builtin): Likewise. (ix86_expand_sse_compare): Likewise. (ix86_expand_sse_comi): Likewise. (ix86_expand_vec_init_builtin): Likewise. (ix86_expand_vec_ext_builtin): Likewise. (ix86_expand_vec_set_builtin): Likewise. (ix86_expand_builtin): Use new CALL_EXPR accessors. * config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (iq2000_expand_builtin): Use new CALL_EXPR accessors. * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use build_call_expr. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. (rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_abs_builtin): Likewise. (rs6000_expand_binop_builtin): Likewise. (altivec_expand_predicate_builtin): Likewise. (altivec_expand_lv_builtin): Likewise. (spe_expand_stv_builtin): Likewise. (altivec_expand_stv_builtin): Likewise. (rs6000_expand_ternop_builtin): Likewise. (altivec_expand_ld_builtin): Use new CALL_EXPR accessors. (altivec_expand_st_builtin): Likewise. (altivec_expand_dst_builtin): Likewise. (altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_vec_set_builtin): Likewise. (altivec_expand_vec_ext_builtin): Likewise. (altivec_expand_builtin): Use new CALL_EXPR accessors. (spe_expand_builtin): Likewise. (spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (spe_expand_evsel_builtin): Likewise. (rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and FCFSX cases must construct whole new CALL_EXPR, not just arglist. * config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (arm_expand_unop_builtin): Likewise. (arm_expand_builtin): Use new CALL_EXPR accessors. * config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR accessors. * config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (bfin_expand_unop_builtin): Likewise. (bfin_expand_builtin): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * c-semantics.c (build_stmt): Add internal diagnostic check. * c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR accessors. Print arguments explicitly instead of as a list. * c-typeck.c (build_function_call): Use new CALL_EXPR constructors. * c-omp.c (c_finish_omp_barrier): Use build_call_expr. (c_finish_omp_flish): Likewise. * c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (check_function_arguments_recurse): Use new CALL_EXPR accessors. (c_warn_unused_result): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. Change class to tcc_vl_exp. * call.c (build_call): Use build_call_list instead of build3. (build_over_call): Likewise. (build_new_method_call): Use build_min_non_dep_call_list instead of build_min_non_dep. * error.c (dump_call_expr_args): New function. (dump_aggr_init_expr_args): New function. (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. * cvt.c (convert_to_void): Use build_call_array instead of build3; use new AGGR_INIT_EXPR accessor macros. * mangle.c (write_expression): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new AGGR_INIT_EXPR accessor macros. * cp-gimplify.c (cp_gimplify_init_expr): Use AGGR_INIT_EXPR_SLOT to set the slot operand. * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. (AGGR_INIT_EXPR_SLOT): New macro. (AGGR_INIT_EXPR_ARG): New macro. (aggr_init_expr_nargs): New macro. (AGGR_INIT_EXPR_ARGP): New macro. (aggr_init_expr_arg_iterator): New. (init_aggr_init_expr_arg_iterator): New. (next_aggr_init_expr_arg): New. (first_aggr_init_expr_arg): New. (more_aggr_init_expr_args_p): New. (FOR_EACH_AGGR_INIT_EXPR_ARG): New. (stabilize_aggr_init): New declaration. (build_min_non_dep_call_list): Likewise. * tree.c (process_aggr_init_operands): New function. (build_aggr_init_array) New function. (build_cplus_new): Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. Replace use of build3 with build_aggr_init_array. (build_min_non_dep_call_list) New function. (build_min_nt): Assert input code parameter is not a variable length expression class. (build_min, build_min_non_dep): Likewise. (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments to check for equality instead of recursing. Handle tcc_vl_exp tree code classes. (stabilize_call): Update to only handle CALL_EXPRs, not AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. (stabilize_aggr_init): New function. (stabilize_init): Use it. * cxx-pretty-print.c (pp_cxx_postfix_expression) <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros and argument iterators. * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with build_vl_exp. Iterate through the operands, recursively processing each one. (tsubst_copy_and_build) <CALL_EXPR>: Update to use new CALL_EXPR accessor macros. (value_dependent_expression_p) <default>: Handle tcc_vl_exp tree code classes. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * semantics.c (finish_call_expr): Use build_nt_call_list instead of build_nt. (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR accessor macros. Use build_call_array to construct the CALL_EXPR node instead of build3 * decl2.c (build_offset_ref_call_from_tree): Use build_nt_call_list and build_min_non_dep_call_list instead of build_min_nt and build_min_non_dep. * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>: Use build_nt_call_list instead of build_min_nt. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead of build3. (BUILD_MONITOR_EXIT): Likewise. * java-gimplify.c (java_gimplify_component_ref): Use build_call_expr. (java_gimplify_modify_expr): Likewise. * class.c (cache_this_class_ref): Use build_call_expr. (build_static_field_ref): Likewise. (emit_indirect_register_classes): Likewise. (emit_register_classes): Likewise. * resource.c (write_resource_constructor): Use build_call_expr. * builtins.c (builtin_creator_function): Change interpretation of the second parameter to be the whole CALL_EXPR instead of the arglist. (max_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (min_builtin): Likewise. (abs_builtin): Likewise. (java_build_function_call_expr): Likewise. (convert_real): Likewise. (UNMARSHAL3): Likewise. (UNMARSHAL4): Likewise. (UNMARSHAL5): Likewise. (build_arglist_for_builtin): Delete. Fix callers to use build_call_expr instead. (putObject_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (compareAndSwapInt_builtin): Likewise. (compareAndSwapLong_builtin): Likewise. (compareAndSwapObject_builtin): Likewise. (putVolatile_builtin): Likewise. (getVolatile_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. (check_for_builtin): Pass entire CALL_EXPR to builtin expander instead of arglist. * expr.c (build_java_athrow): Use build_call_nary instead of build3. (build_java_throw_out_of_bounds_exception): Likewise. (java_check_reference): Likewise. (build_java_arraystore_check): Likewise. (build_newarray): Likewise. (build_anewarray): Likewise. (expand_java_multinewarray): Use build_call_list instead of build3. (build_java_monitor): Use build_call_nary instead of build3. (java_create_object): Likewise. (expand_java_NEW): Likewise. (build_instanceof): Likewise. (expand_java_CHECKCAST): Likewise. (build_java_soft_divmod): Likewise. (build_java_binop): Likewise. (build_field_ref): Likewise. (build_class_init): Likewise. (rewrite_arglist_getcaller): Use build_call_expr. (build_invokeinterface): Use build_call_nary instead of build3. (expand_invoke): Use build_call_list instead of build3. (build_jni_stub): Use build_call_nary, build_call_list, or build_call_expr instead of build3. (expand_java_field_op): Use build_call_expr instead of build3. (force_evaluation_order): Use new CALL_EXPR accessors. * lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors. (objc_get_callee_fndecl): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * trans-expr.c (gfc_conv_power_op): Use build_call_expr. (gfc_conv_string_tmp): Likewise. (gfc_conv_concat_op): Likewise. (gfc_build_compare_string): Likewise. (gfc_conv_function_call): Use build_call_list instead of build3. * trans-array.c (gfc_trans_allocate_array_storage): Use build_call_expr. (gfc_grow_array): Likewise. (gfc_trans_array_ctor_element): Likewise. (gfc_trans_array_constructor_value): Likewise. (gfc_array_allocate): Likewise. (gfc_array_deallocate): Likewise. (gfc_trans_auto_array_allocation): Likewise. (gfc_trans_dummy_array_bias): Likewise. (gfc_conv_array_parameter): Likewise. (gfc_trans_dealloc_allocated): Likewise. (gfc_duplicate_allocatable): Likewise. * trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr. (gfc_trans_omp_flush): Likewise. * trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr. (gfc_trans_pause): Likewise. (gfc_trans_stop): Likewise. (gfc_trans_character_select): Likewise. (gfc_do_allocate): Likewise. (gfc_trans_assign_need_temp): Likewise. (gfc_trans_pointer_assign_need_temp): Likewise. (gfc_trans_forall_1): Likewise. (gfc_trans_where_2): Likewise. (gfc_trans_allocate): Likewise. (gfc_trans_deallocate): Likewise. * trans.c (gfc_trans_runtime_check): Use build_call_expr. * trans-io.c (gfc_trans_open): Use build_call_expr. (gfc_trans_close): Likewise. (build_filepos): Likewise. (gfc_trans_inquire): Likewise. (NML_FIRST_ARG): Delete. (NML_ADD_ARG): Delete. (transfer_namelist_element): Use build_call_expr. (build_dt): Likewise. (gfc_trans_dt_end): Likewise. (transfer_expr): Likewise. (transfer_array-desc): Likewise. * trans-decl.c (gfc_generate_function_code): Use build_call_expr. (gfc_generate_constructors): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr. (gfc_conv_intrinsic_fdate): Likewise. (gfc_conv_intrinsic_ttynam): Likewise. (gfc_conv_intrinsic_array_transfer): Likewise. (gfc_conv_associated): Likewise. (gfc_conv_intrinsic_si_kind): Likewise. (gfc_conv_intrinsic_trim): Likewise. (gfc_conv_intrinsic_repeat: Likewise. (gfc_conv_intrinsic_iargc): Likewise. Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com> Co-Authored-By: Lee Millward <lee.millward@codesourcery.com> From-SVN: r122018
2007-02-16 00:50:49 +01:00
}
}
}
pp_cxx_right_paren (this);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
if (code == AGGR_INIT_EXPR && AGGR_INIT_VIA_CTOR_P (t))
{
pp_cxx_separate_with (this, ',');
postfix_expression (AGGR_INIT_EXPR_SLOT (t));
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case BASELINK:
case VAR_DECL:
case PARM_DECL:
case FIELD_DECL:
case FUNCTION_DECL:
case OVERLOAD:
case CONST_DECL:
case TEMPLATE_DECL:
case RESULT_DECL:
primary_expression (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
case DYNAMIC_CAST_EXPR:
case STATIC_CAST_EXPR:
case REINTERPRET_CAST_EXPR:
case CONST_CAST_EXPR:
if (code == DYNAMIC_CAST_EXPR)
pp_cxx_ws_string (this, "dynamic_cast");
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
else if (code == STATIC_CAST_EXPR)
pp_cxx_ws_string (this, "static_cast");
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
else if (code == REINTERPRET_CAST_EXPR)
pp_cxx_ws_string (this, "reinterpret_cast");
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
else
pp_cxx_ws_string (this, "const_cast");
pp_cxx_begin_template_argument_list (this);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
type_id (TREE_TYPE (t));
pp_cxx_end_template_argument_list (this);
pp_left_paren (this);
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
expression (TREE_OPERAND (t, 0));
pp_right_paren (this);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
case EMPTY_CLASS_EXPR:
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
type_id (TREE_TYPE (t));
pp_left_paren (this);
pp_right_paren (this);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
case TYPEID_EXPR:
pp_cxx_typeid_expression (this, t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
case PSEUDO_DTOR_EXPR:
postfix_expression (TREE_OPERAND (t, 0));
pp_cxx_dot (this);
if (TREE_OPERAND (t, 1))
{
pp_cxx_qualified_id (this, TREE_OPERAND (t, 1));
pp_cxx_colon_colon (this);
}
pp_complement (this);
pp_cxx_unqualified_id (this, TREE_OPERAND (t, 2));
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
case ARROW_EXPR:
postfix_expression (TREE_OPERAND (t, 0));
pp_cxx_arrow (this);
break;
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
default:
c_pretty_printer::postfix_expression (t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
}
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
/* new-expression:
::(opt) new new-placement(opt) new-type-id new-initializer(opt)
::(opt) new new-placement(opt) ( type-id ) new-initializer(opt)
new-placement:
( expression-list )
new-type-id:
type-specifier-seq new-declarator(opt)
new-declarator:
ptr-operator new-declarator(opt)
direct-new-declarator
direct-new-declarator
[ expression ]
direct-new-declarator [ constant-expression ]
new-initializer:
( expression-list(opt) ) */
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
static void
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
pp_cxx_new_expression (cxx_pretty_printer *pp, tree t)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
{
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
enum tree_code code = TREE_CODE (t);
tree type = TREE_OPERAND (t, 1);
tree init = TREE_OPERAND (t, 2);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
switch (code)
{
case NEW_EXPR:
case VEC_NEW_EXPR:
if (NEW_EXPR_USE_GLOBAL (t))
pp_cxx_colon_colon (pp);
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "new");
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
if (TREE_OPERAND (t, 0))
{
pp_cxx_call_argument_list (pp, TREE_OPERAND (t, 0));
pp_space (pp);
}
if (TREE_CODE (type) == ARRAY_REF)
type = build_cplus_array_type
(TREE_OPERAND (type, 0),
re PR c/40435 (Revision 148442 caused many regressions on trunk) 2009-07-17 Aldy Hernandez <aldyh@redhat.com> Manuel López-Ibáñez <manu@gcc.gnu.org> PR 40435 * tree-complex.c, tree-loop-distribution.c, tree.c, tree.h, builtins.c, fold-const.c, omp-low.c, cgraphunit.c, tree-ssa-ccp.c, tree-ssa-dom.c, gimple-low.c, expr.c, tree-ssa-ifcombine.c, c-decl.c, stor-layout.c, tree-if-conv.c, c-typeck.c, gimplify.c, calls.c, tree-sra.c, tree-mudflap.c, tree-ssa-copy.c, tree-ssa-forwprop.c, c-convert.c, c-omp.c, varasm.c, tree-inline.c, c-common.c, c-common.h, gimple.c, tree-switch-conversion.c, gimple.h, tree-cfg.c, c-parser.c, convert.c: Add location argument to fold_{unary,binary,ternary}, fold_build[123], build_call_expr, build_size_arg, build_fold_addr_expr, build_call_array, non_lvalue, size_diffop, fold_build1_initializer, fold_build2_initializer, fold_build3_initializer, fold_build_call_array, fold_build_call_array_initializer, fold_single_bit_test, omit_one_operand, omit_two_operands, invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref, combine_comparisons, fold_builtin_*, fold_call_expr, build_range_check, maybe_fold_offset_to_address, round_up, round_down. objc/ * objc-act.c: Add location argument to all calls to build_fold_addr_expr. testsuite/ * gcc.dg/pr36902.c: Add column info. * g++.dg/gcov/gcov-2.C: Change count for definition. cp/ * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c, tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c, call.c, cvt.c, mangle.c: Add location argument to fold_{unary,binary,ternary}, fold_build[123], build_call_expr, build_size_arg, build_fold_addr_expr, build_call_array, non_lvalue, size_diffop, fold_build1_initializer, fold_build2_initializer, fold_build3_initializer, fold_build_call_array, fold_build_call_array_initializer, fold_single_bit_test, omit_one_operand, omit_two_operands, invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref, combine_comparisons, fold_builtin_*, fold_call_expr, build_range_check, maybe_fold_offset_to_address, round_up, round_down. fortran/ * trans-expr.c, trans-array.c, trans-openmp.c, trans-stmt.c, trans.c, trans-io.c, trans-decl.c, trans-intrinsic.c: Add location argument to fold_{unary,binary,ternary}, fold_build[123], build_call_expr, build_size_arg, build_fold_addr_expr, build_call_array, non_lvalue, size_diffop, fold_build1_initializer, fold_build2_initializer, fold_build3_initializer, fold_build_call_array, fold_build_call_array_initializer, fold_single_bit_test, omit_one_operand, omit_two_operands, invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref, combine_comparisons, fold_builtin_*, fold_call_expr, build_range_check, maybe_fold_offset_to_address, round_up, round_down. Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r149722
2009-07-17 00:29:52 +02:00
build_index_type (fold_build2_loc (input_location,
MINUS_EXPR, integer_type_node,
TREE_OPERAND (type, 1),
integer_one_node)));
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->type_id (type);
if (init)
{
pp_left_paren (pp);
if (TREE_CODE (init) == TREE_LIST)
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
2013-08-05 06:00:57 +02:00
pp_c_expression_list (pp, init);
tree.def (VOID_CST): New. gcc/ * tree.def (VOID_CST): New. * tree-core.h (TI_VOID): New. * tree.h (void_node): New. * tree.c (tree_node_structure_for_code, tree_code_size) (iterative_hash_expr): Handle VOID_CST. (build_common_tree_nodes): Initialize void_node. gcc/c-family/ * c-common.h (CTI_VOID_ZERO, void_zero_node): Delete. * c-common.c (c_common_nodes_and_builtins): Don't initialize void_zero_node. * c-pretty-print.c (pp_c_void_constant): New function. (c_pretty_printer::constant, c_pretty_printer::primary_expression) (c_pretty_printer::expression): Handle VOID_CST. * cilk.c (extract_free_variables): Likewise. * c-ubsan.c (ubsan_instrument_division, ubsan_instrument_shift) (ubsan_instrument_vla): Use void_node instead of void_zero_node. gcc/c/ * c-array-notation.c (expand_array_notations): Use void_node instead of void_zero_node. gcc/cp/ * cvt.c (convert_to_void): Use void_node instead of void_zero_node. * cp-array-notation.c (replace_invariant_exprs): Likewise. (expand_array_notation): Handle VOID_CST. * error.c (dump_expr): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Likewise. (pp_cxx_new_expression): Use void_node instead of void_zero_node. * decl.c (register_dtor_fn): Likewise. * init.c (build_raw_new_expr, build_new_1, build_vec_init) (build_delete, push_base_cleanups): Likewise. * mangle.c (write_expression): Likewise. * semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise. * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise. (tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST. * tree.c (cp_tree_equal): Likewise. (build_dummy_object, is_dummy_object, stabilize_expr): Use void_node instead of void_zero_node. * typeck.c (check_return_expr): Likewise. * typeck2.c (build_functional_cast): Likewise. From-SVN: r210692
2014-05-21 13:00:35 +02:00
else if (init == void_node)
; /* OK, empty initializer list. */
else
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->expression (init);
pp_right_paren (pp);
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
default:
pp_unsupported_tree (pp, t);
}
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
/* delete-expression:
::(opt) delete cast-expression
::(opt) delete [ ] cast-expression */
static void
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
{
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
enum tree_code code = TREE_CODE (t);
switch (code)
{
case DELETE_EXPR:
case VEC_DELETE_EXPR:
if (DELETE_EXPR_USE_GLOBAL (t))
pp_cxx_colon_colon (pp);
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "delete");
pp_space (pp);
if (code == VEC_DELETE_EXPR
|| DELETE_EXPR_USE_VEC (t))
{
pp_left_bracket (pp);
pp_right_bracket (pp);
pp_space (pp);
}
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
2013-08-05 06:00:57 +02:00
pp_c_cast_expression (pp, TREE_OPERAND (t, 0));
break;
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
default:
pp_unsupported_tree (pp, t);
}
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
/* unary-expression:
postfix-expression
++ cast-expression
-- cast-expression
unary-operator cast-expression
sizeof unary-expression
sizeof ( type-id )
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
sizeof ... ( identifier )
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
new-expression
delete-expression
unary-operator: one of
* & + - !
GNU extensions:
__alignof__ unary-expression
__alignof__ ( type-id ) */
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
void
cxx_pretty_printer::unary_expression (tree t)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
{
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
enum tree_code code = TREE_CODE (t);
switch (code)
{
case NEW_EXPR:
case VEC_NEW_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_new_expression (this, t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
case DELETE_EXPR:
case VEC_DELETE_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_delete_expression (this, t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
case SIZEOF_EXPR:
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
if (PACK_EXPANSION_P (TREE_OPERAND (t, 0)))
{
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_ws_string (this, "sizeof");
pp_cxx_ws_string (this, "...");
pp_cxx_whitespace (this);
pp_cxx_left_paren (this);
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
if (TYPE_P (TREE_OPERAND (t, 0)))
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
type_id (TREE_OPERAND (t, 0));
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
else
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
unary_expression (TREE_OPERAND (t, 0));
pp_cxx_right_paren (this);
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
break;
}
/* Fall through */
case ALIGNOF_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_ws_string (this, code == SIZEOF_EXPR ? "sizeof" : "__alignof__");
pp_cxx_whitespace (this);
cp-tree.h (SIZEOF_EXPR_TYPE_P): Define. cp/ * cp-tree.h (SIZEOF_EXPR_TYPE_P): Define. * tree.c (cp_tree_equal): Handle SIZEOF_EXPR with SIZEOF_EXPR_TYPE_P. * mangle.c (write_expression): Likewise. * cxx-pretty-print.c (pp_cxx_unary_expression): Likewise. * error.c (dump_expr): Likewise. * parser.c (cp_parser_unary_expression): For sizeof call cxx_sizeof_or_alignof_{type,expr} just for diagnostics and return SIZEOF_EXPR with the operand. * pt.c (tsubst_copy, tsubst_copy_and_build): For SIZEOF_EXPR, call cxx_sizeof_or_alignof_{type,expr} for diagnostics, but return SIZEOF_EXPR with tsubsted operand. (value_dependent_expression_p): Handle SIZEOF_EXPR with SIZEOF_EXPR_TYPE_P. (instantiation_dependent_r): Likewise. * call.c (null_ptr_cst_p): Call maybe_constant_value for C++98. * semantics.c (finish_call_expr): Call sizeof_pointer_memaccess_warning if needed. (cxx_eval_constant_expression): Handle SIZEOF_EXPR. (potential_constant_expression_1): Remove early exit for C++98. Handle PROPERTY_REF. * decl.c (duplicate_decls): When redeclaring a builtin function, keep the merged decl builtin also if newdecl is a gnu_inline inline definition. (fold_sizeof_expr_r): New function. (compute_array_index_type): Fold SIZEOF_EXPRs in itype. * cp-gimplify.c (cp_genericize_r): Fold SIZEOF_EXPR. * typeck.c (cp_build_binary_op): For warn_for_sign_compare try harder using maybe_constant_value to get INTEGER_CSTs. * decl.c (stabilize_vla_size): Call pointer_set_destroy at the end. testsuite/ * g++.dg/torture/Wsizeof-pointer-memaccess1.C: New test. * g++.dg/torture/Wsizeof-pointer-memaccess2.C: New test. * g++.dg/warn/Wsign-compare-5.C: New test. * g++.dg/warn/Wsizeof-pointer-memaccess-1.C: New test. * g++.dg/warn/Wnull-conversion-1.C: For c++11 add dg-error. * g++.dg/ext/builtin30.C: New test. * g++.dg/ext/vla12.C: New test. * gcc.dg/builtins-85.c: New test. libstdc++-v3/ * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers. From-SVN: r192141
2012-10-05 21:30:39 +02:00
if (TREE_CODE (t) == SIZEOF_EXPR && SIZEOF_EXPR_TYPE_P (t))
{
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_left_paren (this);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
type_id (TREE_TYPE (TREE_OPERAND (t, 0)));
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_right_paren (this);
cp-tree.h (SIZEOF_EXPR_TYPE_P): Define. cp/ * cp-tree.h (SIZEOF_EXPR_TYPE_P): Define. * tree.c (cp_tree_equal): Handle SIZEOF_EXPR with SIZEOF_EXPR_TYPE_P. * mangle.c (write_expression): Likewise. * cxx-pretty-print.c (pp_cxx_unary_expression): Likewise. * error.c (dump_expr): Likewise. * parser.c (cp_parser_unary_expression): For sizeof call cxx_sizeof_or_alignof_{type,expr} just for diagnostics and return SIZEOF_EXPR with the operand. * pt.c (tsubst_copy, tsubst_copy_and_build): For SIZEOF_EXPR, call cxx_sizeof_or_alignof_{type,expr} for diagnostics, but return SIZEOF_EXPR with tsubsted operand. (value_dependent_expression_p): Handle SIZEOF_EXPR with SIZEOF_EXPR_TYPE_P. (instantiation_dependent_r): Likewise. * call.c (null_ptr_cst_p): Call maybe_constant_value for C++98. * semantics.c (finish_call_expr): Call sizeof_pointer_memaccess_warning if needed. (cxx_eval_constant_expression): Handle SIZEOF_EXPR. (potential_constant_expression_1): Remove early exit for C++98. Handle PROPERTY_REF. * decl.c (duplicate_decls): When redeclaring a builtin function, keep the merged decl builtin also if newdecl is a gnu_inline inline definition. (fold_sizeof_expr_r): New function. (compute_array_index_type): Fold SIZEOF_EXPRs in itype. * cp-gimplify.c (cp_genericize_r): Fold SIZEOF_EXPR. * typeck.c (cp_build_binary_op): For warn_for_sign_compare try harder using maybe_constant_value to get INTEGER_CSTs. * decl.c (stabilize_vla_size): Call pointer_set_destroy at the end. testsuite/ * g++.dg/torture/Wsizeof-pointer-memaccess1.C: New test. * g++.dg/torture/Wsizeof-pointer-memaccess2.C: New test. * g++.dg/warn/Wsign-compare-5.C: New test. * g++.dg/warn/Wsizeof-pointer-memaccess-1.C: New test. * g++.dg/warn/Wnull-conversion-1.C: For c++11 add dg-error. * g++.dg/ext/builtin30.C: New test. * g++.dg/ext/vla12.C: New test. * gcc.dg/builtins-85.c: New test. libstdc++-v3/ * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers. From-SVN: r192141
2012-10-05 21:30:39 +02:00
}
else if (TYPE_P (TREE_OPERAND (t, 0)))
{
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_left_paren (this);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
type_id (TREE_OPERAND (t, 0));
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_right_paren (this);
}
else
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
unary_expression (TREE_OPERAND (t, 0));
break;
case AT_ENCODE_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_ws_string (this, "@encode");
pp_cxx_whitespace (this);
pp_cxx_left_paren (this);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
type_id (TREE_OPERAND (t, 0));
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_right_paren (this);
break;
case NOEXCEPT_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_ws_string (this, "noexcept");
pp_cxx_whitespace (this);
pp_cxx_left_paren (this);
expression (TREE_OPERAND (t, 0));
pp_cxx_right_paren (this);
break;
case UNARY_PLUS_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_plus (this);
pp_cxx_cast_expression (this, TREE_OPERAND (t, 0));
break;
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
default:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
c_pretty_printer::unary_expression (t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
}
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
/* cast-expression:
unary-expression
( type-id ) cast-expression */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void
pp_cxx_cast_expression (cxx_pretty_printer *pp, tree t)
{
switch (TREE_CODE (t))
{
case CAST_EXPR:
case IMPLICIT_CONV_EXPR:
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->type_id (TREE_TYPE (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_call_argument_list (pp, TREE_OPERAND (t, 0));
break;
default:
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
2013-08-05 06:00:57 +02:00
pp_c_cast_expression (pp, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
}
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
/* pm-expression:
cast-expression
pm-expression .* cast-expression
pm-expression ->* cast-expression */
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
static void
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
pp_cxx_pm_expression (cxx_pretty_printer *pp, tree t)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
{
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
switch (TREE_CODE (t))
{
/* Handle unfortunate OFFSET_REF overloading here. */
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
case OFFSET_REF:
if (TYPE_P (TREE_OPERAND (t, 0)))
{
pp_cxx_qualified_id (pp, t);
break;
}
re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. From-SVN: r239410
2016-08-12 12:30:47 +02:00
/* Fall through. */
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
case MEMBER_REF:
case DOTSTAR_EXPR:
pp_cxx_pm_expression (pp, TREE_OPERAND (t, 0));
if (TREE_CODE (t) == MEMBER_REF)
pp_cxx_arrow (pp);
else
pp_cxx_dot (pp);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
pp_star(pp);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_cast_expression (pp, TREE_OPERAND (t, 1));
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
default:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_cast_expression (pp, t);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
}
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
/* multiplicative-expression:
pm-expression
multiplicative-expression * pm-expression
multiplicative-expression / pm-expression
multiplicative-expression % pm-expression */
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
void
cxx_pretty_printer::multiplicative_expression (tree e)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
{
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
enum tree_code code = TREE_CODE (e);
switch (code)
{
case MULT_EXPR:
case TRUNC_DIV_EXPR:
case TRUNC_MOD_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
multiplicative_expression (TREE_OPERAND (e, 0));
pp_space (this);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
if (code == MULT_EXPR)
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_star (this);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
else if (code == TRUNC_DIV_EXPR)
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_slash (this);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
else
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_modulo (this);
pp_space (this);
pp_cxx_pm_expression (this, TREE_OPERAND (e, 1));
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
default:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_pm_expression (this, e);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
break;
}
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
/* conditional-expression:
logical-or-expression
logical-or-expression ? expression : assignment-expression */
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
void
cxx_pretty_printer::conditional_expression (tree e)
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
{
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
if (TREE_CODE (e) == COND_EXPR)
{
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_c_logical_or_expression (this, TREE_OPERAND (e, 0));
pp_space (this);
pp_question (this);
pp_space (this);
expression (TREE_OPERAND (e, 1));
pp_space (this);
assignment_expression (TREE_OPERAND (e, 2));
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
}
else
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_c_logical_or_expression (this, e);
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
}
/* Pretty-print a compound assignment operator token as indicated by T. */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void
pp_cxx_assignment_operator (cxx_pretty_printer *pp, tree t)
{
const char *op;
switch (TREE_CODE (t))
{
case NOP_EXPR:
op = "=";
break;
case PLUS_EXPR:
op = "+=";
break;
case MINUS_EXPR:
op = "-=";
break;
case TRUNC_DIV_EXPR:
op = "/=";
break;
case TRUNC_MOD_EXPR:
op = "%=";
break;
default:
tree-core.h (tree_code_name): Remove. gcc/ * tree-core.h (tree_code_name): Remove. * tree.h (get_tree_code_name): New prototype. * tree.c (tree_code_name): Make static. (get_tree_code_name): New function. (dump_tree_statistics, tree_check_failed, tree_not_check_failed, tree_class_check_failed, tree_range_check_failed, tree_not_class_check_failed, omp_clause_check_failed, tree_contains_struct_check_failed, tree_operand_check_failed): Use new wrapper get_tree_code_name instead of calling tree_code_name directly. * tree-vrp.c (dump_asserts_for): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-pretty-print.c (do_niy, dump_generic_node): Likewise. * tree-pretty-print.h (pp_unsupported_tree): Likewise. * lto-streamer-out.c (lto_write_tree, DFS_write_tree): Likewise. * tree-ssa-dom.c (print_expr_hash_elt): Likewise. * gimple-pretty-print.c (dump_unary_rhs, dump_binary_rhs, dump_ternary_rhs, dump_gimple_assign, dump_gimple_cond, dump_gimple_omp_for): Likewise. * tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise. * tree-ssa-pre.c (print_pre_expr): Likewise. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Likewise. * print-tree.c (print_node_brief, print_node): Likewise. * gimple.c (gimple_check_failed): Likewise. * lto-streamer.c (lto_tag_name, print_lto_report): Likewise. * config/frv/frv.c (frv_init_cumulative_args): Likewise. * config/mep/mep.c (mep_validate_vliw): Likewise. * config/iq2000/iq2000.c (init_cumulative_args): Likewise. * config/rs6000/rs6000.c (init_cumulative_args): Likewise. gcc/cp/ * error.c (code_to_string): Use new wrapper get_tree_code_name. * cxx-pretty-print.c (pp_cxx_assignment_operator): Likewise. * pt.c (tsubst): Likewise. * semantics.c (cxx_eval_constant_expression, potential_constant_expression_1): Likewise. * mangle.c (MANGLE_TRACE_TREE, dump_substitution_candidates, add_substitution, find_substitution): Likewise. From-SVN: r203695
2013-10-16 12:09:17 +02:00
op = get_tree_code_name (TREE_CODE (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
}
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, op);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
/* assignment-expression:
conditional-expression
logical-or-expression assignment-operator assignment-expression
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
throw-expression
throw-expression:
throw assignment-expression(opt)
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
assignment-operator: one of
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
= *= /= %= += -= >>= <<= &= ^= |= */
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
void
cxx_pretty_printer::assignment_expression (tree e)
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
{
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
switch (TREE_CODE (e))
pretty-print.c (pp_base_indent): Rename from pp_indent. * pretty-print.c (pp_base_indent): Rename from pp_indent. * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. (struct c_pretty_print_info): Add more fields. (pp_c_left_paren): Move to c-pretty-print.c. (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_declarator): Declare. (pp_c_direct_declarator): Likewise. (pp_c_specifier_qualifier_list): Likewise. (pp_c_type_id): Likewise. * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. (pp_c_type_qualifier_list): New. (pp_c_pointer): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_id_expression): Likewise. (pp_c_simple_type_specifier): Tidy. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. (pp_c_pretty_printer_init): Likewise. (pp_c_specifier_qualifier_list): Rework.. (pp_c_abstract_declarator): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_primary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_direct_abstract_declarator): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_statement): Likewise. (pp_c_integer_constant): Rename from pp_c_integer_literal. (pp_c_character_constant): Rename from pp_c_character_literal. (pp_c_bool_constant): Rename from pp_c_bool_literal. (pp_c_enumeration_constant): Rename from pp_c_enumerator. (pp_c_floating_constant): Rename from pp_c_real_literal. (pp_c_constant): Rename from pp_c_literal. * c-lang.c: Include diagnostic.h and c-pretty-print.h (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (c_initialize_diagnostics): New. * Makefile.in (c-lang.o): Update dependency. cp/ * error.c (dump_expr): Tidy. * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. (pp_cxx_begin_template_argument_list): Likewise. (pp_cxx_end_template_argument_list): Likewise. (is_destructor_name): Likewise. (pp_cxx_unqualified_id): Likewise. (pp_cxx_qualified_id): Likewise. (pp_cxx_id_expression): Likewise. (pp_cxx_new_expression): Likewise. (pp_cxx_delete_expression): Likewise. (pp_cxx_pm_expression): Likewise. (pp_cxx_type_specifier): Rework. (pp_cxx_type_id): Likewise. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_unary_expression): Likewise. (pp_cxx_multiplicative_expression): Likewise. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_expression): Likewise. (pp_cxx_pretty_printer_init): Tidy. From-SVN: r70299
2003-08-10 20:17:06 +02:00
{
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case MODIFY_EXPR:
case INIT_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_c_logical_or_expression (this, TREE_OPERAND (e, 0));
pp_space (this);
pp_equal (this);
pp_space (this);
assignment_expression (TREE_OPERAND (e, 1));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case THROW_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_ws_string (this, "throw");
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (TREE_OPERAND (e, 0))
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
assignment_expression (TREE_OPERAND (e, 0));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case MODOP_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_c_logical_or_expression (this, TREE_OPERAND (e, 0));
pp_cxx_assignment_operator (this, TREE_OPERAND (e, 1));
assignment_expression (TREE_OPERAND (e, 2));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
default:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
conditional_expression (e);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
}
}
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
void
cxx_pretty_printer::expression (tree t)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
switch (TREE_CODE (t))
{
case STRING_CST:
tree.def (VOID_CST): New. gcc/ * tree.def (VOID_CST): New. * tree-core.h (TI_VOID): New. * tree.h (void_node): New. * tree.c (tree_node_structure_for_code, tree_code_size) (iterative_hash_expr): Handle VOID_CST. (build_common_tree_nodes): Initialize void_node. gcc/c-family/ * c-common.h (CTI_VOID_ZERO, void_zero_node): Delete. * c-common.c (c_common_nodes_and_builtins): Don't initialize void_zero_node. * c-pretty-print.c (pp_c_void_constant): New function. (c_pretty_printer::constant, c_pretty_printer::primary_expression) (c_pretty_printer::expression): Handle VOID_CST. * cilk.c (extract_free_variables): Likewise. * c-ubsan.c (ubsan_instrument_division, ubsan_instrument_shift) (ubsan_instrument_vla): Use void_node instead of void_zero_node. gcc/c/ * c-array-notation.c (expand_array_notations): Use void_node instead of void_zero_node. gcc/cp/ * cvt.c (convert_to_void): Use void_node instead of void_zero_node. * cp-array-notation.c (replace_invariant_exprs): Likewise. (expand_array_notation): Handle VOID_CST. * error.c (dump_expr): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Likewise. (pp_cxx_new_expression): Use void_node instead of void_zero_node. * decl.c (register_dtor_fn): Likewise. * init.c (build_raw_new_expr, build_new_1, build_vec_init) (build_delete, push_base_cleanups): Likewise. * mangle.c (write_expression): Likewise. * semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise. * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise. (tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST. * tree.c (cp_tree_equal): Likewise. (build_dummy_object, is_dummy_object, stabilize_expr): Use void_node instead of void_zero_node. * typeck.c (check_return_expr): Likewise. * typeck2.c (build_functional_cast): Likewise. From-SVN: r210692
2014-05-21 13:00:35 +02:00
case VOID_CST:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case INTEGER_CST:
case REAL_CST:
case COMPLEX_CST:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
constant (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
Implement C++11 user-defined literals. libcpp/ * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix, cpp_userdef_string_remove_type, cpp_userdef_string_add_type, cpp_userdef_char_remove_type, cpp_userdef_char_add_type, cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New. (cpp_classify_number): Classify unrecognized tokens as user-defined literals. * include/cpplib.h: Add new tokens for user-defined literals. * init.c: Add new preprocessor flag (cxx11). * lex.c: (lex_string, lex_raw_string): Handle user-defined literals including concatenation and promotion with suffixes. c-family/ * c-common.c (build_userdef_literal): New. * c-common.def: New tree code. * c-common.h (tree_userdef_literal): New tree struct and accessors. * c-lex.c (interpret_float): Add suffix parm. (c_lex_with_flags): Build literal tokens. cp/ * cp-objcp-common.c: (cp_tree_size) Return size of USERDEF_LITERAL tree. * cp-tree.h: (UDLIT_OP_*, UDLIT_OPER_P): Literal operator name tools. New tree code for user-defined literals. * cxx-pretty-print.h: (pp_cxx_userdef_literal) New. * cxx-pretty-print.c: (pp_cxx_userdef_literal) New. (pp_cxx_primary_expression, pp_cxx_expression): Use it. * decl.c: (cp_tree_node_structure): Return new tree code. (duplicate_decls): Check for raw vs. template operator conflicts. (grokfndecl, grokdeclarator): New checks for literal operators. * error.c: (dump_expr): Warn about user-defined literals in C++98 mode. (dump_function_name): Pretty printing. * mangle.c: (write_literal_operator_name): New. (write_unqualified_id, write_unqualified_name): Use it. * parser.c: (cp_parser_operator): Handle operator"". (cp_parser_userdef_char_literal, cp_parser_userdef_numeric_literal, cp_parser_userdef_string_literal): New. (cp_parser_primary_expression): Handle new user-defined literal tokens with new functions. * semantics.c: (potential_constant_expression_1): Add user-defined literals. * typeck.c (check_raw_literal_operator, check_literal_operator_args): New. From-SVN: r180536
2011-10-26 21:30:59 +02:00
case USERDEF_LITERAL:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_userdef_literal (this, t);
Implement C++11 user-defined literals. libcpp/ * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix, cpp_userdef_string_remove_type, cpp_userdef_string_add_type, cpp_userdef_char_remove_type, cpp_userdef_char_add_type, cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New. (cpp_classify_number): Classify unrecognized tokens as user-defined literals. * include/cpplib.h: Add new tokens for user-defined literals. * init.c: Add new preprocessor flag (cxx11). * lex.c: (lex_string, lex_raw_string): Handle user-defined literals including concatenation and promotion with suffixes. c-family/ * c-common.c (build_userdef_literal): New. * c-common.def: New tree code. * c-common.h (tree_userdef_literal): New tree struct and accessors. * c-lex.c (interpret_float): Add suffix parm. (c_lex_with_flags): Build literal tokens. cp/ * cp-objcp-common.c: (cp_tree_size) Return size of USERDEF_LITERAL tree. * cp-tree.h: (UDLIT_OP_*, UDLIT_OPER_P): Literal operator name tools. New tree code for user-defined literals. * cxx-pretty-print.h: (pp_cxx_userdef_literal) New. * cxx-pretty-print.c: (pp_cxx_userdef_literal) New. (pp_cxx_primary_expression, pp_cxx_expression): Use it. * decl.c: (cp_tree_node_structure): Return new tree code. (duplicate_decls): Check for raw vs. template operator conflicts. (grokfndecl, grokdeclarator): New checks for literal operators. * error.c: (dump_expr): Warn about user-defined literals in C++98 mode. (dump_function_name): Pretty printing. * mangle.c: (write_literal_operator_name): New. (write_unqualified_id, write_unqualified_name): Use it. * parser.c: (cp_parser_operator): Handle operator"". (cp_parser_userdef_char_literal, cp_parser_userdef_numeric_literal, cp_parser_userdef_string_literal): New. (cp_parser_primary_expression): Handle new user-defined literal tokens with new functions. * semantics.c: (potential_constant_expression_1): Add user-defined literals. * typeck.c (check_raw_literal_operator, check_literal_operator_args): New. From-SVN: r180536
2011-10-26 21:30:59 +02:00
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case RESULT_DECL:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_unqualified_id (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
#if 0
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case OFFSET_REF:
#endif
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case SCOPE_REF:
case PTRMEM_CST:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_qualified_id (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case OVERLOAD:
t = OVL_CURRENT (t);
re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. From-SVN: r239410
2016-08-12 12:30:47 +02:00
/* FALLTHRU */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case VAR_DECL:
case PARM_DECL:
case FIELD_DECL:
case CONST_DECL:
case FUNCTION_DECL:
case BASELINK:
case TEMPLATE_DECL:
case TEMPLATE_TYPE_PARM:
case TEMPLATE_PARM_INDEX:
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
case TEMPLATE_TEMPLATE_PARM:
case STMT_EXPR:
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
case REQUIRES_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
primary_expression (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case CALL_EXPR:
case DYNAMIC_CAST_EXPR:
case STATIC_CAST_EXPR:
case REINTERPRET_CAST_EXPR:
case CONST_CAST_EXPR:
#if 0
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case MEMBER_REF:
#endif
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case EMPTY_CLASS_EXPR:
case TYPEID_EXPR:
case PSEUDO_DTOR_EXPR:
case AGGR_INIT_EXPR:
case ARROW_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
postfix_expression (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case NEW_EXPR:
case VEC_NEW_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_new_expression (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case DELETE_EXPR:
case VEC_DELETE_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_delete_expression (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
case NOEXCEPT_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
unary_expression (t);
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case CAST_EXPR:
case IMPLICIT_CONV_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_cast_expression (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case OFFSET_REF:
case MEMBER_REF:
case DOTSTAR_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_pm_expression (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case MULT_EXPR:
case TRUNC_DIV_EXPR:
case TRUNC_MOD_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
multiplicative_expression (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case COND_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
conditional_expression (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case MODIFY_EXPR:
case INIT_EXPR:
case THROW_EXPR:
case MODOP_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
assignment_expression (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case NON_DEPENDENT_EXPR:
case MUST_NOT_THROW_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
expression (TREE_OPERAND (t, 0));
break;
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
case EXPR_PACK_EXPANSION:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
expression (PACK_EXPANSION_PATTERN (t));
pp_cxx_ws_string (this, "...");
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
break;
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
case UNARY_LEFT_FOLD_EXPR:
pp_cxx_unary_left_fold_expression (this, t);
break;
case UNARY_RIGHT_FOLD_EXPR:
pp_cxx_unary_right_fold_expression (this, t);
break;
case BINARY_LEFT_FOLD_EXPR:
case BINARY_RIGHT_FOLD_EXPR:
pp_cxx_binary_fold_expression (this, t);
break;
case TEMPLATE_ID_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_template_id (this, t);
break;
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
case NONTYPE_ARGUMENT_PACK:
{
tree args = ARGUMENT_PACK_ARGS (t);
int i, len = TREE_VEC_LENGTH (args);
for (i = 0; i < len; ++i)
{
if (i > 0)
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_separate_with (this, ',');
expression (TREE_VEC_ELT (args, i));
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
}
}
break;
case LAMBDA_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_ws_string (this, "<lambda>");
break;
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
case TRAIT_EXPR:
pp_cxx_trait_expression (this, t);
break;
case PRED_CONSTR:
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
case CHECK_CONSTR:
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
case EXPR_CONSTR:
case TYPE_CONSTR:
case ICONV_CONSTR:
case DEDUCT_CONSTR:
case EXCEPT_CONSTR:
case PARM_CONSTR:
case CONJ_CONSTR:
case DISJ_CONSTR:
pp_cxx_constraint (this, t);
break;
case PAREN_EXPR:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
pp_cxx_left_paren (this);
expression (TREE_OPERAND (t, 0));
pp_cxx_right_paren (this);
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
default:
c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::unary_expression): Now a virtual member function. (c_pretty_printer::multiplicative_expression): Likewise. (c_pretty_printer::conditional_expression): Likewise. (c_pretty_printer::assignment_expression): Likewise. (c_pretty_printer::expression): Likewise. (pp_unary_expression): Adjust. (pp_multiplicative_expression): Likewise. (pp_assignment_expression): Likewise. (pp_conditional_expression): Likewise. (pp_expression): Likewise. * c-pretty-print.c (c_pretty_printer::unary_expression): Rename from pp_c_unary_expression. Adjust. (c_pretty_printer::multiplicative_expression): Rename from pp_c_multiplicative_expression. Adjust. (c_pretty_printer::conditional_expression): Rename from pp_c_conditional_expression. Adjust. (c_pretty_printer::assignment_expression): Rename from pp_c_assignment_expression. Adjust. (c_pretty_printer::expression): Rename from pp_c_expression. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to unary_expression, multiplicative_expression, conditional_expression, expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::unary_expression): Declare as overrider. (cxx_pretty_printer::multiplicative_expression): Likewise. (cxx_pretty_printer::conditional_expression): Likewise. (cxx_pretty_printer::assignment_expression): Likewise. (cxx_pretty_printer::expression): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::unary_expression): Rename from pp_cxx_unary_expression. Adjust. (cxx_pretty_printer::multiplicative_expression): Rename from pp_cxx_multiplicative_expression. Adjust. (cxx_pretty_printer::conditional_expression): Rename from pp_cxx_conditional_expression. Adjust. (cxx_pretty_printer::assignment_expression): Rename from pp_cxx_assignment_expression. Adjust. (cxx_pretty_printer::expression): Rename from pp_cxx_expression. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to unary_expression, multiplicative_expression, conditional_expression, assignment_expression, expression. From-SVN: r201987
2013-08-26 10:37:24 +02:00
c_pretty_printer::expression (t);
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
}
/* Declarations. */
/* function-specifier:
inline
virtual
explicit */
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
void
cxx_pretty_printer::function_specifier (tree t)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
switch (TREE_CODE (t))
{
case FUNCTION_DECL:
if (DECL_VIRTUAL_P (t))
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_ws_string (this, "virtual");
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else if (DECL_CONSTRUCTOR_P (t) && DECL_NONCONVERTING_P (t))
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_ws_string (this, "explicit");
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
c_pretty_printer::function_specifier (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
default:
break;
}
}
/* decl-specifier-seq:
decl-specifier-seq(opt) decl-specifier
decl-specifier:
storage-class-specifier
type-specifier
function-specifier
friend
typedef */
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
void
cxx_pretty_printer::declaration_specifiers (tree t)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
switch (TREE_CODE (t))
{
case VAR_DECL:
case PARM_DECL:
case CONST_DECL:
case FIELD_DECL:
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
storage_class_specifier (t);
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
declaration_specifiers (TREE_TYPE (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case TYPE_DECL:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_ws_string (this, "typedef");
declaration_specifiers (TREE_TYPE (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case FUNCTION_DECL:
/* Constructors don't have return types. And conversion functions
do not have a type-specifier in their return types. */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (DECL_CONSTRUCTOR_P (t) || DECL_CONV_FN_P (t))
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
function_specifier (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
declaration_specifiers (TREE_TYPE (TREE_TYPE (t)));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else
re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. From-SVN: r239410
2016-08-12 12:30:47 +02:00
c_pretty_printer::declaration_specifiers (t);
break;
default:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
c_pretty_printer::declaration_specifiers (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
}
}
/* simple-type-specifier:
::(opt) nested-name-specifier(opt) type-name
::(opt) nested-name-specifier(opt) template(opt) template-id
char
wchar_t
bool
short
int
long
signed
unsigned
float
double
void */
void
cxx_pretty_printer::simple_type_specifier (tree t)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
switch (TREE_CODE (t))
{
case RECORD_TYPE:
case UNION_TYPE:
case ENUMERAL_TYPE:
pp_cxx_qualified_id (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case TEMPLATE_TYPE_PARM:
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
case TEMPLATE_TEMPLATE_PARM:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case TEMPLATE_PARM_INDEX:
case BOUND_TEMPLATE_TEMPLATE_PARM:
pp_cxx_unqualified_id (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case TYPENAME_TYPE:
pp_cxx_ws_string (this, "typename");
pp_cxx_nested_name_specifier (this, TYPE_CONTEXT (t));
pp_cxx_unqualified_id (this, TYPE_NAME (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
default:
c_pretty_printer::simple_type_specifier (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
}
}
/* type-specifier-seq:
type-specifier type-specifier-seq(opt)
type-specifier:
simple-type-specifier
class-specifier
enum-specifier
elaborated-type-specifier
cv-qualifier */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void
pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t)
{
switch (TREE_CODE (t))
{
case TEMPLATE_DECL:
case TEMPLATE_TYPE_PARM:
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
case TEMPLATE_TEMPLATE_PARM:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case TYPE_DECL:
case BOUND_TEMPLATE_TEMPLATE_PARM:
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
pp_cxx_cv_qualifier_seq (pp, t);
pp->simple_type_specifier (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case METHOD_TYPE:
pp_cxx_type_specifier_seq (pp, TREE_TYPE (t));
pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (t));
pp_cxx_nested_name_specifier (pp, TYPE_METHOD_BASETYPE (t));
break;
typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. * cp-tree.def (DECLTYPE_TYPE): New. * error.c (dump_type): Dump DECLTYPE_TYPE nodes. (dump_type_prefix): Ditto. (dump_type_suffix): Ditto. * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes. * mangle.c (write_type): Handle DECLTYPE_TYPE. * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate types. (DECLTYPE_TYPE_EXPR): New. (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New. (finish_declared_type): Declare. * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print DECLTYPE_TYPE nodes. (pp_cxx_type_id): Ditto. * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children. (tsubst): Substitute into a DECLTYPE_TYPE node. (tsubst_copy): Ditto. (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE nodes. (dependent_type_p_r): DECLTYPE_TYPE types are always dependent. * semantics.c (finish_typeof): TYPEOF_TYPE types need to use structural equality (because we can't hash the expressions). (finish_declared_type): New. * lex.c (reswords): Add "decltype" keyword. * parser.c cp_lexer_next_token_is_decl_specifier_keyword (cp_parser_postfix_expression): Add member_access_only_p to restrict postfix expression to member access expressions. (cp_parser_unary_expression): Update call to cp_parser_postfix_expression to reflect new parameter. (cp_parser_declared_type): New. (cp_parser_simple_type_specifier): Parse decltype types. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * c-common.h (enum rid): Add RID_DECLTYPE, update RID_LAST_CXX0X. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * g++.dg/cpp0x/decltype1.C: New. * g++.dg/cpp0x/decltype2.C: New. * g++.dg/cpp0x/decltype3.C: New. * g++.dg/cpp0x/decltype4.C: New. * g++.dg/cpp0x/decltype5.C: New. * g++.dg/cpp0x/decltype6.C: New. From-SVN: r126991
2007-07-27 19:43:05 +02:00
case DECLTYPE_TYPE:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "decltype");
typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. * cp-tree.def (DECLTYPE_TYPE): New. * error.c (dump_type): Dump DECLTYPE_TYPE nodes. (dump_type_prefix): Ditto. (dump_type_suffix): Ditto. * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes. * mangle.c (write_type): Handle DECLTYPE_TYPE. * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate types. (DECLTYPE_TYPE_EXPR): New. (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New. (finish_declared_type): Declare. * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print DECLTYPE_TYPE nodes. (pp_cxx_type_id): Ditto. * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children. (tsubst): Substitute into a DECLTYPE_TYPE node. (tsubst_copy): Ditto. (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE nodes. (dependent_type_p_r): DECLTYPE_TYPE types are always dependent. * semantics.c (finish_typeof): TYPEOF_TYPE types need to use structural equality (because we can't hash the expressions). (finish_declared_type): New. * lex.c (reswords): Add "decltype" keyword. * parser.c cp_lexer_next_token_is_decl_specifier_keyword (cp_parser_postfix_expression): Add member_access_only_p to restrict postfix expression to member access expressions. (cp_parser_unary_expression): Update call to cp_parser_postfix_expression to reflect new parameter. (cp_parser_declared_type): New. (cp_parser_simple_type_specifier): Parse decltype types. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * c-common.h (enum rid): Add RID_DECLTYPE, update RID_LAST_CXX0X. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * g++.dg/cpp0x/decltype1.C: New. * g++.dg/cpp0x/decltype2.C: New. * g++.dg/cpp0x/decltype3.C: New. * g++.dg/cpp0x/decltype4.C: New. * g++.dg/cpp0x/decltype5.C: New. * g++.dg/cpp0x/decltype6.C: New. From-SVN: r126991
2007-07-27 19:43:05 +02:00
pp_cxx_left_paren (pp);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->expression (DECLTYPE_TYPE_EXPR (t));
typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. * cp-tree.def (DECLTYPE_TYPE): New. * error.c (dump_type): Dump DECLTYPE_TYPE nodes. (dump_type_prefix): Ditto. (dump_type_suffix): Ditto. * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes. * mangle.c (write_type): Handle DECLTYPE_TYPE. * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate types. (DECLTYPE_TYPE_EXPR): New. (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New. (finish_declared_type): Declare. * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print DECLTYPE_TYPE nodes. (pp_cxx_type_id): Ditto. * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children. (tsubst): Substitute into a DECLTYPE_TYPE node. (tsubst_copy): Ditto. (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE nodes. (dependent_type_p_r): DECLTYPE_TYPE types are always dependent. * semantics.c (finish_typeof): TYPEOF_TYPE types need to use structural equality (because we can't hash the expressions). (finish_declared_type): New. * lex.c (reswords): Add "decltype" keyword. * parser.c cp_lexer_next_token_is_decl_specifier_keyword (cp_parser_postfix_expression): Add member_access_only_p to restrict postfix expression to member access expressions. (cp_parser_unary_expression): Update call to cp_parser_postfix_expression to reflect new parameter. (cp_parser_declared_type): New. (cp_parser_simple_type_specifier): Parse decltype types. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * c-common.h (enum rid): Add RID_DECLTYPE, update RID_LAST_CXX0X. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * g++.dg/cpp0x/decltype1.C: New. * g++.dg/cpp0x/decltype2.C: New. * g++.dg/cpp0x/decltype3.C: New. * g++.dg/cpp0x/decltype4.C: New. * g++.dg/cpp0x/decltype5.C: New. * g++.dg/cpp0x/decltype6.C: New. From-SVN: r126991
2007-07-27 19:43:05 +02:00
pp_cxx_right_paren (pp);
break;
case RECORD_TYPE:
if (TYPE_PTRMEMFUNC_P (t))
{
tree pfm = TYPE_PTRMEMFUNC_FN_TYPE (t);
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp->declaration_specifiers (TREE_TYPE (TREE_TYPE (pfm)));
pp_cxx_whitespace (pp);
pp_cxx_ptr_operator (pp, t);
break;
}
re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. From-SVN: r239410
2016-08-12 12:30:47 +02:00
/* fall through */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
default:
if (!(TREE_CODE (t) == FUNCTION_DECL && DECL_CONSTRUCTOR_P (t)))
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
2013-08-05 06:00:57 +02:00
pp_c_specifier_qualifier_list (pp, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
}
/* ptr-operator:
* cv-qualifier-seq(opt)
&
::(opt) nested-name-specifier * cv-qualifier-seq(opt) */
static void
pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t)
{
if (!TYPE_P (t) && TREE_CODE (t) != TYPE_DECL)
t = TREE_TYPE (t);
switch (TREE_CODE (t))
{
case REFERENCE_TYPE:
case POINTER_TYPE:
if (TYPE_PTR_OR_PTRMEM_P (TREE_TYPE (t)))
pp_cxx_ptr_operator (pp, TREE_TYPE (t));
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
2013-08-05 06:00:57 +02:00
pp_c_attributes_display (pp, TYPE_ATTRIBUTES (TREE_TYPE (t)));
call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P. 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com> * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P. (build_op_call_1): Likewise. (build_over_call): Likewise. (compare_ics): Likewise. * class.c (build_base_path): Likewise. (resolve_address_of_overloaded_function): Likewise. * cp-tree.h: Likewise. * cvt.c (cp_convert_to_pointer): Likewise. (convert_to_reference): Likewise. (ocp_convert): Likewise. (convert_force): Likewise, tidy. * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise. (pp_cxx_ptr_operator): Likewise. * decl.c (duplicate_decls): Likewise. (start_decl): Likewise. (grok_op_properties): Likewise. (start_preparsed_function): Likewise. (store_parm_decls): Likewise. (finish_function): Likewise. * decl2.c (delete_sanity): Likewise. (acceptable_java_type): Likewise. (grokbitfield): Likewise. (cp_reconstruct_complex_type): Likewise. * error.c (dump_type_prefix): Likewise. (dump_expr): Likewise. * except.c (push_eh_cleanup): Likewise. (complete_ptr_ref_or_void_ptr_p): Likewise. (can_convert_eh): Likewise. * init.c (build_new_1): Likewise. (build_delete): Likewise. (build_vec_delete): Likewise. * mangle.c (write_type): Likewise. * parser.c (lookup_literal_operator): Likewise. * pt.c (convert_nontype_argument_function): Likewise. (convert_nontype_argument): Likewise. (tsubst): Likewise. (unify): Likewise. (dependent_type_p_r): Likewise. * rtti.c (build_headof): Likewise. (build_typeid): Likewise. (build_dynamic_cast_1): Likewise. (target_incomplete_p): Likewise. (typeinfo_in_lib_p): Likewise. * semantics.c (finish_omp_for): Likewise. (cxx_eval_call_expression): Likewise. (maybe_resolve_dummy): Likewise. * tree.c (build_target_expr): Likewise. (cp_build_qualified_type_real): Likewise. * typeck.c (composite_pointer_type_r): Likewise. (composite_pointer_type): Likewise. (comp_except_types): Likewise. (cxx_sizeof_nowarn): Likewise. (string_conv_p): Likewise. (cp_build_array_ref): Likewise. (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P. (pointer_diff): Likewise. (cp_build_addr_expr_1): Likewise. (cp_build_unary_op): Likewise. (build_static_cast_1): Likewise. (cp_build_c_cast): Likewise. (comp_ptr_ttypes_real): Likewise. (ptr_reasonably_similar): Likewise. (comp_ptr_ttypes_const): Likewise. (casts_away_constness): Likewise. (check_literal_operator_args): Likewise. * typeck2.c (build_x_arrow): Likewise. (add_exception_specifier): Likewise. From-SVN: r197249
2013-03-29 21:29:26 +01:00
if (TYPE_PTR_P (t))
{
pp_star (pp);
pp_cxx_cv_qualifier_seq (pp, t);
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else
pp_ampersand (pp);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case RECORD_TYPE:
if (TYPE_PTRMEMFUNC_P (t))
{
pp_cxx_left_paren (pp);
pp_cxx_nested_name_specifier (pp, TYPE_PTRMEMFUNC_OBJECT_TYPE (t));
pp_star (pp);
break;
}
re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. From-SVN: r239410
2016-08-12 12:30:47 +02:00
/* FALLTHRU */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case OFFSET_TYPE:
if (TYPE_PTRMEM_P (t))
{
if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
pp_cxx_left_paren (pp);
pp_cxx_nested_name_specifier (pp, TYPE_PTRMEM_CLASS_TYPE (t));
pp_star (pp);
pp_cxx_cv_qualifier_seq (pp, t);
break;
}
re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. From-SVN: r239410
2016-08-12 12:30:47 +02:00
/* fall through. */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
default:
pp_unsupported_tree (pp, t);
break;
}
}
static inline tree
pp_cxx_implicit_parameter_type (tree mf)
{
return class_of_this_parm (TREE_TYPE (mf));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
/*
parameter-declaration:
decl-specifier-seq declarator
decl-specifier-seq declarator = assignment-expression
decl-specifier-seq abstract-declarator(opt)
decl-specifier-seq abstract-declarator(opt) assignment-expression */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static inline void
pp_cxx_parameter_declaration (cxx_pretty_printer *pp, tree t)
{
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp->declaration_specifiers (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (TYPE_P (t))
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->abstract_declarator (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->declarator (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
/* parameter-declaration-clause:
parameter-declaration-list(opt) ...(opt)
parameter-declaration-list , ...
parameter-declaration-list:
parameter-declaration
parameter-declaration-list , parameter-declaration */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void
pp_cxx_parameter_declaration_clause (cxx_pretty_printer *pp, tree t)
{
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
tree args;
tree types;
bool abstract;
// For a requires clause or the explicit printing of a parameter list
// we expect T to be a chain of PARM_DECLs. Otherwise, the list of
// args and types are taken from the function decl T.
if (TREE_CODE (t) == PARM_DECL)
{
args = t;
types = t;
abstract = false;
}
else
{
bool type_p = TYPE_P (t);
args = type_p ? NULL : FUNCTION_FIRST_USER_PARM (t);
types = type_p ? TYPE_ARG_TYPES (t) : FUNCTION_FIRST_USER_PARMTYPE (t);
abstract = args == NULL || pp->flags & pp_c_flag_abstract;
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
bool first = true;
/* Skip artificial parameter for nonstatic member functions. */
if (TREE_CODE (t) == METHOD_TYPE)
types = TREE_CHAIN (types);
pp_cxx_left_paren (pp);
for (; args; args = TREE_CHAIN (args), types = TREE_CHAIN (types))
{
if (!first)
pp_cxx_separate_with (pp, ',');
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
first = false;
pp_cxx_parameter_declaration (pp, abstract ? TREE_VALUE (types) : args);
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
2013-08-05 06:00:57 +02:00
if (!abstract && pp->flags & pp_cxx_flag_default_argument)
{
pp_cxx_whitespace (pp);
pp_equal (pp);
pp_cxx_whitespace (pp);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->assignment_expression (TREE_PURPOSE (types));
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
pp_cxx_right_paren (pp);
}
/* exception-specification:
throw ( type-id-list(opt) )
type-id-list
type-id
type-id-list , type-id */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void
pp_cxx_exception_specification (cxx_pretty_printer *pp, tree t)
{
tree ex_spec = TYPE_RAISES_EXCEPTIONS (t);
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
bool need_comma = false;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (ex_spec == NULL)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
return;
if (TREE_PURPOSE (ex_spec))
{
pp_cxx_ws_string (pp, "noexcept");
pp_cxx_whitespace (pp);
pp_cxx_left_paren (pp);
if (DEFERRED_NOEXCEPT_SPEC_P (ex_spec))
pp_cxx_ws_string (pp, "<uninstantiated>");
else
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->expression (TREE_PURPOSE (ex_spec));
pp_cxx_right_paren (pp);
return;
}
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "throw");
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_left_paren (pp);
for (; ex_spec && TREE_VALUE (ex_spec); ex_spec = TREE_CHAIN (ex_spec))
{
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
tree type = TREE_VALUE (ex_spec);
tree argpack = NULL_TREE;
int i, len = 1;
if (ARGUMENT_PACK_P (type))
{
argpack = ARGUMENT_PACK_ARGS (type);
len = TREE_VEC_LENGTH (argpack);
}
for (i = 0; i < len; ++i)
{
if (argpack)
type = TREE_VEC_ELT (argpack, i);
if (need_comma)
pp_cxx_separate_with (pp, ',');
else
need_comma = true;
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->type_id (type);
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
pp_cxx_right_paren (pp);
}
/* direct-declarator:
declarator-id
direct-declarator ( parameter-declaration-clause ) cv-qualifier-seq(opt)
exception-specification(opt)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
direct-declaration [ constant-expression(opt) ]
( declarator ) */
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
void
cxx_pretty_printer::direct_declarator (tree t)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
switch (TREE_CODE (t))
{
case VAR_DECL:
case PARM_DECL:
case CONST_DECL:
case FIELD_DECL:
if (DECL_NAME (t))
{
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_space_for_pointer_operator (this, TREE_TYPE (t));
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
if ((TREE_CODE (t) == PARM_DECL && DECL_PACK_P (t))
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
|| template_parameter_pack_p (t))
/* A function parameter pack or non-type template
parameter pack. */
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_ws_string (this, "...");
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
id_expression (DECL_NAME (t));
}
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
abstract_declarator (TREE_TYPE (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case FUNCTION_DECL:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_space_for_pointer_operator (this, TREE_TYPE (TREE_TYPE (t)));
expression (t);
pp_cxx_parameter_declaration_clause (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
{
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
padding = pp_before;
pp_cxx_cv_qualifier_seq (this, pp_cxx_implicit_parameter_type (t));
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_exception_specification (this, TREE_TYPE (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case TYPENAME_TYPE:
case TEMPLATE_DECL:
case TEMPLATE_TYPE_PARM:
case TEMPLATE_PARM_INDEX:
c-pretty-print.c (pp_c_left_bracket): Make a function. * c-pretty-print.c (pp_c_left_bracket): Make a function. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Define. * c-pretty-print.h (pp_c_left_bracket): Declare. (pp_c_right_bracket): Likewise. (pp_c_star): Likewise. (pp_c_ampersand): Likewise. cp/ * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. (pp_cxx_begin_template_argument_list): Turn into a function. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_separate_with): Define. (pp_cxx_unqualified_id): Tidy. (pp_cxx_primary_expression): Likewise. (pp_cxx_postfix_expression): Likewise. (pp_cxx_expression): Likewise. (pp_cxx_simple_type_specifier): Likewise. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_parameter_declaration_clause): Likewise. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Likewise. (pp_cxx_type_id): Likewise. * cxx-pretty-print.h (pp_cxx_whitespace): Export from cxx-pretty-print.c. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_left_brace): Likewise. (pp_cxx_right_brace): Likewise. (pp_cxx_left_bracket): Likewise. (pp_cxx_right_bracket): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_tree_identifier): Likewise. (pp_cxx_ampersand): New macro. (pp_cxx_star): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_complement): Likewise. (pp_cxx_begin_template_argument_list): Declaree. (pp_cxx_end_template_argument_list): Likewise. (pp_cxx_colon_colon): likewise. From-SVN: r82488
2004-05-31 17:25:51 +02:00
case TEMPLATE_TEMPLATE_PARM:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
default:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
c_pretty_printer::direct_declarator (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
}
}
/* declarator:
direct-declarator
ptr-operator declarator */
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
void
cxx_pretty_printer::declarator (tree t)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
direct_declarator (t);
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
// Print a requires clause.
if (flag_concepts)
if (tree ci = get_constraints (t))
if (tree reqs = CI_DECLARATOR_REQS (ci))
pp_cxx_requires_clause (this, reqs);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
/* ctor-initializer:
: mem-initializer-list
mem-initializer-list:
mem-initializer
mem-initializer , mem-initializer-list
mem-initializer:
mem-initializer-id ( expression-list(opt) )
mem-initializer-id:
::(opt) nested-name-specifier(opt) class-name
identifier */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void
pp_cxx_ctor_initializer (cxx_pretty_printer *pp, tree t)
{
t = TREE_OPERAND (t, 0);
pp_cxx_whitespace (pp);
pp_colon (pp);
pp_cxx_whitespace (pp);
for (; t; t = TREE_CHAIN (t))
{
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
tree purpose = TREE_PURPOSE (t);
bool is_pack = PACK_EXPANSION_P (purpose);
if (is_pack)
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->primary_expression (PACK_EXPANSION_PATTERN (purpose));
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
else
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->primary_expression (purpose);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_call_argument_list (pp, TREE_VALUE (t));
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
if (is_pack)
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "...");
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (TREE_CHAIN (t))
pp_cxx_separate_with (pp, ',');
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
}
/* function-definition:
decl-specifier-seq(opt) declarator ctor-initializer(opt) function-body
decl-specifier-seq(opt) declarator function-try-block */
static void
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_function_definition (cxx_pretty_printer *pp, tree t)
{
tree saved_scope = pp->enclosing_scope;
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp->declaration_specifiers (t);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->declarator (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_needs_newline (pp) = true;
pp->enclosing_scope = DECL_CONTEXT (t);
if (DECL_SAVED_TREE (t))
pp->statement (DECL_SAVED_TREE (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else
pp_cxx_semicolon (pp);
pp_newline_and_flush (pp);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp->enclosing_scope = saved_scope;
}
/* abstract-declarator:
ptr-operator abstract-declarator(opt)
direct-abstract-declarator */
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
void
cxx_pretty_printer::abstract_declarator (tree t)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
if (TYPE_PTRMEM_P (t))
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_right_paren (this);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else if (POINTER_TYPE_P (t))
{
if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE
|| TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE)
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_right_paren (this);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
t = TREE_TYPE (t);
}
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
direct_abstract_declarator (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
/* direct-abstract-declarator:
direct-abstract-declarator(opt) ( parameter-declaration-clause )
cv-qualifier-seq(opt) exception-specification(opt)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
direct-abstract-declarator(opt) [ constant-expression(opt) ]
( abstract-declarator ) */
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
void
cxx_pretty_printer::direct_abstract_declarator (tree t)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
switch (TREE_CODE (t))
{
case REFERENCE_TYPE:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
abstract_declarator (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case RECORD_TYPE:
if (TYPE_PTRMEMFUNC_P (t))
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
direct_abstract_declarator (TYPE_PTRMEMFUNC_FN_TYPE (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case METHOD_TYPE:
case FUNCTION_TYPE:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_parameter_declaration_clause (this, t);
direct_abstract_declarator (TREE_TYPE (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (TREE_CODE (t) == METHOD_TYPE)
{
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
padding = pp_before;
pp_cxx_cv_qualifier_seq (this, class_of_this_parm (t));
}
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_exception_specification (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case TYPENAME_TYPE:
case TEMPLATE_TYPE_PARM:
case TEMPLATE_TEMPLATE_PARM:
case BOUND_TEMPLATE_TEMPLATE_PARM:
case UNBOUND_CLASS_TEMPLATE:
break;
default:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
c_pretty_printer::direct_abstract_declarator (t);
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
}
/* type-id:
type-specifier-seq abstract-declarator(opt) */
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
void
cxx_pretty_printer::type_id (tree t)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp_flags saved_flags = flags;
flags |= pp_c_flag_abstract;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
switch (TREE_CODE (t))
{
case TYPE_DECL:
case UNION_TYPE:
case RECORD_TYPE:
case ENUMERAL_TYPE:
case TYPENAME_TYPE:
case BOUND_TEMPLATE_TEMPLATE_PARM:
case UNBOUND_CLASS_TEMPLATE:
case TEMPLATE_TEMPLATE_PARM:
case TEMPLATE_TYPE_PARM:
case TEMPLATE_PARM_INDEX:
case TEMPLATE_DECL:
case TYPEOF_TYPE:
c-common.c (struct c_common_resword): Add __underlying_type. /gcc 2011-04-25 Paolo Carlini <paolo.carlini@oracle.com> * c-family/c-common.c (struct c_common_resword): Add __underlying_type. * c-family/c-common.h (enum rid): Add RID_UNDERLYING_TYPE. /cp 2011-04-25 Paolo Carlini <paolo.carlini@oracle.com> * cp-tree.def: Add a new UNDERLYING_TYPE tree code. * cp-tree.h (enum cp_trait_kind): Add CPTK_UNDERLYING_TYPE, tidy. (UNDERLYING_TYPE_TYPE): Add. * cp-objcp-common.c (cp_common_init_ts): Mark UNDERLYING_TYPE as TS_COMMON. * parser.c (cp_lexer_next_token_is_decl_specifier_keyword, cp_parser_simple_type_specifier): Handle UNDERLYING_TYPE. (cp_parser_trait_expr): Deal with RID_UNDERLYING_TYPE; tidy. * semantics.c (finish_underlying_type): New. * typeck.c (structural_comptypes): Handle UNDERLYING_TYPE. * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise. * cxx-pretty-print.c (p_cxx_type_id): Likewise. * tree.c (cp_walk_subtrees): Likewise. * pt.c (for_each_template_parm_r, tsubst, unify, dependent_type_p_r): Likewise. * mangle.c (write_type): Sorry for __underlying_type. * doc/extend.texi: Document __underlying_type. /testsuite 2011-04-25 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/ext/underlying_type1.C: New. * g++.dg/ext/underlying_type2.C: Likewise. * g++.dg/ext/underlying_type3.C: Likewise. * g++.dg/ext/underlying_type4.C: Likewise. * g++.dg/ext/underlying_type5.C: Likewise. * g++.dg/ext/underlying_type6.C: Likewise. * g++.dg/ext/underlying_type7.C: Likewise. * g++.dg/ext/underlying_type8.C: Likewise. * g++.dg/ext/underlying_type9.C: Likewise. * g++.dg/ext/underlying_type10.C: Likewise. From-SVN: r172943
2011-04-26 00:27:19 +02:00
case UNDERLYING_TYPE:
typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. * cp-tree.def (DECLTYPE_TYPE): New. * error.c (dump_type): Dump DECLTYPE_TYPE nodes. (dump_type_prefix): Ditto. (dump_type_suffix): Ditto. * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes. * mangle.c (write_type): Handle DECLTYPE_TYPE. * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate types. (DECLTYPE_TYPE_EXPR): New. (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New. (finish_declared_type): Declare. * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print DECLTYPE_TYPE nodes. (pp_cxx_type_id): Ditto. * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children. (tsubst): Substitute into a DECLTYPE_TYPE node. (tsubst_copy): Ditto. (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE nodes. (dependent_type_p_r): DECLTYPE_TYPE types are always dependent. * semantics.c (finish_typeof): TYPEOF_TYPE types need to use structural equality (because we can't hash the expressions). (finish_declared_type): New. * lex.c (reswords): Add "decltype" keyword. * parser.c cp_lexer_next_token_is_decl_specifier_keyword (cp_parser_postfix_expression): Add member_access_only_p to restrict postfix expression to member access expressions. (cp_parser_unary_expression): Update call to cp_parser_postfix_expression to reflect new parameter. (cp_parser_declared_type): New. (cp_parser_simple_type_specifier): Parse decltype types. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * c-common.h (enum rid): Add RID_DECLTYPE, update RID_LAST_CXX0X. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * g++.dg/cpp0x/decltype1.C: New. * g++.dg/cpp0x/decltype2.C: New. * g++.dg/cpp0x/decltype3.C: New. * g++.dg/cpp0x/decltype4.C: New. * g++.dg/cpp0x/decltype5.C: New. * g++.dg/cpp0x/decltype6.C: New. From-SVN: r126991
2007-07-27 19:43:05 +02:00
case DECLTYPE_TYPE:
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case TEMPLATE_ID_EXPR:
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp_cxx_type_specifier_seq (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
case TYPE_PACK_EXPANSION:
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
type_id (PACK_EXPANSION_PATTERN (t));
pp_cxx_ws_string (this, "...");
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
default:
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
c_pretty_printer::type_id (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
}
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
flags = saved_flags;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
/* template-argument-list:
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
template-argument ...(opt)
template-argument-list, template-argument ...(opt)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
template-argument:
assignment-expression
type-id
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
template-name */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void
pp_cxx_template_argument_list (cxx_pretty_printer *pp, tree t)
{
int i;
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
bool need_comma = false;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (t == NULL)
return;
for (i = 0; i < TREE_VEC_LENGTH (t); ++i)
{
tree arg = TREE_VEC_ELT (t, i);
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
tree argpack = NULL_TREE;
int idx, len = 1;
if (ARGUMENT_PACK_P (arg))
{
argpack = ARGUMENT_PACK_ARGS (arg);
len = TREE_VEC_LENGTH (argpack);
}
for (idx = 0; idx < len; idx++)
{
if (argpack)
arg = TREE_VEC_ELT (argpack, idx);
if (need_comma)
pp_cxx_separate_with (pp, ',');
else
need_comma = true;
if (TYPE_P (arg) || (TREE_CODE (arg) == TEMPLATE_DECL
&& TYPE_P (DECL_TEMPLATE_RESULT (arg))))
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->type_id (arg);
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
else
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->expression (arg);
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
}
static void
pp_cxx_exception_declaration (cxx_pretty_printer *pp, tree t)
{
t = DECL_EXPR_DECL (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_type_specifier_seq (pp, t);
if (TYPE_P (t))
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->abstract_declarator (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->declarator (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
/* Statements. */
void
cxx_pretty_printer::statement (tree t)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
switch (TREE_CODE (t))
{
case CTOR_INITIALIZER:
pp_cxx_ctor_initializer (this, t);
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case USING_STMT:
pp_cxx_ws_string (this, "using");
pp_cxx_ws_string (this, "namespace");
if (DECL_CONTEXT (t))
pp_cxx_nested_name_specifier (this, DECL_CONTEXT (t));
pp_cxx_qualified_id (this, USING_STMT_NAMESPACE (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case USING_DECL:
pp_cxx_ws_string (this, "using");
pp_cxx_nested_name_specifier (this, USING_DECL_SCOPE (t));
pp_cxx_unqualified_id (this, DECL_NAME (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case EH_SPEC_BLOCK:
break;
/* try-block:
try compound-statement handler-seq */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case TRY_BLOCK:
pp_maybe_newline_and_indent (this, 0);
pp_cxx_ws_string (this, "try");
pp_newline_and_indent (this, 3);
statement (TRY_STMTS (t));
pp_newline_and_indent (this, -3);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (CLEANUP_P (t))
;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else
statement (TRY_HANDLERS (t));
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
/*
handler-seq:
handler handler-seq(opt)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
handler:
catch ( exception-declaration ) compound-statement
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
exception-declaration:
type-specifier-seq declarator
type-specifier-seq abstract-declarator
... */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case HANDLER:
pp_cxx_ws_string (this, "catch");
pp_cxx_left_paren (this);
pp_cxx_exception_declaration (this, HANDLER_PARMS (t));
pp_cxx_right_paren (this);
pp_indentation (this) += 3;
pp_needs_newline (this) = true;
statement (HANDLER_BODY (t));
pp_indentation (this) -= 3;
pp_needs_newline (this) = true;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
/* selection-statement:
if ( expression ) statement
if ( expression ) statement else statement */
case IF_STMT:
pp_cxx_ws_string (this, "if");
pp_cxx_whitespace (this);
pp_cxx_left_paren (this);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
expression (IF_COND (t));
pp_cxx_right_paren (this);
pp_newline_and_indent (this, 2);
statement (THEN_CLAUSE (t));
pp_newline_and_indent (this, -2);
if (ELSE_CLAUSE (t))
{
tree else_clause = ELSE_CLAUSE (t);
pp_cxx_ws_string (this, "else");
if (TREE_CODE (else_clause) == IF_STMT)
pp_cxx_whitespace (this);
else
pp_newline_and_indent (this, 2);
statement (else_clause);
if (TREE_CODE (else_clause) != IF_STMT)
pp_newline_and_indent (this, -2);
}
break;
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
case SWITCH_STMT:
pp_cxx_ws_string (this, "switch");
pp_space (this);
pp_cxx_left_paren (this);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
expression (SWITCH_STMT_COND (t));
pp_cxx_right_paren (this);
pp_indentation (this) += 3;
pp_needs_newline (this) = true;
statement (SWITCH_STMT_BODY (t));
pp_newline_and_indent (this, -3);
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
break;
/* iteration-statement:
while ( expression ) statement
do statement while ( expression ) ;
for ( expression(opt) ; expression(opt) ; expression(opt) ) statement
for ( declaration expression(opt) ; expression(opt) ) statement */
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
case WHILE_STMT:
pp_cxx_ws_string (this, "while");
pp_space (this);
pp_cxx_left_paren (this);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
expression (WHILE_COND (t));
pp_cxx_right_paren (this);
pp_newline_and_indent (this, 3);
statement (WHILE_BODY (t));
pp_indentation (this) -= 3;
pp_needs_newline (this) = true;
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
break;
case DO_STMT:
pp_cxx_ws_string (this, "do");
pp_newline_and_indent (this, 3);
statement (DO_BODY (t));
pp_newline_and_indent (this, -3);
pp_cxx_ws_string (this, "while");
pp_space (this);
pp_cxx_left_paren (this);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
expression (DO_COND (t));
pp_cxx_right_paren (this);
pp_cxx_semicolon (this);
pp_needs_newline (this) = true;
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
break;
case FOR_STMT:
pp_cxx_ws_string (this, "for");
pp_space (this);
pp_cxx_left_paren (this);
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
if (FOR_INIT_STMT (t))
statement (FOR_INIT_STMT (t));
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
else
pp_cxx_semicolon (this);
pp_needs_newline (this) = false;
pp_cxx_whitespace (this);
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
if (FOR_COND (t))
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
expression (FOR_COND (t));
pp_cxx_semicolon (this);
pp_needs_newline (this) = false;
pp_cxx_whitespace (this);
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
if (FOR_EXPR (t))
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
expression (FOR_EXPR (t));
pp_cxx_right_paren (this);
pp_newline_and_indent (this, 3);
statement (FOR_BODY (t));
pp_indentation (this) -= 3;
pp_needs_newline (this) = true;
break;
case RANGE_FOR_STMT:
pp_cxx_ws_string (this, "for");
pp_space (this);
pp_cxx_left_paren (this);
statement (RANGE_FOR_DECL (t));
pp_space (this);
pp_needs_newline (this) = false;
pp_colon (this);
pp_space (this);
statement (RANGE_FOR_EXPR (t));
pp_cxx_right_paren (this);
pp_newline_and_indent (this, 3);
statement (FOR_BODY (t));
pp_indentation (this) -= 3;
pp_needs_newline (this) = true;
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
break;
/* jump-statement:
goto identifier;
continue ;
return expression(opt) ; */
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
case BREAK_STMT:
case CONTINUE_STMT:
pp_string (this, TREE_CODE (t) == BREAK_STMT ? "break" : "continue");
pp_cxx_semicolon (this);
pp_needs_newline (this) = true;
c-common.def: Move FOR_STMT... ./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-04-09 05:18:18 +02:00
break;
/* expression-statement:
expression(opt) ; */
case EXPR_STMT:
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
expression (EXPR_STMT_EXPR (t));
pp_cxx_semicolon (this);
pp_needs_newline (this) = true;
break;
case CLEANUP_STMT:
pp_cxx_ws_string (this, "try");
pp_newline_and_indent (this, 2);
statement (CLEANUP_BODY (t));
pp_newline_and_indent (this, -2);
pp_cxx_ws_string (this, CLEANUP_EH_ONLY (t) ? "catch" : "finally");
pp_newline_and_indent (this, 2);
statement (CLEANUP_EXPR (t));
pp_newline_and_indent (this, -2);
break;
case STATIC_ASSERT:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
declaration (t);
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
default:
c_pretty_printer::statement (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
}
}
/* original-namespace-definition:
namespace identifier { namespace-body }
As an edge case, we also handle unnamed namespace definition here. */
static void
pp_cxx_original_namespace_definition (cxx_pretty_printer *pp, tree t)
{
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "namespace");
if (DECL_CONTEXT (t))
pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t));
if (DECL_NAME (t))
pp_cxx_unqualified_id (pp, t);
pp_cxx_whitespace (pp);
pp_cxx_left_brace (pp);
/* We do not print the namespace-body. */
pp_cxx_whitespace (pp);
pp_cxx_right_brace (pp);
}
/* namespace-alias:
identifier
namespace-alias-definition:
namespace identifier = qualified-namespace-specifier ;
qualified-namespace-specifier:
::(opt) nested-name-specifier(opt) namespace-name */
static void
pp_cxx_namespace_alias_definition (cxx_pretty_printer *pp, tree t)
{
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "namespace");
if (DECL_CONTEXT (t))
pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t));
pp_cxx_unqualified_id (pp, t);
pp_cxx_whitespace (pp);
pp_equal (pp);
pp_cxx_whitespace (pp);
if (DECL_CONTEXT (DECL_NAMESPACE_ALIAS (t)))
2006-06-06 13:44:09 +02:00
pp_cxx_nested_name_specifier (pp,
DECL_CONTEXT (DECL_NAMESPACE_ALIAS (t)));
pp_cxx_qualified_id (pp, DECL_NAMESPACE_ALIAS (t));
pp_cxx_semicolon (pp);
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
/* simple-declaration:
decl-specifier-seq(opt) init-declarator-list(opt) */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void
pp_cxx_simple_declaration (cxx_pretty_printer *pp, tree t)
{
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp->declaration_specifiers (t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_init_declarator (pp, t);
pp_cxx_semicolon (pp);
pp_needs_newline (pp) = true;
}
/*
template-parameter-list:
template-parameter
template-parameter-list , template-parameter */
static inline void
pp_cxx_template_parameter_list (cxx_pretty_printer *pp, tree t)
{
const int n = TREE_VEC_LENGTH (t);
int i;
for (i = 0; i < n; ++i)
{
if (i)
pp_cxx_separate_with (pp, ',');
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_template_parameter (pp, TREE_VEC_ELT (t, i));
}
}
/* template-parameter:
type-parameter
parameter-declaration
type-parameter:
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
class ...(opt) identifier(opt)
class identifier(opt) = type-id
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
typename identifier(opt)
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
typename ...(opt) identifier(opt) = type-id
template < template-parameter-list > class ...(opt) identifier(opt)
2006-06-06 13:44:09 +02:00
template < template-parameter-list > class identifier(opt) = template-name */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void
pp_cxx_template_parameter (cxx_pretty_printer *pp, tree t)
{
tree parameter = TREE_VALUE (t);
switch (TREE_CODE (parameter))
{
case TYPE_DECL:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "class");
re PR c++/20599 (variadic template support) 2007-03-09 Douglas Gregor <doug.gregor@gmail.com> PR c++/20599 * typeck.c (check_return_expr): Check for bare parameter packs. (comptypes): Compare template parameter packs and type pack expansions. * decl.c (grokdeclarator): Deal with the declaration of function parameter packs. (grokparms): Verify that the (optional) function parameter pack is at the end of the parameter list. (xref_basetypes): Handle pack expansions in the base class. (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT. * cp-tree.def (TYPE_ARGUMENT_PACK): New. (NONTYPE_ARGUMENT_PACK): New. (TYPE_PACK_EXPANSION): New. (EXPR_PACK_EXPANSION): New. (ARGUMENT_PACK_SELECT): New. * cp-objcp-common.c (cp_tree_size): Compute size of (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and ARGUMENT_PACK_SELECT. * error.c (dump_template_argument): Print template argument packs. (dump_template_argument_list): Ditto. (dump_template_parameter): Dump `...' for template type parameter packs. (dump_type): Dump TYPE_PACK_EXPANSION nodes. (dump_parameters): Print function parameter packs. (dump_template_parms): Print template argument packs. (dump_expr): Dump EXPR_PACK_EXPANSION nodes. (maybe_warn_variadic_templates): New. * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION. (write_template_arg): Write argument packs as separate arguments. * cp-tree.h (struct template_parm_index_s): Add flag that indicates that the template parameter is actually a parameter pack. (struct tree_argument_pack_select): New. (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT. (union lang_tree_node): Add argument_pack_select. (FUNCTION_PARAMETER_PACK_P): New. (PACK_EXPANSION_P): New. (PACK_EXPANSION_PATTERN): New. (SET_PACK_EXPANSION_PATTERN): New. (PACK_EXPANSION_PARAMETER_PACKS): New. (ARGUMENT_PACK_P): New. (ARGUMENT_PACK_ARGS): New. (SET_ARGUMENT_PACK_ARGS): New. (ARGUMENT_PACK_INCOMPLETE_P): New. (ARGUMENT_PACK_EXPLICIT_ARGS): New. (TEMPLATE_PARM_PARAMETER_PACK): New. (TEMPLATE_TYPE_PARAMETER_PACK): New. (ARGUMENT_PACK_SELECT_FROM_PACK): New. (ARGUMENT_PACK_SELECT_INDEX): New. (ARGUMENT_PACK_SELECT_ARG): New. (struct cp_declarator): Add parameter_pack_p flag. (maybe_warn_variadic_templates): Declare. (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to indicate a template parameter pack. (uses_parameter_packs): Declare. (template_parameter_pack_p): Declare. (template_parms_variadic_p): Declare. (make_pack_expansion): Declare. (check_for_bare_parameter_packs): Declare. * cxx-pretty-print.c (pp_cxx_unary_expression): Print sizeof... expressions. (pp_cxx_expression): Print pack expansions and non-type argument packs. (pp_cxx_exception_specification): Print pack expansions. (pp_cxx_direct_declarator): Print ellipsis for parameter packs. (pp_cxx_ctor_initializer): Print pack expansions. (pp_cxx_type_id): Print pack expansions. (pp_cxx_template_argument_list): Print argument packs. (pp_cxx_template_parameter): Print ellipsis for template parameter packs. * pt.c (comp_template_parms): Compare template parameter packs. (template_parameter_pack_p): New. (template_parms_variadic_p): New. (template_args_variadic_p): New. (make_ith_pack_parameter_name): New. (struct find_parameter_pack_data): New. (find_parameter_packs_r): New. (uses_parameter_packs): New. (make_pack_expansion): New. (check_for_bare_parameter_packs): New. (expand_template_argument_pack): New. (reduce_template_parm_level): Propagate parameter pack flag. (process_template_parm): Add is_parameter_pack parameter to state when the parameter is actually a parameter pack. Create template parameter packs when is_parameter_pack is true. (current_template_args): The argument for a template parameter pack is an argument pack containing a single pack expansion. (process_partial_specialization): When checking that non-type argument expressions do not involve template parameters, loop over the arguments in argument packs separately. (push_template_decl_real): Check that the type of the declaration does not have any bare parameter packs. Check that primary templates have no more than one parameter pack, and that it comes at the end of the template parameter list. (convert_template_argument): Handle coercions for pack expansion expressions by coercing the pattern then rebuilding the expansion. (coerce_template_parms): When coercing the arguments for a variadic template, pack "extra" arguments into an argument pack. (coerce_template_template_parms): Cannot coerce between parameter packs and non-pack parameters. (template_args_equal): Compare PACK_EXPANSION_P expressions. (comp_template_args): Expand all template arguments packs before comparing template argument lists. (mangle_class_name_for_template): Make argument packs as separate template arguments. (for_each_template_parm_r): No need to handle BASELINK. (instantiate_class_template): Handle pack expansions in the base class list. (tsubst_pack_expansion): New. (tsubst_template_args): Handle substitutions of argument packs and pack expansion into template argument lists. (tsubst_decl): Expand function parameter packs into separate function parameters. (tsubst_arg_types): Expand a type pack expansion into separate argument types. (tsubst_exception_specification): Handle pack expansions in exception specifiers. (tsubst): See through ARGUMENT_PACK_SELECT arguments when replacing a template parameter with its argument. If we encounter a substitution for an argument pack, just return the parameter itself. (tsubst_copy): sizeof(X...) returns the number of elements in parameter pack X. See through ARGUMENT_PACK_SELECT when the PARM_DECL is a parameter pack. (tsubst_expr): Expression pack expansions and argument packs cannot show up here; they will all be handled through function calls, sizeof, and template argument lists. (tsubst_copy_and_build): sizeof(X...) returns the number of elements in parameter pack X. Handle pack expansions in TREE_LIST and CONSTRUCTOR nodes. (fn_type_unification): Handle "incomplete" explicit template argument lists that specify some of the arguments for a template parameter pack. (type_unification_real): Unify arguments against pack expansions. (template_parm_level_and_index): New, helper function. (unify_pack_expansion): New. (unify): Unify argument packs on an argument-by-argument basis, handling variadic argument packs as well. (more_specialized_fn): Handle unification of function parameter packs. All things being equal, prefer non-variadic function templates to variadic function templates. (more_specialized_class): Prefer the variadic class template partial specialization that binds fewer arguments to a parameter pack. (regenerate_decl_from_template): Expand function parameter packs into separate parameters. (instantiate_decl): Ditto. (tsubst_initializer_list): Handle pack expansions for base-class initializers. (dependent_type_p_r): Determine dependent types in argument packs and pack expansions. (value_dependent_expression_p): Determine value-dependence of non-type argument packs. (dependent_template_arg_p): Handle argument packs. * semantics.c (finish_cond): Check for bare parameter packs. (finish_expr_stmt): Ditto. (finish_for_expr): Ditto. (finish_switch_cond): Ditto. (finish_mem_initializers): Ditto. * name-lookup.c (arg_assoc_type): Handle pack expansions and argument packs. * decl2.c (cp_build_parm_decl): Mark function parameter packs. * parser.c (make_declarator): Declarator is not an expansion. (make_pointer_declarator): Transfer parameter pack flag to outer declarator. (make_reference_declarator): Ditto. (make_ptrmem_declarator): Ditto. (make_call_declarator): Ditto. (make_array_declarator): Ditto. (cp_parser_postfix_expression): Allow pack expansion expressions in the argument list for a call expression. (cp_parser_parenthesized_expression_list): Add new parameter ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand into separate arguments." (cp_parser_new_placement): Allow pack expansion expressions. (cp_parser_new_initializer): Ditto. (cp_parser_mem_initializer_list): Allow ellipsis to create a base-class initializer expansion. (cp_parser_mem_initializer): Ditto. (cp_parser_template_parameter_list): Keep track of whether the template parameter is a template parameter pack. (cp_parser_template_parameter): Parse the ellipsis to indicate a template parameter pack. (cp_parser_type_parameter): Ditto. (cp_parser_template_argument_list): Parse the ellipsis to indicate a pack expansion. (cp_parser_direct_declarator): Parse the ellipsis to indicate that this declarator is a parameter pack. (cp_parser_parameter_declaration): The ellipsis does not end the parameter declaration, because it might be a parameter pack. Parse the ellipsis to indicate a parameter pack. (cp_parser_initializer): Allow pack expansions. (cp_parser_initializer_list): Allow ellipsis to create an initializer expansion. (cp_parser_base_clause): Allow ellipsis to create a base specifier expansion. (cp_parser_type_id_list): Allow ellipsis to create an exception specifier expansion. (cp_parser_attribute_list): Don't allow pack expansions. (cp_parser_functional_cast): Allow pack expansions. (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to compute the length of a parameter pack. (cp_parser_next_token_ends_template_argument_p): An ellipsis can end a template argument. * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK, NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION, CAST_EXPR. From-SVN: r122788
2007-03-10 02:58:58 +01:00
if (TEMPLATE_TYPE_PARAMETER_PACK (TREE_TYPE (t)))
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "...");
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (DECL_NAME (parameter))
pp_cxx_tree_identifier (pp, DECL_NAME (parameter));
/* FIXME: Check if we should print also default argument. */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case PARM_DECL:
pp_cxx_parameter_declaration (pp, parameter);
break;
case TEMPLATE_DECL:
break;
default:
pp_unsupported_tree (pp, t);
break;
}
}
/* Pretty-print a template parameter in the canonical form
"template-parameter-<level>-<position in parameter list>". */
void
pp_cxx_canonical_template_parameter (cxx_pretty_printer *pp, tree parm)
{
const enum tree_code code = TREE_CODE (parm);
/* Brings type template parameters to the canonical forms. */
if (code == TEMPLATE_TYPE_PARM || code == TEMPLATE_TEMPLATE_PARM
|| code == BOUND_TEMPLATE_TEMPLATE_PARM)
parm = TEMPLATE_TYPE_PARM_INDEX (parm);
pp_cxx_begin_template_argument_list (pp);
pp->translate_string ("template-parameter-");
pp_wide_integer (pp, TEMPLATE_PARM_LEVEL (parm));
pp_minus (pp);
pp_wide_integer (pp, TEMPLATE_PARM_IDX (parm) + 1);
pp_cxx_end_template_argument_list (pp);
}
/* Print a constrained-type-specifier. */
void
pp_cxx_constrained_type_spec (cxx_pretty_printer *pp, tree c)
{
tree t, a;
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
if (c == error_mark_node)
{
pp_cxx_ws_string(pp, "<unsatisfied-constrained-placeholder>");
return;
}
placeholder_extract_concept_and_args (c, t, a);
pp->id_expression (t);
if (TREE_VEC_LENGTH (a) > 1)
{
pp_cxx_begin_template_argument_list (pp);
tree args = make_tree_vec (TREE_VEC_LENGTH (a) - 1);
for (int i = TREE_VEC_LENGTH (a) - 1; i > 0; --i)
TREE_VEC_ELT (args, i-1) = TREE_VEC_ELT (a, i);
pp_cxx_template_argument_list (pp, args);
ggc_free (args);
pp_cxx_end_template_argument_list (pp);
}
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
/*
template-declaration:
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
export(opt) template < template-parameter-list > declaration
Concept extensions:
template-declaration:
export(opt) template < template-parameter-list >
requires-clause(opt) declaration */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
static void
pp_cxx_template_declaration (cxx_pretty_printer *pp, tree t)
{
tree tmpl = most_general_template (t);
tree level;
pp_maybe_newline_and_indent (pp, 0);
for (level = DECL_TEMPLATE_PARMS (tmpl); level; level = TREE_CHAIN (level))
{
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "template");
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
pp_cxx_begin_template_argument_list (pp);
pp_cxx_template_parameter_list (pp, TREE_VALUE (level));
pp_cxx_end_template_argument_list (pp);
pp_newline_and_indent (pp, 3);
}
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
if (flag_concepts)
if (tree ci = get_constraints (t))
if (tree reqs = CI_TEMPLATE_REQS (ci))
{
pp_cxx_requires_clause (pp, reqs);
pp_newline_and_indent (pp, 6);
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
if (TREE_CODE (t) == FUNCTION_DECL && DECL_SAVED_TREE (t))
pp_cxx_function_definition (pp, t);
else
pp_cxx_simple_declaration (pp, t);
}
static void
pp_cxx_explicit_specialization (cxx_pretty_printer *pp, tree t)
{
pp_unsupported_tree (pp, t);
}
static void
pp_cxx_explicit_instantiation (cxx_pretty_printer *pp, tree t)
{
pp_unsupported_tree (pp, t);
}
/*
declaration:
block-declaration
function-definition
template-declaration
explicit-instantiation
explicit-specialization
linkage-specification
namespace-definition
block-declaration:
simple-declaration
asm-definition
namespace-alias-definition
using-declaration
using-directive
static_assert-declaration */
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
void
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
cxx_pretty_printer::declaration (tree t)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
if (TREE_CODE (t) == STATIC_ASSERT)
{
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_ws_string (this, "static_assert");
pp_cxx_left_paren (this);
expression (STATIC_ASSERT_CONDITION (t));
pp_cxx_separate_with (this, ',');
expression (STATIC_ASSERT_MESSAGE (t));
pp_cxx_right_paren (this);
}
else if (!DECL_LANG_SPECIFIC (t))
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_simple_declaration (this, t);
else if (DECL_USE_TEMPLATE (t))
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
switch (DECL_USE_TEMPLATE (t))
{
case 1:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_template_declaration (this, t);
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case 2:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_explicit_specialization (this, t);
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case 3:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_explicit_instantiation (this, t);
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
default:
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
}
else switch (TREE_CODE (t))
{
case VAR_DECL:
case TYPE_DECL:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_simple_declaration (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
case FUNCTION_DECL:
if (DECL_SAVED_TREE (t))
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_function_definition (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
else
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_simple_declaration (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
case NAMESPACE_DECL:
if (DECL_NAMESPACE_ALIAS (t))
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_namespace_alias_definition (this, t);
else
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_cxx_original_namespace_definition (this, t);
break;
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
default:
c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. c-family/ * c-pretty-print.h (c_pretty_printer::declaration): Now a virtual member function. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::declarator): Likewise. (c_pretty_printer::abstract_declarator): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::direct_declarator): Likewise. (c_pretty_printer::function_specifier): Likewise. (pp_declaration): Adjust. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_direct_declarator): Likewise. (pp_function_specifier): Likewise. (pp_direct_abstract_declarator): Remove as unused. (pp_c_declaration): Remove. (pp_c_declaration_specifiers): Likewise. (pp_c_declarator): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_function_specifier): Likewise. (pp_c_direct_abstract_declarator): Likewise. * c-pretty-print.c (c_pretty_printer::abstract_declarator): Rename from pp_c_abstract_declarator. Adjust. (c_pretty_printer::direct_abstract_declarator): Rename from pp_c_direct_abstract_declarator. Adjust. (c_pretty_printer::function_specifier): Rename from pp_c_function_specifier. Adjust. (c_pretty_printer::declaration_specifiers): Rename from pp_c_declaration_specifiers. Adjust. (c_pretty_printer::direct_declarator): Rename from pp_c_direct_declarator. Adjust. (c_pretty_printer::declarator): Rename from pp_c_declarator. Adjust. (c_pretty_printer::declaration): Rename from pp_c_declaration. Adjust. (c_pretty_printer::c_pretty_printer): Do not assign to declaration, declaration_specifiers, declarator, direct_declarator, direct_abstract_declarator, function_specifier. cp/ * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as overrider. (cxx_pretty_printer::declaration_specifiers): Likewise. (cxx_pretty_printer::function_specifier): Likewise. (cxx_pretty_printer::declarator): Likewise. (cxx_pretty_printer::direct_declarator): Likewise. (cxx_pretty_printer::abstract_declarator): Likewise. (cxx_pretty_printer::direct_abstract_declarator): Likewise. (pp_cxx_declaration): Remove. * cxx-pretty-print.c (cxx_pretty_printer::function_specifier): Rename from pp_cxx_function_specifier. Adjust. (cxx_pretty_printer::declaration_specifiers): Rename from pp_cxx_decl_specifier_seq. Adjust. (cxx_pretty_printer::direct_declarator): Rename from pp_cxx_direct_declarator. Adjust. (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator. Adjust. (cxx_pretty_printer::abstract_declarator): Rename from pp_cxx_abstract_declarator. Adjust. (cxx_pretty_printer::direct_abstract_declarator): Rename from pp_cxx_direct_abstract_declarator. Adjust. (cxx_pretty_printer::declaration): Rename from pp_cxx_declaration. Adjust. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to declaration, declaration_specifiers, function_specifier, declarator, direct_declarator, abstract_declarator, direct_abstract_declarator. * error.c (dump_decl): Adjust. From-SVN: r202109
2013-08-30 17:28:51 +02:00
pp_unsupported_tree (this, t);
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
break;
}
}
static void
pp_cxx_typeid_expression (cxx_pretty_printer *pp, tree t)
{
t = TREE_OPERAND (t, 0);
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "typeid");
pp_cxx_left_paren (pp);
if (TYPE_P (t))
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->type_id (t);
else
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->expression (t);
pp_cxx_right_paren (pp);
}
void
pp_cxx_va_arg_expression (cxx_pretty_printer *pp, tree t)
{
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "va_arg");
pp_cxx_left_paren (pp);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->assignment_expression (TREE_OPERAND (t, 0));
pp_cxx_separate_with (pp, ',');
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->type_id (TREE_TYPE (t));
pp_cxx_right_paren (pp);
}
static bool
pp_cxx_offsetof_expression_1 (cxx_pretty_printer *pp, tree t)
{
switch (TREE_CODE (t))
{
case ARROW_EXPR:
if (TREE_CODE (TREE_OPERAND (t, 0)) == STATIC_CAST_EXPR
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (t, 0))))
{
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->type_id (TREE_TYPE (TREE_TYPE (TREE_OPERAND (t, 0))));
pp_cxx_separate_with (pp, ',');
return true;
}
return false;
case COMPONENT_REF:
if (!pp_cxx_offsetof_expression_1 (pp, TREE_OPERAND (t, 0)))
return false;
if (TREE_CODE (TREE_OPERAND (t, 0)) != ARROW_EXPR)
pp_cxx_dot (pp);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->expression (TREE_OPERAND (t, 1));
return true;
case ARRAY_REF:
if (!pp_cxx_offsetof_expression_1 (pp, TREE_OPERAND (t, 0)))
return false;
pp_left_bracket (pp);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->expression (TREE_OPERAND (t, 1));
pp_right_bracket (pp);
return true;
default:
return false;
}
}
void
pp_cxx_offsetof_expression (cxx_pretty_printer *pp, tree t)
{
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "offsetof");
pp_cxx_left_paren (pp);
if (!pp_cxx_offsetof_expression_1 (pp, TREE_OPERAND (t, 0)))
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->expression (TREE_OPERAND (t, 0));
pp_cxx_right_paren (pp);
}
void
pp_cxx_addressof_expression (cxx_pretty_printer *pp, tree t)
{
pp_cxx_ws_string (pp, "__builtin_addressof");
pp_cxx_left_paren (pp);
pp->expression (TREE_OPERAND (t, 0));
pp_cxx_right_paren (pp);
}
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
static char const*
get_fold_operator (tree t)
{
int op = int_cst_value (FOLD_EXPR_OP (t));
if (FOLD_EXPR_MODIFY_P (t))
{
switch (op)
{
case NOP_EXPR: return "=";
case PLUS_EXPR: return "+=";
case MINUS_EXPR: return "-=";
case MULT_EXPR: return "*=";
case TRUNC_DIV_EXPR: return "/=";
case TRUNC_MOD_EXPR: return "%=";
case BIT_XOR_EXPR: return "^=";
case BIT_AND_EXPR: return "&=";
case BIT_IOR_EXPR: return "|=";
case LSHIFT_EXPR: return "<<=";
case RSHIFT_EXPR: return ">>=";
default: gcc_unreachable ();
}
}
else
{
switch (op)
{
case PLUS_EXPR: return "+";
case MINUS_EXPR: return "-";
case MULT_EXPR: return "*";
case TRUNC_DIV_EXPR: return "/";
case TRUNC_MOD_EXPR: return "%";
case BIT_XOR_EXPR: return "^";
case BIT_AND_EXPR: return "&";
case BIT_IOR_EXPR: return "|";
case LSHIFT_EXPR: return "<<";
case RSHIFT_EXPR: return ">>";
case EQ_EXPR: return "==";
case NE_EXPR: return "!=";
case LT_EXPR: return "<";
case GT_EXPR: return ">";
case LE_EXPR: return "<=";
case GE_EXPR: return ">=";
case TRUTH_ANDIF_EXPR: return "&&";
case TRUTH_ORIF_EXPR: return "||";
case MEMBER_REF: return "->*";
case DOTSTAR_EXPR: return ".*";
case OFFSET_REF: return ".*";
default: return ","; /* FIXME: Not the right default. */
}
}
}
void
pp_cxx_unary_left_fold_expression (cxx_pretty_printer *pp, tree t)
{
char const* op = get_fold_operator (t);
tree expr = PACK_EXPANSION_PATTERN (FOLD_EXPR_PACK (t));
pp_cxx_left_paren (pp);
pp_cxx_ws_string (pp, "...");
pp_cxx_ws_string (pp, op);
pp->expression (expr);
pp_cxx_right_paren (pp);
}
void
pp_cxx_unary_right_fold_expression (cxx_pretty_printer *pp, tree t)
{
char const* op = get_fold_operator (t);
tree expr = PACK_EXPANSION_PATTERN (FOLD_EXPR_PACK (t));
pp_cxx_left_paren (pp);
pp->expression (expr);
pp_space (pp);
pp_cxx_ws_string (pp, op);
pp_cxx_ws_string (pp, "...");
pp_cxx_right_paren (pp);
}
void
pp_cxx_binary_fold_expression (cxx_pretty_printer *pp, tree t)
{
char const* op = get_fold_operator (t);
tree t1 = TREE_OPERAND (t, 1);
tree t2 = TREE_OPERAND (t, 2);
if (t1 == FOLD_EXPR_PACK (t))
t1 = PACK_EXPANSION_PATTERN (t1);
else
t2 = PACK_EXPANSION_PATTERN (t2);
pp_cxx_left_paren (pp);
pp->expression (t1);
pp_cxx_ws_string (pp, op);
pp_cxx_ws_string (pp, "...");
pp_cxx_ws_string (pp, op);
pp->expression (t2);
pp_cxx_right_paren (pp);
}
void
pp_cxx_trait_expression (cxx_pretty_printer *pp, tree t)
{
cp_trait_kind kind = TRAIT_EXPR_KIND (t);
switch (kind)
{
case CPTK_HAS_NOTHROW_ASSIGN:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__has_nothrow_assign");
break;
case CPTK_HAS_TRIVIAL_ASSIGN:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__has_trivial_assign");
break;
case CPTK_HAS_NOTHROW_CONSTRUCTOR:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__has_nothrow_constructor");
break;
case CPTK_HAS_TRIVIAL_CONSTRUCTOR:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__has_trivial_constructor");
break;
case CPTK_HAS_NOTHROW_COPY:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__has_nothrow_copy");
break;
case CPTK_HAS_TRIVIAL_COPY:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__has_trivial_copy");
break;
case CPTK_HAS_TRIVIAL_DESTRUCTOR:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__has_trivial_destructor");
break;
case CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS:
pp_cxx_ws_string (pp, "__has_unique_object_representations");
break;
case CPTK_HAS_VIRTUAL_DESTRUCTOR:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__has_virtual_destructor");
break;
case CPTK_IS_ABSTRACT:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__is_abstract");
break;
case CPTK_IS_BASE_OF:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__is_base_of");
break;
case CPTK_IS_CLASS:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__is_class");
break;
case CPTK_IS_EMPTY:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__is_empty");
break;
case CPTK_IS_ENUM:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__is_enum");
break;
case CPTK_IS_FINAL:
pp_cxx_ws_string (pp, "__is_final");
break;
case CPTK_IS_POD:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__is_pod");
break;
case CPTK_IS_POLYMORPHIC:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__is_polymorphic");
break;
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
case CPTK_IS_SAME_AS:
pp_cxx_ws_string (pp, "__is_same_as");
break;
case CPTK_IS_STD_LAYOUT:
pp_cxx_ws_string (pp, "__is_std_layout");
break;
case CPTK_IS_TRIVIAL:
pp_cxx_ws_string (pp, "__is_trivial");
break;
case CPTK_IS_TRIVIALLY_ASSIGNABLE:
pp_cxx_ws_string (pp, "__is_trivially_assignable");
break;
case CPTK_IS_TRIVIALLY_CONSTRUCTIBLE:
pp_cxx_ws_string (pp, "__is_trivially_constructible");
break;
case CPTK_IS_TRIVIALLY_COPYABLE:
pp_cxx_ws_string (pp, "__is_trivially_copyable");
break;
case CPTK_IS_UNION:
c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. * c-objc-common.c (c_tree_printer): Print identifiers with pp_identifier, not pp_string. Mark "({anonymous})" for translation. * c-pretty-print.c (pp_c_ws_string): New. (pp_c_cv_qualifier, pp_c_type_specifier, pp_c_specifier_qualifier_list, pp_c_parameter_type_list, pp_c_storage_class_specifier, pp_c_function_specifier, pp_c_attributes, pp_c_bool_constant, pp_c_constant, pp_c_primary_expression, pp_c_postfix_expression, pp_c_unary_expression, pp_c_shift_expression, pp_c_relational_expression, pp_c_equality_expression, pp_c_logical_and_expression, pp_c_logical_or_expression): Mostly use pp_string and pp_c_ws_string in place of pp_identifier and pp_c_identifier for non-identifiers. Mark English strings for translation. * c-pretty-print.h (pp_c_ws_string): Declare. cp: * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id, pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression, pp_cxx_new_expression, pp_cxx_delete_expression, pp_cxx_unary_expression, pp_cxx_assignment_operator, pp_cxx_assignment_expression, pp_cxx_expression, pp_cxx_function_specifier, pp_cxx_decl_specifier_seq, pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq, pp_cxx_exception_specification, pp_cxx_direct_declarator, pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement, pp_cxx_namespace_alias_definition, pp_cxx_template_parameter, pp_cxx_canonical_template_parameter, pp_cxx_template_declaration, pp_cxx_declaration, pp_cxx_typeid_expression, pp_cxx_va_arg_expression, pp_cxx_offsetof_expression, pp_cxx_trait_expression): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. * cxx-pretty-print.h (pp_cxx_ws_string): Define. * error.c (dump_template_parameter, dump_template_bindings, dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl, dump_decl, dump_template_decl, dump_function_decl, dump_parameters, dump_exception_spec, dump_template_parms, dump_expr, dump_binary_op, dump_unary_op, op_to_string, assop_to_string, args_to_string, cp_print_error_function, print_instantiation_full_context, print_instantiation_partial_context): Mostly use pp_string and pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier for non-identifiers. Mark English strings for translation. (dump_global_iord): Mark strings for translation; use longer strings instead of substituting single words. (function_category): Return a format string marked for translation, not a single word or phrase to substitute in a longer phrase. From-SVN: r147033
2009-05-01 16:09:20 +02:00
pp_cxx_ws_string (pp, "__is_union");
break;
case CPTK_IS_LITERAL_TYPE:
pp_cxx_ws_string (pp, "__is_literal_type");
break;
default:
gcc_unreachable ();
}
pp_cxx_left_paren (pp);
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->type_id (TRAIT_EXPR_TYPE1 (t));
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
if (kind == CPTK_IS_BASE_OF || kind == CPTK_IS_SAME_AS)
{
pp_cxx_separate_with (pp, ',');
c-objc-common.c (c_tree_printer): Tidy. c/ * c-objc-common.c (c_tree_printer): Tidy. c-family/ * c-pretty-print.h (c_pretty_printer::type_id): Now a virtual member function. (c_pretty_printer::storage_class_specifier): Likewise. (c_pretty_printer::initializer): Likewise. (pp_declaration): Remove. (pp_declaration_specifiers): Likewise. (pp_abstract_declarator): Likewise. (pp_declarator): Likewise. (pp_type_id): Likewise. (pp_statement): Likewise. (pp_constant): Likewise. (pp_id_expression): Likewise. (pp_primary_expression): Likewise. (pp_unary_expression): Likewise. (pp_multiplicative_expression): Likewise. (pp_conditional_expression): Likewise. (pp_assignment_expression): Likewise. (pp_expression): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. * c-pretty-print.c (pp_c_type_cast): Tidy. (pp_c_pointer): Likewise. (pp_c_type_specifier): Likewise. (pp_c_parameter_type_list): Likewise. (pp_c_function_definition): Likewise. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_constructor_elts): Likewise. (c_pretty_printer::direct_abstract_declarator): Likewise. (c_pretty_printer::declaration_specifiers): Likewise. (c_pretty_printer::primary_expression): Likewise. (c_pretty_printer::postfix_expression): Likewise. (c_pretty_printer::type_id): Rename from pp_c_type_id. (c_pretty_printer::storage_class_specifier): Rename from pp_c_storage_class_specifier. (c_pretty_printer::initializer): Rename from pp_c_initializer. (c_pretty_printer::c_pretty_printer): Do not assign to type_id, storage_class_specifier, initializer, offset_list, flags. cp/ * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as overrider. * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove. (pp_cxx_userdef_literal): Tidy. (pp_cxx_template_argument_list): Likewise. (pp_cxx_typeid_expression): Likewise. (pp_cxx_offsetof_expression_1): Likewise. (cxx_pretty_printer::postfix_expression): Likewise. (cxx_pretty_printer::unary_expression): Likewise. (cxx_pretty_printer::statement): Likewise. (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id. (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id. * error.c (dump_decl): Tidy. (dump_expr): Likewise. From-SVN: r202203
2013-09-03 11:52:19 +02:00
pp->type_id (TRAIT_EXPR_TYPE2 (t));
}
pp_cxx_right_paren (pp);
}
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
// requires-clause:
// 'requires' logical-or-expression
void
pp_cxx_requires_clause (cxx_pretty_printer *pp, tree t)
{
if (!t)
return;
pp->padding = pp_before;
pp_cxx_ws_string (pp, "requires");
pp_space (pp);
pp->expression (t);
}
/* requirement:
simple-requirement
compound-requirement
type-requirement
nested-requirement */
static void
pp_cxx_requirement (cxx_pretty_printer *pp, tree t)
{
switch (TREE_CODE (t))
{
case SIMPLE_REQ:
pp_cxx_simple_requirement (pp, t);
break;
case TYPE_REQ:
pp_cxx_type_requirement (pp, t);
break;
case COMPOUND_REQ:
pp_cxx_compound_requirement (pp, t);
break;
case NESTED_REQ:
pp_cxx_nested_requirement (pp, t);
break;
default:
gcc_unreachable ();
}
}
// requirement-list:
// requirement
// requirement-list ';' requirement[opt]
//
static void
pp_cxx_requirement_list (cxx_pretty_printer *pp, tree t)
{
for (; t; t = TREE_CHAIN (t))
pp_cxx_requirement (pp, TREE_VALUE (t));
}
// requirement-body:
// '{' requirement-list '}'
static void
pp_cxx_requirement_body (cxx_pretty_printer *pp, tree t)
{
pp_cxx_left_brace (pp);
pp_cxx_requirement_list (pp, t);
pp_cxx_right_brace (pp);
}
// requires-expression:
// 'requires' requirement-parameter-list requirement-body
void
pp_cxx_requires_expr (cxx_pretty_printer *pp, tree t)
{
pp_string (pp, "requires");
if (tree parms = TREE_OPERAND (t, 0))
{
pp_cxx_parameter_declaration_clause (pp, parms);
pp_cxx_whitespace (pp);
}
pp_cxx_requirement_body (pp, TREE_OPERAND (t, 1));
}
/* simple-requirement:
expression ';' */
void
pp_cxx_simple_requirement (cxx_pretty_printer *pp, tree t)
{
pp->expression (TREE_OPERAND (t, 0));
pp_cxx_semicolon (pp);
}
/* type-requirement:
typename type-name ';' */
void
pp_cxx_type_requirement (cxx_pretty_printer *pp, tree t)
{
pp->type_id (TREE_OPERAND (t, 0));
pp_cxx_semicolon (pp);
}
/* compound-requirement:
'{' expression '}' 'noexcept' [opt] trailing-return-type [opt] */
void
pp_cxx_compound_requirement (cxx_pretty_printer *pp, tree t)
{
pp_cxx_left_brace (pp);
pp->expression (TREE_OPERAND (t, 0));
pp_cxx_right_brace (pp);
if (COMPOUND_REQ_NOEXCEPT_P (t))
pp_cxx_ws_string (pp, "noexcept");
if (tree type = TREE_OPERAND (t, 1))
{
pp_cxx_ws_string (pp, "->");
pp->type_id (type);
}
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_cxx_semicolon (pp);
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
}
/* nested requirement:
'requires' constraint-expression */
void
pp_cxx_nested_requirement (cxx_pretty_printer *pp, tree t)
{
pp_cxx_ws_string (pp, "requires");
pp->expression (TREE_OPERAND (t, 0));
pp_cxx_semicolon (pp);
}
void
pp_cxx_predicate_constraint (cxx_pretty_printer *pp, tree t)
{
pp->expression (TREE_OPERAND (t, 0));
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
}
void
pp_cxx_check_constraint (cxx_pretty_printer *pp, tree t)
{
tree decl = CHECK_CONSTR_CONCEPT (t);
tree tmpl = DECL_TI_TEMPLATE (decl);
tree args = CHECK_CONSTR_ARGS (t);
tree id = build_nt (TEMPLATE_ID_EXPR, tmpl, args);
if (VAR_P (decl))
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp->expression (id);
else if (TREE_CODE (decl) == FUNCTION_DECL)
{
tree call = build_vl_exp (CALL_EXPR, 2);
TREE_OPERAND (call, 0) = integer_two_node;
TREE_OPERAND (call, 1) = id;
pp->expression (call);
}
else
gcc_unreachable ();
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
}
void
pp_cxx_expression_constraint (cxx_pretty_printer *pp, tree t)
{
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_string (pp, "<valid-expression ");
pp_cxx_left_paren (pp);
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
pp->expression (TREE_OPERAND (t, 0));
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_cxx_right_paren (pp);
pp_string (pp, ">");
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
}
void
pp_cxx_type_constraint (cxx_pretty_printer *pp, tree t)
{
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_string (pp, "<valid-type ");
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
pp->type_id (TREE_OPERAND (t, 0));
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_string (pp, ">");
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
}
void
pp_cxx_implicit_conversion_constraint (cxx_pretty_printer *pp, tree t)
{
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_string (pp, "<implicitly-conversion ");
pp_cxx_left_paren (pp);
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
pp->expression (ICONV_CONSTR_EXPR (t));
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_cxx_right_paren (pp);
pp_cxx_ws_string (pp, "to");
pp->type_id (ICONV_CONSTR_TYPE (t));
pp_string (pp, ">");
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
}
void
pp_cxx_argument_deduction_constraint (cxx_pretty_printer *pp, tree t)
{
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_string (pp, "<argument-deduction ");
pp_cxx_left_paren (pp);
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
pp->expression (DEDUCT_CONSTR_EXPR (t));
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_cxx_right_paren (pp);
pp_cxx_ws_string (pp, "as");
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
pp->expression (DEDUCT_CONSTR_PATTERN (t));
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_string (pp, ">");
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
}
void
pp_cxx_exception_constraint (cxx_pretty_printer *pp, tree t)
{
pp_cxx_ws_string (pp, "noexcept");
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_cxx_whitespace (pp);
pp_cxx_left_paren (pp);
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
pp->expression (TREE_OPERAND (t, 0));
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_cxx_right_paren (pp);
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
}
void
pp_cxx_parameterized_constraint (cxx_pretty_printer *pp, tree t)
{
pp_left_paren (pp);
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_string (pp, "<requires ");
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
if (tree parms = PARM_CONSTR_PARMS (t))
{
pp_cxx_parameter_declaration_clause (pp, parms);
pp_cxx_whitespace (pp);
}
pp_cxx_constraint (pp, PARM_CONSTR_OPERAND (t));
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
pp_string (pp, ">");
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
}
void
pp_cxx_conjunction (cxx_pretty_printer *pp, tree t)
{
pp_cxx_constraint (pp, TREE_OPERAND (t, 0));
pp_string (pp, " and ");
pp_cxx_constraint (pp, TREE_OPERAND (t, 1));
}
void
pp_cxx_disjunction (cxx_pretty_printer *pp, tree t)
{
pp_cxx_constraint (pp, TREE_OPERAND (t, 0));
pp_string (pp, " or ");
pp_cxx_constraint (pp, TREE_OPERAND (t, 1));
}
void
pp_cxx_constraint (cxx_pretty_printer *pp, tree t)
{
if (t == error_mark_node)
return pp->expression (t);
switch (TREE_CODE (t))
{
case PRED_CONSTR:
pp_cxx_predicate_constraint (pp, t);
break;
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
case CHECK_CONSTR:
pp_cxx_check_constraint (pp, t);
break;
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
case EXPR_CONSTR:
pp_cxx_expression_constraint (pp, t);
break;
case TYPE_CONSTR:
pp_cxx_type_constraint (pp, t);
break;
case ICONV_CONSTR:
pp_cxx_implicit_conversion_constraint (pp, t);
break;
case DEDUCT_CONSTR:
pp_cxx_argument_deduction_constraint (pp, t);
break;
case EXCEPT_CONSTR:
pp_cxx_exception_constraint (pp, t);
break;
case PARM_CONSTR:
pp_cxx_parameterized_constraint (pp, t);
break;
case CONJ_CONSTR:
pp_cxx_conjunction (pp, t);
break;
case DISJ_CONSTR:
pp_cxx_disjunction (pp, t);
break;
Improving concepts performance and diagnostics. PR c++/67565 PR c++/67579 PR c++/71843 gcc/ * timevar.def (TV_CONSTRAINT_SAT, TV_CONSTRAINT_SUB): New time vars for constraint satisfaction and subsumption. * timevar.h (auto_timevar): New constructor that matches the push/pop pattern of usage in pt.c. gcc/cp/ * cp-tree.def (CHECK_CONSTR): New. * cp-tree.h (CHECK_CONSTR_CONCEPT): New. (CHECK_CONSTR_ARGS): New. * constraint.cc (make_predicate_constraint): Remove in favor of normalize_expression. (resolve_constraint_check): Actually return error_mark_node when resolution fails. (resolve_variable_concept_check): Perform coercion as if processing a template. Also return errors on resolution failure. (lift_*): Remove all of these functions. Don't unnecessarily inline concepts. (learn_*): Add facilities to memoize implications for subsumption during normalization. (expanding_concept): New. (expand_concept): New. Return the inlined and normalized definition of a concept when needed. (transform_*, xform_*): Rename to normalize_* to better reflect the responsibility of those functions. (normalize_template_id_expression): Check for non-boolean operands when possible. Generate check constraints instead of normal variable references. (normalize_call_expression): Report errors when resolution fails. (check_for_logical_overloads): Rewrite this check to more accurately report the error. (normalize_atom): Check for overloaded calls and invalid types before determining if the expression refers to a concept. (build_constraints): Don't cache normalized constraints or decmposed assumptions. (finish_shorthand_constraint): Return a normalized expression instead of a predicate constraint. (finish_template_introduction): Same. (placeholder_extract_concept_and_args): Rewrite this since we only ever get check constraints here. (equivalent_placeholder_constraints): Rewrite in terms of check constraints, and handle error_mark_nodes correctly. (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr) (tsubst_implicit_conversion_constr) (tsubst_argument_deduction_constr, tsubst_exception_constr) (tsubst_parameterized_constraint, tsubst_constraint): New. (tsbust_conjunection): Replace with tsubst_logical_operator and actually generate the right kind of constraint. (tsubst_requirement_body): Reverse the order of substituted arguments so that they appear in the order written (helps diagnostics). (satisfy_check_constraint): New. (satisfy_conjunction): Simplify. (satisfy_disjunction): Same. (satisfy_constraint_1): Handle check constraints. (eval_constr): New (private) global state. (evaluating_constraints_sentinel): New. Manages eval_constr. (satisfy_constraint): Add timing variables. (satisfy_associated_constraints): Add hooks for memoization. (evaluate_function_concept): Build a check constraint instead of normalizing its definition. (evaluate_variable_concept): Same. (evaluate_constraint_expression): Normalize, but in the current declaration processing context. (evaluating_constraints_p): New. (elide_constraint_failure_p): Actually emit constraint_thresh errors. (diagnose_*): Remove artificial indentation. Add a new parameter to each that tracks the current (complete) constraint prior to any substitutions. (diagnose_expression): Removed. (diagnose_call_expression): Same. (diagnose_template_id): Same. (diagnose_template_id): New. (diagnose_logical_constraint): New. (diagnose_expression_constraint): Show the original expression. (diagnose_type_constraint): Show the original type. (diagnose_implicit_conversion_constraint): Be specific about failures, don't re-diagnose a known-to-be-failed substitutions, and manage elisions properly. (diagnose_argument_deduction_constraint): Same. (diagnose_exception_constraint): Same. (diagnose_parameterized_constraint): Same. (constraint_p): Allow EXPR_PACK_EXPANSION. * logic.cc (next_by_distance): Removed. No longer used. (any_p): Renamed from any_of. (term_entry, term_hasher): New. (term_list): Rewrite to include a hash table for quick lookup. Also, make less stateful. (proof_state): Extend to allow goals to be discharged once satisfied. (non_atomic_constraint_p): New. (any_non_atomic_constraints_p): New. (...rest...): Previous implementation completely replaced with an iterative algorithm that opportunistically prunes the search space before committing to using more memory. * parser.c: (cp_parser_type_parameter): Normalize constraints. (cp_parser_explicit_template_declaration): Same. * pt.c: (finish_template_variable): Be less redundant with this error message. (template_args_equal): No longer static. (tsubst_decl): Don't try to find specializations of variables that have already been instantiated. (build_non_dependent_expr): Avoid infinite recursion during concept expansion. (make_constrained_auto): Normalize constraints. (do_auto_deduction): When doing auto deduction from a partial-concept-id, be sure to include the explicit args checking the constraints. (constraint_sat_*): New. Memoize satisfied constraints. (concept_spec_*): New. Memoize expressions associated with a concept specialization. (constraint_memos, concept_memos): New. (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New. (lookup_concept_satisfaction, memoize_concept_satisfaction): New. (get_concept_expansion, save_concept_expansion): New. (hash_subsumption_args): New. (comp_subsumption_args): New. (subsumption_*): New. Memoize parts of the subsumption relation. (lookup_subsumption_result, save_subsumption_result): New. (init_constraint_processing): Initialize memo tables. (get_constraints): Shortcut if !flag_concepts. * decl.c (grokfndecl): Normalize constraints. * error.c (dump_simple_decl): Print "concept" when appropriate. (dump_function_decl): Same. (dump_template_decl): Don't write requirements when we're not printing the header. (dump_expr): Handle fold expressions. * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle fold expressions. (get_fold_operator): New. (pp_cxx_unary_left_fold_expression): New. (pp_cxx_unary_right_fold_expression): New. (pp_cxx_binary_fold_expression): New. (pp_cxx_check_constraint): New. (pp_cxx_*_constraint): Rewrite the grammar of internal constraints to make them easier to read when debugging. * search.c (accessible_p): Don't shortcut when evaluating constraints. * tree.c (cp_tree_equal): Handle CHECK_CONSTR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r238558
2016-07-21 08:05:24 +02:00
case EXPR_PACK_EXPANSION:
pp->expression (TREE_OPERAND (t, 0));
break;
Add C++ Concepts TS support. gcc/c-family/ * c-common.c (c_common_reswords): Add __is_same_as, concept, requires. * c-common.h (enum rid): Add RID_IS_SAME_AS, RID_CONCEPT, RID_REQUIRES. (D_CXX_CONCEPTS, D_CXX_CONCEPTS_FLAGS): New. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_concepts. * c-opts.c (set_std_cxx1z): Set flag_concepts. * c.opt (fconcepts): New. gcc/cp/ * constraint.cc, logic.cc: New files. * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o. (c++.tags): Also process .cc files. * call.c (enum rejection_reason_code): Add rr_constraint_failure. (print_z_candidate): Handle it. (constraint_failure): New. (add_function_candidate): Check constraints. (build_new_function_call): Handle evaluating concepts. (joust): Check more_constrained. * class.c (add_method): Check equivalently_constrained. (build_clone): Copy constraints. (currently_open_class): Return tree. (resolve_address_of_overloaded_function): Check constraints. * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR. (potential_constant_expression_1): Likewise. * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO. (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR. * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR, SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR, EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR, EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR. * cp-tree.h (struct tree_constraint_info, check_nonnull) (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS) (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS) (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS) (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P) (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR) (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE) (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN) (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS) (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT) (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE) (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated) (struct local_specialization_stack, enum auto_deduction_context) (variable_concept_p, concept_template_p) (struct deferring_access_check_sentinel): New. (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO. (union lang_tree_node): Add constraint_info field. (struct lang_decl_base): Add concept_p flag. (enum cp_decl_spec): Add ds_concept. (struct cp_declarator): Add requires_clause. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Handle REQUIRES_EXPR, TRAIT_EXPR, *_CONSTR. (pp_cxx_parameter_declaration_clause): Accept a chain of PARM_DECLs. (cxx_pretty_printer::declarator): Print requires-clause. (pp_cxx_template_declaration): Likewise. (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS. (pp_cxx_requires_clause, pp_cxx_requirement) (pp_cxx_requirement_list, pp_cxx_requirement_body) (pp_cxx_requires_expr, pp_cxx_simple_requirement) (pp_cxx_type_requirement, pp_cxx_compound_requirement) (pp_cxx_nested_requirement, pp_cxx_predicate_constraint) (pp_cxx_expression_constraint, pp_cxx_type_constraint) (pp_cxx_implicit_conversion_constraint) (pp_cxx_argument_deduction_constraint) (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint) (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New. * cxx-pretty-print.h: Declare them. * decl.c (decls_match): Compare constraints. (duplicate_decls): Likewise. Remove constraints before freeing. (cxx_init_decl_processing): Call init_constraint_processing. (cp_finish_decl): Diagnose concept without initializer. (grokfndecl, grokvardecl): Handle concepts and constraints. (grokdeclarator): Handle concept, requires-clause. (grokparms): No longer static. (xref_tag_1): Check constraints. (finish_function): Call check_function_concept. (cp_tree_node_structure): Handle CONSTRAINT_INFO. (check_concept_refinement, is_concept_var, check_concept_fn): New. * decl2.c (check_classfn): Compare constraints. (mark_used): Don't instantiate concepts. * error.c (dump_template_decl): Print constraints. (dump_function_decl): Likewise. (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR. * lex.c (init_reswords): Set D_CXX_CONCEPTS. * method.c (implicitly_declare_fn): Copy constraints from inherited ctor. * parser.h (struct cp_parser): Add in_result_type_constraint_p and prevent_constrained_type_specifiers fields. * parser.c (make_call_declarator): Add requires_clause parm. (cp_parser_new): Clear prevent_constrained_type_specifiers. (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES. (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers. (cp_parser_trait_expr): Handle RID_IS_SAME_AS. (cp_parser_declaration): Handle concept introduction. (cp_parser_member_declaration): Likewise. (cp_parser_template_parameter): Handle constrained parameter. (cp_parser_type_parameter): Handle constraints. (cp_parser_decl_specifier_seq): Handle RID_CONCEPT. (cp_parser_template_id): Handle partial concept id. (cp_parser_type_name): Add overload that takes typename_keyword_p. Handle constrained parameter. (cp_parser_nonclass_name): Handle concept names. (cp_parser_alias_declaration): Handle constraints. (cp_parser_late_return_type_opt): Also handle requires-clause. (cp_parser_type_id_1): Handle deduction constraint. (cp_parser_parameter_declaration): Handle constrained parameters. (cp_parser_class_specifier_1): Handle constraints. (cp_parser_template_declaration_after_parameters): Split out from cp_parser_template_declaration_after_export. (cp_parser_single_declaration): Handle constraints. (synthesize_implicit_template_parm): Handle constraints. (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_introduction_list, get_id_declarator) (get_unqualified_id, is_constrained_parameter) (cp_parser_check_constrained_type_parm) (cp_parser_constrained_type_template_parm) (cp_parser_constrained_template_template_parm) (constrained_non_type_template_parm, finish_constrained_parameter) (declares_constrained_type_template_parameter) (declares_constrained_template_template_parameter) (check_type_concept, cp_parser_maybe_constrained_type_specifier) (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id) (cp_parser_requires_clause, cp_parser_requires_clause_opt) (cp_parser_requires_expression) (cp_parser_requirement_parameter_list, cp_parser_requirement_body) (cp_parser_requirement_list, cp_parser_requirement) (cp_parser_simple_requirement, cp_parser_type_requirement) (cp_parser_compound_requirement, cp_parser_nested_requirement) (cp_parser_template_introduction) (cp_parser_explicit_template_declaration) (get_concept_from_constraint): New. * pt.c (local_specialization_stack): Implement. (maybe_new_partial_specialization): New. (maybe_process_partial_specialization): Use it. (retrieve_local_specialization, register_local_specialization) (template_parm_to_arg, build_template_decl, extract_fnparm_pack) (tsubst_expr): No longer static. (spec_hasher::equal): Compare constraints. (determine_specialization): Handle constraints. (check_explicit_specialization): Handle concepts. (process_template_parm): Handle constraints. (end_template_parm_list): Add overload taking no arguments. (process_partial_specialization): Handle concepts and constraints. Register partial specializations of variable templates. (redeclare_class_template): Handle constraints. (convert_template_argument): Handle WILDCARD_DECL. Check is_compatible_template_arg. (coerce_template_parameter_pack): Handle wildcard packs. (coerce_template_parms): DR 1430 also applies to concepts. Add overloads taking fewer parameters. (lookup_template_class_1): Handle constraints. (lookup_template_variable): Concepts are always bool. (finish_template_variable): Handle concepts and constraints. (tsubst_friend_class): Handle constraints. (gen_elem_of_pack_expansion_instantiation): Handle constraints. (tsubst_pack_expansion): Handle local parameters. (tsubst_decl) [FUNCTION_DECL]: Handle constraints. (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints. (tsubst_copy_and_build): Handle REQUIRES_EXPR. (more_specialized_fn, more_specialized_partial_spec): Check constraints. (more_specialized_inst): Split out from most_specialized_instantiation. (most_specialized_partial_spec): Check constraints. (instantiate_decl): Never instantiate a concept. (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ, variable concepts. (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR. (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts. (do_auto_deduction): Add overload taking tsubst flags and context enum. Handle constraints. (get_template_for_ordering, most_constrained_function) (is_compatible_template_arg, convert_wildcard_argument) (struct constr_entry, struct constr_hasher, decl_constraints) (valid_constraints_p, get_constraints, set_constraints) (remove_constraints, init_constraint_processing): New. * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO. * search.c (lookup_member): Do lookup in the open partial instantiation. * semantics.c (finish_template_template_parm): Handle constraints. (fixup_template_type): New. (finish_template_type): Call it. (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS. * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO. (cp_walk_subtrees): Handle REQUIRES_EXPR. * typeck.c (cp_build_function_call_vec): Check constraints. Co-Authored-By: Braden Obrzut <admin@maniacsvault.net> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r226713
2015-08-07 07:44:49 +02:00
default:
gcc_unreachable ();
}
}
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
typedef c_pretty_print_fn pp_fun;
/* Initialization of a C++ pretty-printer object. */
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
2013-08-22 12:14:46 +02:00
cxx_pretty_printer::cxx_pretty_printer ()
: c_pretty_printer (),
enclosing_scope (global_namespace)
pretty-print.h (pp_maybe_newline_and_indent): New macro. * pretty-print.h (pp_maybe_newline_and_indent): New macro. * c-pretty-print.h (c_pretty_printer): Now typedef to the structure. Be consistent with pretty-print.h abd cxx-pretty-print.h (struct c_pretty_print_info): Document. Add new fields. (pp_type_specifier_seq): Rename from pp_c_type_specifier. (pp_direct_abstract_declarator): New macro. (pp_ptr_operator): Likewise. (pp_simple_type_specifier): Likewise. (pp_expression): Likewise. (pp_parameter_list): Rename from pp_parameter_declaration. * c-pretty-print.c (pp_c_whitespace): Now a function. (pp_c_left_paren): Likewise. (pp_c_right_paren): Likewise. (pp_c_dot): Likewise. (pp_c_ampersand): Likewise. (pp_c_arrow): Likewise. (pp_c_semicolon): Likewise. (pp_c_type_cast): New function. (pp_c_space_for_pointer_operator): Likewise. (pp_c_call_argument_list): Likewise. (pp_c_cv_qualifier): Adjust prototype. (pp_c_type_qualifier_list): Likewise. (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. Adjust to follow standard grammar. (pp_c_specifier_qualifier_list): Adjusr prototype. Handle REFERENCE_TYPE. Tidy. (pp_c_parameter_type_list): Adjust prototype. Tidy. (pp_c_parameter_declaration): Remove. (pp_c_abstract_declarator): Adjust prototype. (pp_c_direct_abstract_declarator): Likewise. (pp_c_type_id): Likewise. (pp_c_storage_class_specifier): Likewise. (pp_c_function_specifier): Likewise. (pp_c_declaration_specifiers): Likewise. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_declaration): Likewise. (pp_c_attributes): Likewise. Tidy. (pp_c_function_definition): Adjust prototype. (pp_c_char): Likewise. (pp_c_string_literal): Likewise. (pp_c_integer_constant): Likewise. (pp_c_character_constant): Likewise. (pp_c_bool_constant): Likewise. (pp_c_enumeration_constant): Likewise. (pp_c_floating_constant): Likewise. (pp_c_constant): Likewise. (pp_c_identifier): Likewise. (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. (pp_c_initializer): Adjust prototype. (pp_c_init_declarator): Likewise. (pp_c_initializer_list): Likewise. (pp_c_id_expression): Likewise. (pp_c_postfix_expression): Likewise. (pp_c_expression_list): Likewise. (pp_c_unary_expression): Likewise. (pp_c_cast_expression): Likewise. (pp_c_multiplicative_expression): Likewise. (pp_c_additive_expression): Likewise. (pp_c_shift_expression): Likewise. (pp_c_relational_expression): Likewise. (pp_c_equality_expression): Likewise. (pp_c_and_expression): Likewise. (pp_c_exclusive_or_expression): Likewise. (pp_c_inclusive_or_expression): Likewise. (pp_c_logical_and_expression): Likewise. (pp_c_logical_or_expression): Likewise. (pp_c_conditional_expression): Likewise. (pp_c_assignment_expression): Likewise. (pp_c_expression): Likewise. Tidy. (pp_c_statement): Likewise. Document. (pp_c_pretty_printer_init): Adjust prototype. Tidy. * c-lang.c (c_initialize_diagnostics): Update. * c-common.h (strip_pointer_operator): Declare. * c-common.c (strip_pointer_operator): Define. cp/ * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. (cxx_pretty_printer): Adjust base type. (pp_cxx_function_specifier): Declare. * cxx-pretty-print.c (pp_cxx_whitespace): New macro. (pp_cxx_left_paren): Likewise. (pp_cxx_right_paren): Likewise. (pp_cxx_dot): Likewise. (pp_cxx_arrow): Likewise. (pp_cxx_semicolon): Likewise. (pp_cxx_identifier): Likewise. (pp_cxx_cv_qualifier_seq): Likewise. (pp_cxx_storage_class_specifier): Likewise. (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_nonconsecutive_character): Tidy. (pp_cxx_conversion_function_id): New function. (pp_cxx_template_id): Likewise. (pp_cxx_class_name): Likewise. (pp_cxx_template_keyword_if_needed): Likewise. (pp_cxx_nested_name_specifier): Likewise. (pp_cxx_unqualified_id): Tidy (pp_cxx_qualified_id): Handle more nodes. (pp_cxx_primary_expression): Tidy. (pp_cxx_postfix_expression): Likewise. (pp_cxx_new_expression): Tidy. (pp_cxx_delete_expression): Likewise. (pp_cxx_cast_expression): New function. (pp_cxx_pm_expression): Tidy. (pp_cxx_conditional_expression): Likewise. (pp_cxx_assignment_operator): New function. (pp_cxx_assignment_expression): Tidy. (pp_cxx_expression): New function. (pp_cxx_function_specifier): Likewise. (pp_cxx_decl_specifier_seq): Likewise. (pp_cxx_simple_type_specifier): Tidy. (pp_cxx_type_specifier_seq): Likewise. (pp_cxx_ptr_operator): New function. (pp_cxx_implicit_parameter_type): Likewise. (pp_cxx_parameter_declaration): Tidy. (pp_cxx_parameter_declaration_clause): New function. (pp_cxx_exception_specification): Likewise. (pp_cxx_direct_declarator): Tidy. (pp_cxx_declarator): Likewise. (pp_cxx_ctor_initializer): New function. (pp_cxx_function_definition): Likewise. (pp_cxx_abstract_declarator): Tidy. (pp_cxx_direct_abstract_declarator): Likewise. (pp_cxx_type_id): Likewise. (pp_cxx_exception_declaration): New function. (pp_cxx_statement): Likewise. (pp_cxx_simple_declaration): Likewise. (pp_cxx_template_parameter_list): Likewise. (pp_cxx_template_parameter): Likewise. (pp_cxx_template_declaration): Likewise. (pp_cxx_explicit_specialization): Likewise. (pp_cxx_explicit_instantiation): Likewise. (pp_cxx_declaration): Tidy. (pp_cxx_pretty_printer_init): Initialize more fields. From-SVN: r70777
2003-08-25 21:10:50 +02:00
{
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
2013-08-22 12:14:46 +02:00
type_specifier_seq = (pp_fun) pp_cxx_type_specifier_seq;
parameter_list = (pp_fun) pp_cxx_parameter_declaration_clause;
pretty-print.h (pp_set_line_maximum_length): Make macro. * pretty-print.h (pp_set_line_maximum_length): Make macro. (pp_set_prefix): Likewise. (pp_destroy_prefix): Likewise. (pp_remaining_character_count_for_line): Likewise. (pp_clear_output_area): Likewise. (pp_formatted_text): Likewise. (pp_last_position_in_text): Likewise. (pp_emit_prefix): Likewise. (pp_append_text): Likewise. (pp_flush): Likewise. (pp_format_text): Likewise. (pp_format_verbatim): Likewise. (pp_tree_identifier): Tidy. * pretty-print.c (pp_base_format_text): Rename from pp_format_text. (pp_base_format_verbatim): Rename from pp_format_verbatim. (pp_base_flush): Rename from pp_flush. (pp_base_set_line_maximum_length): Rename from pp_set_line_maximum_length. (pp_base_clear_output_area): Rename from pp_clear_output_area. (pp_base_set_prefix): Rename from pp_set_prefix. (pp_base_destroy_prefix): Rename from pp_destroy_prefix. (pp_base_emit_prefix): Rename from pp_emit_prefix. (pp_base_append_text): Rename from pp_append_text. (pp_base_formatted_text): Rename from pp_formatted_text. (pp_base_last_position_in_text): Rename from pp_last_position_in_text. (pp_base_remaining_character_count_for_line): Rename from pp_remaining_character_count_for_line. * diagnostic.h (diagnostic_format_decoder): Tidy. (diagnostic_flush_buffer): Likewise. * c-pretty-print.h: (pp_c_string_literal): Declare. (pp_c_real_literal): Likewise. (pp_c_integer_literal): Likewise. * c-pretty-print.c (pp_c_char): Use pp_string in lieu of pp_identifier. (pp_c_character_literal): Tidy. (pp_c_string_literal): Make public. (pp_c_bool_literal): Likewise. (pp_c_integer_literal): Likewise. (pp_c_real_literal): Likewise. * Makefile.in (C_PRETTY_PRINT_H): New variable. (c-pretty-print.o): Update dependence. cp/ * cxx-pretty-print.h: New file. * cxx-pretty-print.c: Likewise. * error.c (scratch_pretty_printer): Change type. (init_error): Tidy. (dump_aggr_type): Likewise. (dump_global_iord): Likewise. (dump_expr): Likewise. (dump_char): Remove. * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. (cxx_initialize_diagnostics): New function. * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o (CXX_PRETTY_PRINT_H): New variable. (cp/cxx-pretty-print.o): New rule. (cp/cp-lang.o): Update dependence. (cp/error.o): Likewise. From-SVN: r70182
2003-08-05 21:23:14 +02:00
}