This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: another 6 langhooks
- To: gcc-patches at gcc dot gnu dot org
- Subject: RFA: another 6 langhooks
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Fri, 9 Nov 2001 20:02:15 +0000
Get 6 more out of the way; there's a chance we can complete the
front-end interface to the core compiler for 3.1.
Neil.
* 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.
============================================================
Index: gcc/Makefile.in
--- gcc/Makefile.in 2001/11/09 17:51:55 1.772
+++ gcc/Makefile.in 2001/11/09 19:37:24
@@ -1349,12 +1349,13 @@ convert.o: convert.c $(CONFIG_H) $(SYSTE
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 \
============================================================
Index: gcc/c-decl.c
--- gcc/c-decl.c 2001/11/07 22:52:30 1.263
+++ gcc/c-decl.c 2001/11/09 19:37:42
@@ -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;
============================================================
Index: gcc/c-lang.c
--- gcc/c-lang.c 2001/11/09 07:14:01 1.60
+++ gcc/c-lang.c 2001/11/09 19:37:43
@@ -61,6 +61,10 @@ static int c_cannot_inline_tree_fn PARAM
#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 \
@@ -132,21 +136,6 @@ c_init ()
lang_missing_noreturn_ok_p = &c_missing_noreturn_ok_p;
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. */
============================================================
Index: gcc/c-parse.in
--- gcc/c-parse.in 2001/11/09 07:14:01 1.111
+++ gcc/c-parse.in 2001/11/09 19:37:50
@@ -3784,7 +3784,7 @@ yylex()
in order to build the compiler. */
void
-set_yydebug (value)
+c_set_yydebug (value)
int value;
{
#if YYDEBUG != 0
============================================================
Index: gcc/c-tree.h
--- gcc/c-tree.h 2001/11/05 23:21:35 1.72
+++ gcc/c-tree.h 2001/11/09 19:37:51
@@ -155,12 +155,14 @@ extern tree lookup_objc_ivar PARAMS ((
/* 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));
============================================================
Index: gcc/langhooks-def.h
--- gcc/langhooks-def.h 2001/11/09 07:14:03 1.2
+++ gcc/langhooks-def.h 2001/11/09 19:37:51
@@ -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
#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
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 \
}
============================================================
Index: gcc/langhooks.c
--- gcc/langhooks.c 2001/11/06 21:12:07 1.7
+++ gcc/langhooks.c 2001/11/09 19:37:52
@@ -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
============================================================
Index: gcc/langhooks.h
--- gcc/langhooks.h 2001/11/09 07:14:03 1.7
+++ gcc/langhooks.h 2001/11/09 19:37:52
@@ -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. */
@@ -87,6 +90,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;
============================================================
Index: gcc/print-tree.c
--- gcc/print-tree.c 2001/09/21 01:26:52 1.49
+++ gcc/print-tree.c 2001/11/09 19:37:53
@@ -24,6 +24,7 @@ Software Foundation, 59 Temple Place - S
#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;
}
============================================================
Index: gcc/toplev.c
--- gcc/toplev.c 2001/11/09 07:14:03 1.534
+++ gcc/toplev.c 2001/11/09 19:38:06
@@ -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':
============================================================
Index: gcc/tree.c
--- gcc/tree.c 2001/10/31 15:28:41 1.218
+++ gcc/tree.c 2001/11/09 19:38:15
@@ -45,6 +45,7 @@ Software Foundation, 59 Temple Place - S
#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
============================================================
Index: gcc/tree.h
--- gcc/tree.h 2001/11/09 07:14:03 1.279
+++ gcc/tree.h 2001/11/09 19:38:25
@@ -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 PARA
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
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. */
============================================================
Index: gcc/ada/misc.c
--- gcc/ada/misc.c 2001/11/09 07:14:15 1.10
+++ gcc/ada/misc.c 2001/11/09 19:38:27
@@ -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
#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. */
@@ -897,14 +882,6 @@ init_parse (filename)
void
finish_parse ()
-{
-}
-
-/* Sets some debug flags for the parsed. It does nothing here. */
-
-void
-set_yydebug (value)
- int value ATTRIBUTE_UNUSED;
{
}
============================================================
Index: gcc/cp/cp-lang.c
--- gcc/cp/cp-lang.c 2001/11/09 07:14:17 1.5
+++ gcc/cp/cp-lang.c 2001/11/09 19:38:28
@@ -45,6 +45,18 @@ static HOST_WIDE_INT cxx_get_alias_set P
#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 \
============================================================
Index: gcc/cp/cp-tree.h
--- gcc/cp/cp-tree.h 2001/10/23 09:14:11 1.652
+++ gcc/cp/cp-tree.h 2001/11/09 19:38:40
@@ -3530,7 +3530,12 @@ extern int current_lang_depth PARAMS (
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));
============================================================
Index: gcc/cp/lex.c
--- gcc/cp/lex.c 2001/11/09 07:14:17 1.254
+++ gcc/cp/lex.c 2001/11/09 19:38:44
@@ -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
============================================================
Index: gcc/cp/ptree.c
--- gcc/cp/ptree.c 2001/03/22 00:55:12 1.27
+++ gcc/cp/ptree.c 2001/11/09 19:38:45
@@ -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, inden
}
void
-lang_print_xnode (file, node, indent)
+cxx_print_xnode (file, node, indent)
FILE *file;
tree node;
int indent;
============================================================
Index: gcc/cp/tree.c
--- gcc/cp/tree.c 2001/11/01 21:09:38 1.258
+++ gcc/cp/tree.c 2001/11/09 19:38:53
@@ -1276,7 +1276,7 @@ extern int depth_reached;
#endif
void
-print_lang_statistics ()
+cxx_print_statistics ()
{
print_search_statistics ();
print_class_statistics ();
============================================================
Index: gcc/f/com.c
--- gcc/f/com.c 2001/11/09 07:14:19 1.138
+++ gcc/f/com.c 2001/11/09 19:39:23
@@ -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 ((vo
#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 ((vo
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, inden
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).
@@ -14760,18 +14732,6 @@ set_block (block)
BLOCK_VARS (block));
current_binding_level->blocks = chainon (current_binding_level->blocks,
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
============================================================
Index: gcc/java/java-tree.h
--- gcc/java/java-tree.h 2001/10/26 01:53:55 1.123
+++ gcc/java/java-tree.h 2001/11/09 19:39:26
@@ -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));
============================================================
Index: gcc/java/jcf-parse.c
--- gcc/java/jcf-parse.c 2001/11/09 07:14:19 1.94
+++ gcc/java/jcf-parse.c 2001/11/09 19:39:28
@@ -262,7 +262,7 @@ parse_signature (jcf, sig_index)
}
void
-set_yydebug (value)
+java_set_yydebug (value)
int value;
{
yydebug = value;
============================================================
Index: gcc/java/lang.c
--- gcc/java/lang.c 2001/11/09 07:14:19 1.77
+++ gcc/java/lang.c 2001/11/09 19:39:31
@@ -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;
@@ -740,45 +742,4 @@ java_init_options ()
flag_bounds_check = 1;
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__));
-{
}
============================================================
Index: gcc/objc/objc-act.c
--- gcc/objc/objc-act.c 2001/11/09 07:14:20 1.102
+++ gcc/objc/objc-act.c 2001/11/09 19:39:43
@@ -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;