diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2001-11-09 23:30:44 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-11-09 23:30:44 +0000 |
commit | 5d69f816bcfd32f2171b31e09249a8e03acedd5e (patch) | |
tree | e6f8ec22684d9ab1170005e35598dd4cc7f86de1 /gcc | |
parent | 1ee9fb202a1be3e3259935c243242fa6ffa5f62d (diff) | |
download | gcc-5d69f816bcfd32f2171b31e09249a8e03acedd5e.zip gcc-5d69f816bcfd32f2171b31e09249a8e03acedd5e.tar.gz gcc-5d69f816bcfd32f2171b31e09249a8e03acedd5e.tar.bz2 |
Makefile.in: Update.
* Makefile.in: Update.
* c-decl.c (print_lang_decl, print_lang_type): Remove.
(print_lang_identifier): Rename c_print_identifier.
* c-lang.c (LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New.
(print_lang_statistics, lang_print_xnode): Remove.
* c-parse.in (set_yydebug): Rename c_set_yydebug.
* c-tree.h (c_set_yydebug, c_print_identifier): New.
* langhooks-def.h (lhd_print_tree_nothing, lhd_set_yydebug): New.
LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New.
(LANG_HOOKS_INITIALIZER): Update.
* langhooks.h (struct lang_hooks): New members.
(lang_print_tree_hook): New.
* langhooks.c (lhd_print_tree_nothing, lhd_set_yydebug): New.
* print-tree.c: Include langhooks.h.
(print_node): Update.
* toplev.c (decode_d_option): Update.
* tree.c: Include langhooks.h.
(dump_tree_statistics): Update.
* tree.h (print_lang_statistics, print_lang_decl, print_lang_type,
print_lang_identifier, set_yydebug, lang_print_xnode): Remove.
ada:
* misc.c (gnat_print_decl, gnat_print_type): Renamed.
(LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE): Override.
(print_lang_statistics, lang_print_xnode, print_lang_identifier,
set_yydebug): Remove.
cp:
* cp-lang.c (LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): Override.
* cp-tree.h (print_class_statistics): Remove.
(cxx_print_statistics, cxx_print_xnode, cxx_print_decl, cxx_print_type,
cxx_print_identifier, cxx_set_yydebug): New.
* lex.c (set_yydebug): Rename c_set_yydebug.
* ptree.c (print_lang_decl, print_lang_type, print_lang_identifier,
lang_print_xnode): Rename.
* tree.c (print_lang_statistics): Rename.
f:
* com.c (ffe_print_identifier): Rename.
(LANG_HOOKS_PRINT_IDENTIFIER): Override.
(lang_print_xnode, print_lang_decl, print_lang_statistics,
print_lang_type, set_yydebug): Remove.
java:
* java-tree.h (java_set_yydebug): New.
* jcf-parse.c (set_yydebug): Rename java_set_yydebug.
* lang.c (LANG_HOOKS_SET_YYDEBUG): Override.
(print_lang_decl, print_lang_type, print_lang_identifier,
print_lang_statistics, lang_print_xnode): Remove.
objc:
* objc-act.c (LANG_HOOKS_PRINT_IDENTIFIER,
LANG_HOOKS_SET_YYDEBUG): Override.
(lang_print_xnode, print_lang_statistics): Remove.
From-SVN: r46907
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 29 | ||||
-rw-r--r-- | gcc/Makefile.in | 5 | ||||
-rw-r--r-- | gcc/ada/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ada/misc.c | 45 | ||||
-rw-r--r-- | gcc/c-decl.c | 20 | ||||
-rw-r--r-- | gcc/c-lang.c | 19 | ||||
-rw-r--r-- | gcc/c-parse.in | 2 | ||||
-rw-r--r-- | gcc/c-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/cp/cp-lang.c | 12 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 7 | ||||
-rw-r--r-- | gcc/cp/lex.c | 2 | ||||
-rw-r--r-- | gcc/cp/ptree.c | 8 | ||||
-rw-r--r-- | gcc/cp/tree.c | 2 | ||||
-rw-r--r-- | gcc/f/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/f/com.c | 50 | ||||
-rw-r--r-- | gcc/java/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/java/java-tree.h | 1 | ||||
-rw-r--r-- | gcc/java/jcf-parse.c | 2 | ||||
-rw-r--r-- | gcc/java/lang.c | 43 | ||||
-rw-r--r-- | gcc/langhooks-def.h | 14 | ||||
-rw-r--r-- | gcc/langhooks.c | 20 | ||||
-rw-r--r-- | gcc/langhooks.h | 22 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 19 | ||||
-rw-r--r-- | gcc/print-tree.c | 9 | ||||
-rw-r--r-- | gcc/toplev.c | 2 | ||||
-rw-r--r-- | gcc/tree.c | 3 | ||||
-rw-r--r-- | gcc/tree.h | 13 |
28 files changed, 187 insertions, 199 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4a8a99e..6b78f4f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,32 @@ +2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk> + + * Makefile.in: Update. + * c-decl.c (print_lang_decl, print_lang_type): Remove. + (print_lang_identifier): Rename c_print_identifier. + * c-lang.c (LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New. + (print_lang_statistics, lang_print_xnode): Remove. + * c-parse.in (set_yydebug): Rename c_set_yydebug. + * c-tree.h (c_set_yydebug, c_print_identifier): New. + * langhooks-def.h (lhd_print_tree_nothing, lhd_set_yydebug): New. + LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE, + LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE, + LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (struct lang_hooks): New members. + (lang_print_tree_hook): New. + * langhooks.c (lhd_print_tree_nothing, lhd_set_yydebug): New. + * print-tree.c: Include langhooks.h. + (print_node): Update. + * toplev.c (decode_d_option): Update. + * tree.c: Include langhooks.h. + (dump_tree_statistics): Update. + * tree.h (print_lang_statistics, print_lang_decl, print_lang_type, + print_lang_identifier, set_yydebug, lang_print_xnode): Remove. +objc: + * objc-act.c (LANG_HOOKS_PRINT_IDENTIFIER, + LANG_HOOKS_SET_YYDEBUG): Override. + (lang_print_xnode, print_lang_statistics): Remove. + 2001-11-09 Richard Henderson <rth@redhat.com> * dwarf2asm.c (dw2_force_const_mem): Invoke STRIP_NAME_ENCODING diff --git a/gcc/Makefile.in b/gcc/Makefile.in index f3caa03..2e9d3fe 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1349,12 +1349,13 @@ convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h convert.h toplev. langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) toplev.h \ tree-inline.h $(RTL_H) insn-config.h integrate.h langhooks.h langhooks-def.h tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h function.h toplev.h \ - $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) + $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \ expr.h flags.h params.h input.h insn-config.h $(INTEGRATE_H) \ $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h langhooks.h \ $(C_COMMON_H) tree-inline.h -print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GGC_H) +print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GGC_H) \ + langhooks.h stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h \ function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) $(TM_P_H) fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h \ diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 07645b0..dafcd0e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,12 @@ 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk> + * misc.c (gnat_print_decl, gnat_print_type): Renamed. + (LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE): Override. + (print_lang_statistics, lang_print_xnode, print_lang_identifier, + set_yydebug): Remove. + +2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk> + * misc.c (LANG_HOOKS_NAME, LANG_HOOKS_IDENTIFIER_SIZE): Override. (struct lang_hooks): Constify. (language_string, lang_identify): Remove. diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index f6ad45b..3a33494 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * * * Copyright (C) 1992-2001 Free Software Foundation, Inc. * * * @@ -113,6 +113,8 @@ static void gnat_init PARAMS ((void)); static void gnat_init_options PARAMS ((void)); static int gnat_decode_option PARAMS ((int, char **)); static HOST_WIDE_INT gnat_get_alias_set PARAMS ((tree)); +static void gnat_print_decl PARAMS ((FILE *, tree, int)); +static void gnat_print_type PARAMS ((FILE *, tree, int)); /* Structure giving our language-specific hooks. */ @@ -130,6 +132,10 @@ static HOST_WIDE_INT gnat_get_alias_set PARAMS ((tree)); #define LANG_HOOKS_HONOR_READONLY 1 #undef LANG_HOOKS_GET_ALIAS_SET #define LANG_HOOKS_GET_ALIAS_SET gnat_get_alias_set +#undef LANG_HOOKS_PRINT_DECL +#define LANG_HOOKS_PRINT_DECL gnat_print_decl +#undef LANG_HOOKS_PRINT_TYPE +#define LANG_HOOKS_PRINT_TYPE gnat_print_type const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; @@ -372,20 +378,6 @@ maybe_build_cleanup (decl) return NULL_TREE; } -/* Print any language-specific compilation statistics. */ - -void -print_lang_statistics () -{} - -void -lang_print_xnode (file, node, indent) - FILE *file ATTRIBUTE_UNUSED; - tree node ATTRIBUTE_UNUSED; - int indent ATTRIBUTE_UNUSED; -{ -} - /* integrate_decl_tree calls this function, but since we don't use the DECL_LANG_SPECIFIC field, this is a no-op. */ @@ -397,8 +389,8 @@ copy_lang_decl (node) /* Hooks for print-tree.c: */ -void -print_lang_decl (file, node, indent) +static void +gnat_print_decl (file, node, indent) FILE *file; tree node; int indent; @@ -420,8 +412,8 @@ print_lang_decl (file, node, indent) } } -void -print_lang_type (file, node, indent) +static void +gnat_print_type (file, node, indent) FILE *file; tree node; int indent; @@ -472,13 +464,6 @@ print_lang_type (file, node, indent) } } -void -print_lang_identifier (file, node, indent) - FILE *file ATTRIBUTE_UNUSED; - tree node ATTRIBUTE_UNUSED; - int indent ATTRIBUTE_UNUSED; -{} - /* Expands GNAT-specific GCC tree nodes. The only ones we support here are TRANSFORM_EXPR, UNCHECKED_CONVERT_EXPR, ALLOCATE_EXPR, USE_EXPR and NULL_EXPR. */ @@ -900,14 +885,6 @@ finish_parse () { } -/* Sets some debug flags for the parsed. It does nothing here. */ - -void -set_yydebug (value) - int value ATTRIBUTE_UNUSED; -{ -} - #if 0 /* Return the alignment for GNAT_TYPE. */ diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 0440bba..8f8edf4 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -789,26 +789,8 @@ c_decode_option (argc, argv) return 1; } -/* Hooks for print_node. */ - -void -print_lang_decl (file, node, indent) - FILE *file ATTRIBUTE_UNUSED; - tree node ATTRIBUTE_UNUSED; - int indent ATTRIBUTE_UNUSED; -{ -} - -void -print_lang_type (file, node, indent) - FILE *file ATTRIBUTE_UNUSED; - tree node ATTRIBUTE_UNUSED; - int indent ATTRIBUTE_UNUSED; -{ -} - void -print_lang_identifier (file, node, indent) +c_print_identifier (file, node, indent) FILE *file; tree node; int indent; diff --git a/gcc/c-lang.c b/gcc/c-lang.c index b3d9094..67c860b 100644 --- a/gcc/c-lang.c +++ b/gcc/c-lang.c @@ -61,6 +61,10 @@ static int c_cannot_inline_tree_fn PARAMS ((tree *)); #define LANG_HOOKS_POST_OPTIONS c_post_options #undef LANG_HOOKS_GET_ALIAS_SET #define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set +#undef LANG_HOOKS_PRINT_IDENTIFIER +#define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier +#undef LANG_HOOKS_SET_YYDEBUG +#define LANG_HOOKS_SET_YYDEBUG c_set_yydebug #undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN #define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \ @@ -134,21 +138,6 @@ c_init () c_parse_init (); } -void -print_lang_statistics () -{ -} - -/* used by print-tree.c */ - -void -lang_print_xnode (file, node, indent) - FILE *file ATTRIBUTE_UNUSED; - tree node ATTRIBUTE_UNUSED; - int indent ATTRIBUTE_UNUSED; -{ -} - /* Used by c-lex.c, but only for objc. */ tree diff --git a/gcc/c-parse.in b/gcc/c-parse.in index f458e03..41208c3 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -3784,7 +3784,7 @@ yylex() in order to build the compiler. */ void -set_yydebug (value) +c_set_yydebug (value) int value; { #if YYDEBUG != 0 diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 91d98b7..acde94e 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -155,12 +155,14 @@ extern tree lookup_objc_ivar PARAMS ((tree)); /* in c-parse.in */ extern void c_parse_init PARAMS ((void)); +extern void c_set_yydebug PARAMS ((int)); extern int yyparse_1 PARAMS ((void)); /* in c-aux-info.c */ extern void gen_aux_info_record PARAMS ((tree, int, int, int)); /* in c-decl.c */ +extern void c_print_identifier PARAMS ((FILE *, tree, int)); extern tree build_array_declarator PARAMS ((tree, tree, int, int)); extern tree build_enumerator PARAMS ((tree, tree)); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a98e62b..78588d7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,16 @@ +2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk> + + * cp-lang.c (LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE, + LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE, + LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): Override. + * cp-tree.h (print_class_statistics): Remove. + (cxx_print_statistics, cxx_print_xnode, cxx_print_decl, cxx_print_type, + cxx_print_identifier, cxx_set_yydebug): New. + * lex.c (set_yydebug): Rename c_set_yydebug. + * ptree.c (print_lang_decl, print_lang_type, print_lang_identifier, + lang_print_xnode): Rename. + * tree.c (print_lang_statistics): Rename. + 2001-11-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * class.c (dump_array): Fix format specifier warning. diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index cd951da..08ecf5b 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -45,6 +45,18 @@ static HOST_WIDE_INT cxx_get_alias_set PARAMS ((tree)); #define LANG_HOOKS_POST_OPTIONS cxx_post_options #undef LANG_HOOKS_GET_ALIAS_SET #define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set +#undef LANG_HOOKS_PRINT_STATISTICS +#define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics +#undef LANG_HOOKS_PRINT_XNODE +#define LANG_HOOKS_PRINT_XNODE cxx_print_xnode +#undef LANG_HOOKS_PRINT_DECL +#define LANG_HOOKS_PRINT_DECL cxx_print_decl +#undef LANG_HOOKS_PRINT_TYPE +#define LANG_HOOKS_PRINT_TYPE cxx_print_type +#undef LANG_HOOKS_PRINT_IDENTIFIER +#define LANG_HOOKS_PRINT_IDENTIFIER cxx_print_identifier +#undef LANG_HOOKS_SET_YYDEBUG +#define LANG_HOOKS_SET_YYDEBUG cxx_set_yydebug #undef LANG_HOOKS_TREE_INLINING_WALK_SUBTREES #define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES \ diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f58e2154..d4f3341 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3530,7 +3530,12 @@ extern int current_lang_depth PARAMS ((void)); extern void push_lang_context PARAMS ((tree)); extern void pop_lang_context PARAMS ((void)); extern tree instantiate_type PARAMS ((tree, tree, enum instantiate_type_flags)); -extern void print_class_statistics PARAMS ((void)); +extern void cxx_print_statistics PARAMS ((void)); +extern void cxx_print_xnode PARAMS ((FILE *, tree, int)); +extern void cxx_print_decl PARAMS ((FILE *, tree, int)); +extern void cxx_print_type PARAMS ((FILE *, tree, int)); +extern void cxx_print_identifier PARAMS ((FILE *, tree, int)); +extern void cxx_set_yydebug PARAMS ((int)); extern void build_self_reference PARAMS ((void)); extern int same_signature_p PARAMS ((tree, tree)); extern void warn_hidden PARAMS ((tree)); diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 0076586..f5fdc0f 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -907,7 +907,7 @@ print_parse_statistics () in order to build the compiler. */ void -set_yydebug (value) +cxx_set_yydebug (value) int value; { #if YYDEBUG != 0 diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c index 8f2f577..f40e412 100644 --- a/gcc/cp/ptree.c +++ b/gcc/cp/ptree.c @@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */ #include "cp-tree.h" void -print_lang_decl (file, node, indent) +cxx_print_decl (file, node, indent) FILE *file; tree node; int indent; @@ -66,7 +66,7 @@ print_lang_decl (file, node, indent) } void -print_lang_type (file, node, indent) +cxx_print_type (file, node, indent) FILE *file; register tree node; int indent; @@ -158,7 +158,7 @@ print_lang_type (file, node, indent) } void -print_lang_identifier (file, node, indent) +cxx_print_identifier (file, node, indent) FILE *file; tree node; int indent; @@ -173,7 +173,7 @@ print_lang_identifier (file, node, indent) } void -lang_print_xnode (file, node, indent) +cxx_print_xnode (file, node, indent) FILE *file; tree node; int indent; diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 23c5ce8..97ae231 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1276,7 +1276,7 @@ extern int depth_reached; #endif void -print_lang_statistics () +cxx_print_statistics () { print_search_statistics (); print_class_statistics (); diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 1682f3e..d1b4d75 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,10 @@ +Fri Nov 9 23:16:45 2001 Neil Booth <neil@daikokuya.demon.co.uk> + + * com.c (ffe_print_identifier): Rename. + (LANG_HOOKS_PRINT_IDENTIFIER): Override. + (lang_print_xnode, print_lang_decl, print_lang_statistics, + print_lang_type, set_yydebug): Remove. + 2001-11-09 Zack Weinberg <zack@codesourcery.com> * g77spec.c (lang_specific_driver): Adjust behavior of -v and diff --git a/gcc/f/com.c b/gcc/f/com.c index 79eadef..ae4201d 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -14256,6 +14256,7 @@ insert_block (block) static void ffe_init PARAMS ((void)); static void ffe_finish PARAMS ((void)); static void ffe_init_options PARAMS ((void)); +static void ffe_print_identifier PARAMS ((FILE *, tree, int)); #undef LANG_HOOKS_NAME #define LANG_HOOKS_NAME "GNU F77" @@ -14267,6 +14268,8 @@ static void ffe_init_options PARAMS ((void)); #define LANG_HOOKS_INIT_OPTIONS ffe_init_options #undef LANG_HOOKS_DECODE_OPTION #define LANG_HOOKS_DECODE_OPTION ffe_decode_option +#undef LANG_HOOKS_PRINT_IDENTIFIER +#define LANG_HOOKS_PRINT_IDENTIFIER ffe_print_identifier /* We do not wish to use alias-set based aliasing at all. Used in the extreme (every object with its own set, with equivalences recorded) it @@ -14278,16 +14281,6 @@ static void ffe_init_options PARAMS ((void)); const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; -/* used by print-tree.c */ - -void -lang_print_xnode (file, node, indent) - FILE *file UNUSED; - tree node UNUSED; - int indent UNUSED; -{ -} - static void ffe_finish () { @@ -14542,16 +14535,8 @@ poplevel (keep, reverse, functionbody) return block; } -void -print_lang_decl (file, node, indent) - FILE *file UNUSED; - tree node UNUSED; - int indent UNUSED; -{ -} - -void -print_lang_identifier (file, node, indent) +static void +ffe_print_identifier (file, node, indent) FILE *file; tree node; int indent; @@ -14560,19 +14545,6 @@ print_lang_identifier (file, node, indent) print_node (file, "local", IDENTIFIER_LOCAL_VALUE (node), indent + 4); } -void -print_lang_statistics () -{ -} - -void -print_lang_type (file, node, indent) - FILE *file UNUSED; - tree node UNUSED; - int indent UNUSED; -{ -} - /* Record a decl-node X as belonging to the current lexical scope. Check for errors (such as an incompatible declaration for the same name already seen in the same scope). @@ -14762,18 +14734,6 @@ set_block (block) BLOCK_SUBBLOCKS (block)); } -/* ~~gcc/tree.h *should* declare this, because toplev.c references it. */ - -/* Can't 'yydebug' a front end not generated by yacc/bison! */ - -void -set_yydebug (value) - int value; -{ - if (value) - fprintf (stderr, "warning: no yacc/bison-generated output to debug!\n"); -} - tree signed_or_unsigned_type (unsignedp, type) int unsignedp; diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 2846659..1588521 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,5 +1,13 @@ 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk> + * java-tree.h (java_set_yydebug): New. + * jcf-parse.c (set_yydebug): Rename java_set_yydebug. + * lang.c (LANG_HOOKS_SET_YYDEBUG): Override. + (print_lang_decl, print_lang_type, print_lang_identifier, + print_lang_statistics, lang_print_xnode): Remove. + +2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk> + * jcf-parse.c (init_lex): Remove. * lang.c (language_string, lang_identify): Remove. (struct lang_hooks): Constify. diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 132cd71..d9417b4 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -996,6 +996,7 @@ struct lang_type #define JCF_u4 unsigned long #define JCF_u2 unsigned short +extern void java_set_yydebug PARAMS ((int)); extern void add_assume_compiled PARAMS ((const char *, int)); extern tree lookup_class PARAMS ((tree)); extern tree lookup_java_constructor PARAMS ((tree, tree)); diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 6190cf3..ec76e81 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -262,7 +262,7 @@ parse_signature (jcf, sig_index) } void -set_yydebug (value) +java_set_yydebug (value) int value; { yydebug = value; diff --git a/gcc/java/lang.c b/gcc/java/lang.c index feeb89a..9ba1849 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -203,6 +203,8 @@ static int dependency_tracking = 0; #define LANG_HOOKS_INIT_OPTIONS java_init_options #undef LANG_HOOKS_DECODE_OPTION #define LANG_HOOKS_DECODE_OPTION java_decode_option +#undef LANG_HOOKS_SET_YYDEBUG +#define LANG_HOOKS_SET_YYDEBUG java_set_yydebug /* Each front end provides its own. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; @@ -741,44 +743,3 @@ java_init_options () flag_exceptions = 1; flag_non_call_exceptions = 1; } - -/* Hooks for print_node. */ - -void -print_lang_decl (file, node, indent) - FILE *file __attribute ((__unused__)); - tree node __attribute ((__unused__)); - int indent __attribute ((__unused__)); -{ -} - -void -print_lang_type (file, node, indent) - FILE *file __attribute ((__unused__)); - tree node __attribute ((__unused__)); - int indent __attribute ((__unused__)); -{ -} - -void -print_lang_identifier (file, node, indent) - FILE *file __attribute ((__unused__)); - tree node __attribute ((__unused__)); - int indent __attribute ((__unused__)); -{ -} - -void -print_lang_statistics () -{ -} - -/* used by print-tree.c */ - -void -lang_print_xnode (file, node, indent) - FILE *file __attribute ((__unused__)); - tree node __attribute ((__unused__)); - int indent __attribute ((__unused__)); -{ -} diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index 340efdd..ef76751 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -41,6 +41,8 @@ extern void lhd_do_nothing PARAMS ((void)); extern int lhd_decode_option PARAMS ((int, char **)); extern HOST_WIDE_INT lhd_get_alias_set PARAMS ((tree)); extern void lhd_clear_binding_stack PARAMS ((void)); +extern void lhd_print_tree_nothing PARAMS ((FILE *, tree, int)); +extern void lhd_set_yydebug PARAMS ((int)); /* Declarations of default tree inlining hooks. */ tree lhd_tree_inlining_walk_subtrees PARAMS ((tree *, int *, @@ -66,6 +68,12 @@ int lhd_tree_inlining_anon_aggr_type_p PARAMS ((tree)); #define LANG_HOOKS_POST_OPTIONS lhd_do_nothing #define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set #define LANG_HOOKS_HONOR_READONLY false +#define LANG_HOOKS_PRINT_STATISTICS lhd_do_nothing +#define LANG_HOOKS_PRINT_XNODE lhd_print_tree_nothing +#define LANG_HOOKS_PRINT_DECL lhd_print_tree_nothing +#define LANG_HOOKS_PRINT_TYPE lhd_print_tree_nothing +#define LANG_HOOKS_PRINT_IDENTIFIER lhd_print_tree_nothing +#define LANG_HOOKS_SET_YYDEBUG lhd_set_yydebug /* Tree inlining hooks. */ #define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES lhd_tree_inlining_walk_subtrees @@ -107,6 +115,12 @@ int lhd_tree_inlining_anon_aggr_type_p PARAMS ((tree)); LANG_HOOKS_POST_OPTIONS, \ LANG_HOOKS_GET_ALIAS_SET, \ LANG_HOOKS_HONOR_READONLY, \ + LANG_HOOKS_PRINT_STATISTICS, \ + LANG_HOOKS_PRINT_XNODE, \ + LANG_HOOKS_PRINT_DECL, \ + LANG_HOOKS_PRINT_TYPE, \ + LANG_HOOKS_PRINT_IDENTIFIER, \ + LANG_HOOKS_SET_YYDEBUG, \ LANG_HOOKS_TREE_INLINING_INITIALIZER \ } diff --git a/gcc/langhooks.c b/gcc/langhooks.c index a253af3..f2b9821 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -47,6 +47,26 @@ lhd_decode_option (argc, argv) return 0; } +/* Called from by print-tree.c. */ + +void +lhd_print_tree_nothing (file, node, indent) + FILE *file ATTRIBUTE_UNUSED; + tree node ATTRIBUTE_UNUSED; + int indent ATTRIBUTE_UNUSED; +{ +} + +/* Called when -dy is given on the command line. */ + +void +lhd_set_yydebug (value) + int value; +{ + if (value) + fprintf (stderr, "warning: no yacc/bison-generated output to debug!\n"); +} + /* Provide a default routine to clear the binding stack. This is used by languages that don't need to do anything special. */ void diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 5254afb..466b7ae 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -21,6 +21,9 @@ Boston, MA 02111-1307, USA. */ #ifndef GCC_LANG_HOOKS_H #define GCC_LANG_HOOKS_H +/* A print hook for print_tree (). */ +typedef void (*lang_print_tree_hook) PARAMS ((FILE *, tree, int indent)); + /* The following hooks are documented in langhooks.c. Must not be NULL. */ @@ -88,6 +91,25 @@ struct lang_hooks /* Nonzero if TYPE_READONLY and TREE_READONLY should always be honored. */ bool honor_readonly; + /* The front end can add its own statistics to -fmem-report with + this hook. It should output to stderr. */ + void (*print_statistics) PARAMS ((void)); + + /* Called by print_tree when there is a tree of class 'x' that it + doesn't know how to display. */ + lang_print_tree_hook print_xnode; + + /* Called to print language-dependent parts of a class 'd', class + 't', and IDENTIFIER_NODE nodes. */ + lang_print_tree_hook print_decl; + lang_print_tree_hook print_type; + lang_print_tree_hook print_identifier; + + /* Set yydebug for bison-based parsers, when -dy is given on the + command line. By default, if the parameter is non-zero, prints a + warning that the front end does not use such a parser. */ + void (*set_yydebug) PARAMS ((int)); + struct lang_hooks_for_tree_inlining tree_inlining; /* Whenever you add entries here, make sure you adjust langhooks.h diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index a4cbcdb..fa2842e 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -461,6 +461,10 @@ static int print_struct_values = 0; #define LANG_HOOKS_DECODE_OPTION objc_decode_option #undef LANG_HOOKS_POST_OPTIONS #define LANG_HOOKS_POST_OPTIONS objc_post_options +#undef LANG_HOOKS_PRINT_IDENTIFIER +#define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier +#undef LANG_HOOKS_SET_YYDEBUG +#define LANG_HOOKS_SET_YYDEBUG c_set_yydebug /* Each front end provides its own. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; @@ -640,16 +644,6 @@ objc_decode_option (argc, argv) return 1; } -/* used by print-tree.c */ - -void -lang_print_xnode (file, node, indent) - FILE *file ATTRIBUTE_UNUSED; - tree node ATTRIBUTE_UNUSED; - int indent ATTRIBUTE_UNUSED; -{ -} - static tree define_decl (declarator, declspecs) @@ -8333,11 +8327,6 @@ handle_impent (impent) assemble_zeros (UNITS_PER_WORD); } -void -print_lang_statistics () -{ -} - static void ggc_mark_imp_list (arg) void *arg; diff --git a/gcc/print-tree.c b/gcc/print-tree.c index f4476ba..51fad16 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -24,6 +24,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "system.h" #include "tree.h" #include "ggc.h" +#include "langhooks.h" /* Define the hash table of nodes already seen. Such nodes are not repeated; brief cross-references are used. */ @@ -442,7 +443,7 @@ print_node (file, prefix, node, indent) print_node (file, "result", DECL_RESULT_FLD (node), indent + 4); print_node_brief (file, "initial", DECL_INITIAL (node), indent + 4); - print_lang_decl (file, node, indent); + (*lang_hooks.print_decl) (file, node, indent); if (DECL_RTL_SET_P (node)) { @@ -574,7 +575,7 @@ print_node (file, prefix, node, indent) if (TYPE_CONTEXT (node)) print_node_brief (file, "context", TYPE_CONTEXT (node), indent + 4); - print_lang_type (file, node, indent); + (*lang_hooks.print_type) (file, node, indent); if (TYPE_POINTER_TO (node) || TREE_CHAIN (node)) indent_to (file, indent + 3); @@ -719,7 +720,7 @@ print_node (file, prefix, node, indent) break; case IDENTIFIER_NODE: - print_lang_identifier (file, node, indent); + (*lang_hooks.print_identifier) (file, node, indent); break; case TREE_LIST: @@ -742,7 +743,7 @@ print_node (file, prefix, node, indent) default: if (TREE_CODE_CLASS (TREE_CODE (node)) == 'x') - lang_print_xnode (file, node, indent); + (*lang_hooks.print_xnode) (file, node, indent); break; } diff --git a/gcc/toplev.c b/gcc/toplev.c index f6473e1..a542f43 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -4045,7 +4045,7 @@ decode_d_option (arg) rtl_dump_and_exit = 1; break; case 'y': - set_yydebug (1); + (*lang_hooks.set_yydebug) (1); break; case 'D': /* These are handled by the preprocessor. */ case 'I': @@ -45,6 +45,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "hashtab.h" #include "output.h" #include "target.h" +#include "langhooks.h" #define obstack_chunk_alloc xmalloc #define obstack_chunk_free free @@ -4424,7 +4425,7 @@ dump_tree_statistics () #endif print_obstack_statistics ("permanent_obstack", &permanent_obstack); print_type_hash_statistics (); - print_lang_statistics (); + (*lang_hooks.print_statistics) (); } #define FILE_FUNCTION_PREFIX_LEN 9 @@ -2956,13 +2956,7 @@ extern int lang_attribute_common; extern int mark_addressable PARAMS ((tree)); extern void incomplete_type_error PARAMS ((tree, tree)); -extern void print_lang_statistics PARAMS ((void)); extern tree truthvalue_conversion PARAMS ((tree)); -#ifdef BUFSIZ -extern void print_lang_decl PARAMS ((FILE *, tree, int)); -extern void print_lang_type PARAMS ((FILE *, tree, int)); -extern void print_lang_identifier PARAMS ((FILE *, tree, int)); -#endif extern int global_bindings_p PARAMS ((void)); extern void insert_block PARAMS ((tree)); @@ -2972,9 +2966,6 @@ extern void set_decl_abstract_flags PARAMS ((tree, int)); extern void output_inline_function PARAMS ((tree)); extern void set_decl_origin_self PARAMS ((tree)); -/* In front end. */ -extern void set_yydebug PARAMS ((int)); - /* In stor-layout.c */ extern void fixup_signed_type PARAMS ((tree)); extern void internal_reference_types PARAMS ((void)); @@ -3022,10 +3013,6 @@ extern tree case_index_expr_type PARAMS ((void)); extern HOST_WIDE_INT all_cases_count PARAMS ((tree, int *)); extern void check_for_full_enumeration_handling PARAMS ((tree)); extern void declare_nonlocal_label PARAMS ((tree)); -#ifdef BUFSIZ -extern void lang_print_xnode PARAMS ((FILE *, tree, int)); -#endif - /* If KIND=='I', return a suitable global initializer (constructor) name. If KIND=='D', return a suitable global clean-up (destructor) name. */ |