summaryrefslogtreecommitdiff
path: root/gcc/c-lang.c
diff options
context:
space:
mode:
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-10 18:17:06 +0000
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-10 18:17:06 +0000
commitbfdec0d1361ff370dfd86bbcbb16077eafaca5c3 (patch)
tree6b4733cd709d9969e774e038f5d1924ffe164466 /gcc/c-lang.c
parentcd81f692b24d2a1fa8388e7b53e3644a0d90e9d8 (diff)
downloadgcc-bfdec0d1361ff370dfd86bbcbb16077eafaca5c3.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70299 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-lang.c')
-rw-r--r--gcc/c-lang.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/c-lang.c b/gcc/c-lang.c
index d998e197278..6504501559f 100644
--- a/gcc/c-lang.c
+++ b/gcc/c-lang.c
@@ -30,6 +30,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "langhooks.h"
#include "langhooks-def.h"
+#include "diagnostic.h"
+#include "c-pretty-print.h"
+
+static void c_initialize_diagnostics (diagnostic_context *);
enum c_language_kind c_language = clk_c;
@@ -43,6 +47,8 @@ enum c_language_kind c_language = clk_c;
#define LANG_HOOKS_FINISH c_common_finish
#undef LANG_HOOKS_INIT_OPTIONS
#define LANG_HOOKS_INIT_OPTIONS c_common_init_options
+#undef LANG_HOOKS_INITIALIZE_DIAGNOSTITCS
+#define LANG_HOOKS_INITIALIZE_DIAGNOSTITCS c_initialize_diagnostics
#undef LANG_HOOKS_HANDLE_OPTION
#define LANG_HOOKS_HANDLE_OPTION c_common_handle_option
#undef LANG_HOOKS_MISSING_ARGUMENT
@@ -218,4 +224,18 @@ finish_file (void)
c_objc_common_finish_file ();
}
+static void
+c_initialize_diagnostics (diagnostic_context *context)
+{
+ pretty_printer *base = context->printer;
+ c_pretty_printer pp = xmalloc (sizeof *pp);
+ memcpy (pp_base (pp), base, sizeof (pretty_printer));
+ pp_c_pretty_printer_init (pp);
+ context->printer = (pretty_printer *) pp;
+
+ /* It is safe to free this object because it was previously malloc()'d. */
+ free (base);
+}
+
+
#include "gtype-c.h"