Commit 7f4edbcb by Bernd Schmidt Committed by Bernd Schmidt

c-common.h: New file.

	* c-common.h: New file.
	* c-common.c (permanent_obstack): Delete unused declaration.
	(c_global_trees): New array.
	(c_common_nodes_and_builtins): New function; split off common code
	from init_decl_processing in both c-decl.c and cp/decl.c.
	* c-tree.h: Delete lots of declarations of tree nodes; replaced by
	c_global_trees and accessor macros defined in c-common.h.
	Include c-common.h.
	* c-decl.c: Delete definitions for tree nodes that were replaced by
	c_global_trees.
	(init_decl_processing): Build void_list_node.
	Call c_common_nodes_and_builtins; delete code to generate the common
	builtins here.

	* objc/objc-act.c (build_module_descriptor): Rename variable
	void_list_node to avoid clash with c-common.h.

	* cp/cp-tree.h: Delete lots of declarations of tree nodes; replaced by
	c_global_trees and accessor macros defined in c-common.h.
	(cp_tree_index): New enumeration.
	(cp_global_trees): Declare new array.  Add accessor macros for it, and
	delete declarations of tree nodes replaced by it.
	(builtin_function): Delete macro, add declaration for new function.
	Include c-common.h.
	* cp/decl.c: Delete definitions for tree nodes that were replaced by
	cp_global_trees and c_global_trees.
	(init_decl_processing): Call c_common_nodes_and_builtins; delete code
	to generate the common builtins here.
	(builtin_function): New function.
	* cp/decl2.c (abort_fndecl): Delete declaration.
	* cp/except.c (expand_builtin_return_address): Delete declaration.
	(builtin_return_address_fndecl): Delete variable.
	(const_ptr_type_node): Delete declaration.
	* cp/lex.c (cons_up_default_function): Delete declaration of
	void_list_node.
	* cp/parse.y (void_list_node): Delete declaration.
	* cp/rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type):
	Delete variables.
	(const_string_type_node): Delete declaration.
	* cp/search.c (abort_fndecl): Delete declaration.

	* Makefile.in: Update dependencies.
	* objc/Make-lang.in: Likewise.
	* cp/Makefile.in: Likewise.

From-SVN: r28188
parent 3791a1dc
Tue Jul 20 11:24:19 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* c-common.h: New file.
* c-common.c (permanent_obstack): Delete unused declaration.
(c_global_trees): New array.
(c_common_nodes_and_builtins): New function; split off common code
from init_decl_processing in both c-decl.c and cp/decl.c.
* c-tree.h: Delete lots of declarations of tree nodes; replaced by
c_global_trees and accessor macros defined in c-common.h.
Include c-common.h.
* c-decl.c: Delete definitions for tree nodes that were replaced by
c_global_trees.
(init_decl_processing): Build void_list_node.
Call c_common_nodes_and_builtins; delete code to generate the common
builtins here.
* objc/objc-act.c (build_module_descriptor): Rename variable
void_list_node to avoid clash with c-common.h.
* Makefile.in: Update dependencies.
* objc/Make-lang.in: Likewise.
Mon Jul 19 14:22:18 1999 Mark P. Mitchell <mark@codesourcery.com> Mon Jul 19 14:22:18 1999 Mark P. Mitchell <mark@codesourcery.com>
* config/mips/iris6gld.h (MAKE_DECL_ONE_ONLY): Define. * config/mips/iris6gld.h (MAKE_DECL_ONE_ONLY): Define.
......
...@@ -1319,7 +1319,7 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H) ...@@ -1319,7 +1319,7 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
# C language specific files. # C language specific files.
c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \ c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
$(srcdir)/c-parse.h c-tree.h input.h flags.h system.h toplev.h $(srcdir)/c-parse.h c-tree.h c-common.h input.h flags.h system.h toplev.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
$(srcdir)/c-parse.h: $(srcdir)/c-parse.c $(srcdir)/c-parse.h: $(srcdir)/c-parse.c
$(srcdir)/c-parse.c: $(srcdir)/c-parse.y $(srcdir)/c-parse.c: $(srcdir)/c-parse.y
...@@ -1336,22 +1336,22 @@ $(srcdir)/c-gperf.h: c-parse.gperf ...@@ -1336,22 +1336,22 @@ $(srcdir)/c-gperf.h: c-parse.gperf
-k1,3,$$ $(srcdir)/c-parse.gperf >tmp-gperf.h -k1,3,$$ $(srcdir)/c-parse.gperf >tmp-gperf.h
$(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h $(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h
c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h flags.h \ c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h \
output.h toplev.h c-lex.h flags.h output.h toplev.h
c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) c-tree.h flags.h \ c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h \
intl.h output.h $(EXPR_H) $(RTL_H) toplev.h flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h
c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h toplev.h \ c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h \
output.h c-lex.h toplev.h output.h
c-lex.o : c-lex.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-lex.h c-tree.h \ c-lex.o : c-lex.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-lex.h c-tree.h \
$(srcdir)/c-parse.h input.h intl.h flags.h $(srcdir)/c-gperf.h c-pragma.h \ c-common.h $(srcdir)/c-parse.h $(srcdir)/c-gperf.h c-pragma.h input.h \
toplev.h output.h mbchar.h intl.h flags.h toplev.h output.h mbchar.h
c-aux-info.o : c-aux-info.c $(CONFIG_H) system.h $(TREE_H) c-tree.h flags.h \ c-aux-info.o : c-aux-info.c $(CONFIG_H) system.h $(TREE_H) c-tree.h \
toplev.h c-common.h flags.h toplev.h
c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h
c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) except.h \ c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) except.h \
function.h defaults.h c-pragma.h toplev.h function.h defaults.h c-pragma.h toplev.h
c-iterate.o: c-iterate.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-tree.h \ c-iterate.o: c-iterate.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-tree.h \
flags.h toplev.h $(EXPR_H) c-common.h flags.h toplev.h $(EXPR_H)
mbchar.o: mbchar.c $(CONFIG_H) system.h mbchar.h mbchar.o: mbchar.c $(CONFIG_H) system.h mbchar.h
graph.o: graph.c $(CONFIG_H) system.h toplev.h flags.h output.h $(RTL_H) \ graph.o: graph.c $(CONFIG_H) system.h toplev.h flags.h output.h $(RTL_H) \
hard-reg-set.h $(BASIC_BLOCK_H) hard-reg-set.h $(BASIC_BLOCK_H)
...@@ -1401,7 +1401,7 @@ s-under: $(GCC_PASSES) ...@@ -1401,7 +1401,7 @@ s-under: $(GCC_PASSES)
# A file used by all variants of C. # A file used by all variants of C.
c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h \ c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h \
flags.h toplev.h output.h c-pragma.h $(RTL_H) c-common.h flags.h toplev.h output.h c-pragma.h $(RTL_H)
# Language-independent files. # Language-independent files.
......
/* Definitions for c-common.c.
Copyright (C) 1987, 93, 94, 95, 97, 98, 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 2, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Standard named or nameless data types of the C compiler. */
enum c_tree_index
{
CTI_INTQI_TYPE,
CTI_INTHI_TYPE,
CTI_INTSI_TYPE,
CTI_INTDI_TYPE,
CTI_INTTI_TYPE,
CTI_UINTQI_TYPE,
CTI_UINTHI_TYPE,
CTI_UINTSI_TYPE,
CTI_UINTDI_TYPE,
CTI_UINTTI_TYPE,
CTI_SIGNED_CHAR_TYPE,
CTI_UNSIGNED_CHAR_TYPE,
CTI_WCHAR_TYPE,
CTI_SIGNED_WCHAR_TYPE,
CTI_UNSIGNED_WCHAR_TYPE,
CTI_SHORT_INTEGER_TYPE,
CTI_SHORT_UNSIGNED_TYPE,
CTI_LONG_INTEGER_TYPE,
CTI_LONG_UNSIGNED_TYPE,
CTI_LONG_LONG_INTEGER_TYPE,
CTI_LONG_LONG_UNSIGNED_TYPE,
CTI_WIDEST_INT_LIT_TYPE,
CTI_WIDEST_UINT_LIT_TYPE,
CTI_COMPLEX_INTEGER_TYPE,
CTI_COMPLEX_FLOAT_TYPE,
CTI_COMPLEX_DOUBLE_TYPE,
CTI_COMPLEX_LONG_DOUBLE_TYPE,
CTI_FLOAT_TYPE,
CTI_DOUBLE_TYPE,
CTI_LONG_DOUBLE_TYPE,
CTI_CHAR_ARRAY_TYPE,
CTI_WCHAR_ARRAY_TYPE,
CTI_INT_ARRAY_TYPE,
CTI_STRING_TYPE,
CTI_CONST_STRING_TYPE,
CTI_PTR_TYPE,
CTI_CONST_PTR_TYPE,
CTI_PTRDIFF_TYPE,
CTI_BOOLEAN_TYPE,
CTI_BOOLEAN_TRUE,
CTI_BOOLEAN_FALSE,
CTI_DEFAULT_FUNCTION_TYPE,
CTI_VOID_LIST,
CTI_VOID_FTYPE,
CTI_VOID_FTYPE_PTR,
CTI_INT_FTYPE_INT,
CTI_PTR_FTYPE_SIZETYPE,
CTI_MAX
};
extern tree c_global_trees[CTI_MAX];
#define intQI_type_node c_global_trees[CTI_INTQI_TYPE]
#define intHI_type_node c_global_trees[CTI_INTHI_TYPE]
#define intSI_type_node c_global_trees[CTI_INTSI_TYPE]
#define intDI_type_node c_global_trees[CTI_INTDI_TYPE]
#if HOST_BITS_PER_WIDE_INT >= 64
#define intTI_type_node c_global_trees[CTI_INTTI_TYPE]
#endif
#define unsigned_intQI_type_node c_global_trees[CTI_UINTQI_TYPE]
#define unsigned_intHI_type_node c_global_trees[CTI_UINTHI_TYPE]
#define unsigned_intSI_type_node c_global_trees[CTI_UINTSI_TYPE]
#define unsigned_intDI_type_node c_global_trees[CTI_UINTDI_TYPE]
#if HOST_BITS_PER_WIDE_INT >= 64
#define unsigned_intTI_type_node c_global_trees[CTI_UINTTI_TYPE]
#endif
#define signed_char_type_node c_global_trees[CTI_SIGNED_CHAR_TYPE]
#define unsigned_char_type_node c_global_trees[CTI_UNSIGNED_CHAR_TYPE]
#define wchar_type_node c_global_trees[CTI_WCHAR_TYPE]
#define signed_wchar_type_node c_global_trees[CTI_SIGNED_WCHAR_TYPE]
#define unsigned_wchar_type_node c_global_trees[CTI_UNSIGNED_WCHAR_TYPE]
#define short_integer_type_node c_global_trees[CTI_SHORT_INTEGER_TYPE]
#define short_unsigned_type_node c_global_trees[CTI_SHORT_UNSIGNED_TYPE]
#define long_integer_type_node c_global_trees[CTI_LONG_INTEGER_TYPE]
#define long_unsigned_type_node c_global_trees[CTI_LONG_UNSIGNED_TYPE]
#define long_long_integer_type_node c_global_trees[CTI_LONG_LONG_INTEGER_TYPE]
#define long_long_unsigned_type_node c_global_trees[CTI_LONG_LONG_UNSIGNED_TYPE]
#define widest_integer_literal_type_node c_global_trees[CTI_WIDEST_INT_LIT_TYPE]
#define widest_unsigned_literal_type_node c_global_trees[CTI_WIDEST_UINT_LIT_TYPE]
#define float_type_node c_global_trees[CTI_FLOAT_TYPE]
#define double_type_node c_global_trees[CTI_DOUBLE_TYPE]
#define long_double_type_node c_global_trees[CTI_LONG_DOUBLE_TYPE]
#define complex_integer_type_node c_global_trees[CTI_COMPLEX_INTEGER_TYPE]
#define complex_float_type_node c_global_trees[CTI_COMPLEX_FLOAT_TYPE]
#define complex_double_type_node c_global_trees[CTI_COMPLEX_DOUBLE_TYPE]
#define complex_long_double_type_node c_global_trees[CTI_COMPLEX_LONG_DOUBLE_TYPE]
#define boolean_type_node c_global_trees[CTI_BOOLEAN_TYPE]
#define boolean_true_node c_global_trees[CTI_BOOLEAN_TRUE]
#define boolean_false_node c_global_trees[CTI_BOOLEAN_FALSE]
#define ptr_type_node c_global_trees[CTI_PTR_TYPE]
#define const_ptr_type_node c_global_trees[CTI_CONST_PTR_TYPE]
#define ptrdiff_type_node c_global_trees[CTI_PTRDIFF_TYPE]
#define char_array_type_node c_global_trees[CTI_CHAR_ARRAY_TYPE]
#define wchar_array_type_node c_global_trees[CTI_WCHAR_ARRAY_TYPE]
#define int_array_type_node c_global_trees[CTI_INT_ARRAY_TYPE]
#define string_type_node c_global_trees[CTI_STRING_TYPE]
#define const_string_type_node c_global_trees[CTI_CONST_STRING_TYPE]
#define default_function_type c_global_trees[CTI_DEFAULT_FUNCTION_TYPE]
#define void_list_node c_global_trees[CTI_VOID_LIST]
#define void_ftype c_global_trees[CTI_VOID_FTYPE]
#define void_ftype_ptr c_global_trees[CTI_VOID_FTYPE_PTR]
#define int_ftype_int c_global_trees[CTI_INT_FTYPE_INT]
#define ptr_ftype_sizetype c_global_trees[CTI_PTR_FTYPE_SIZETYPE]
extern void declare_function_name PROTO((void));
extern void decl_attributes PROTO((tree, tree, tree));
extern void init_function_format_info PROTO((void));
extern void check_function_format PROTO((tree, tree, tree));
extern void c_apply_type_quals_to_decl PROTO((int, tree));
extern int c_get_alias_set PROTO((tree));
/* Print an error message for invalid operands to arith operation CODE.
NOP_EXPR is used as a special case (see truthvalue_conversion). */
extern void binary_op_error PROTO((enum tree_code));
extern void c_expand_expr_stmt PROTO((tree));
extern void c_expand_start_cond PROTO((tree, int, int));
extern void c_expand_start_else PROTO((void));
extern void c_expand_end_cond PROTO((void));
/* Validate the expression after `case' and apply default promotions. */
extern tree check_case_value PROTO((tree));
/* Concatenate a list of STRING_CST nodes into one STRING_CST. */
extern tree combine_strings PROTO((tree));
extern void constant_expression_warning PROTO((tree));
extern tree convert_and_check PROTO((tree, tree));
extern void overflow_warning PROTO((tree));
extern void unsigned_conversion_warning PROTO((tree, tree));
/* Read the rest of the current #-directive line. */
#if USE_CPPLIB
extern char *get_directive_line PROTO((void));
#define GET_DIRECTIVE_LINE() get_directive_line ()
#else
extern char *get_directive_line PROTO((FILE *));
#define GET_DIRECTIVE_LINE() get_directive_line (finput)
#endif
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type. */
extern tree shorten_compare PROTO((tree *, tree *, tree *, enum tree_code *));
/* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
or validate its data type for an `if' or `while' statement or ?..: exp. */
extern tree truthvalue_conversion PROTO((tree));
extern tree type_for_mode PROTO((enum machine_mode, int));
extern tree type_for_size PROTO((unsigned, int));
/* Declare a predefined function. Return the declaration. This function is
provided by each language frontend. */
extern tree builtin_function PROTO((const char *, tree, enum built_in_function, const char *));
/* Build tree nodes and builtin functions common to both C and C++ language
frontends. */
extern void c_common_nodes_and_builtins PROTO((int, int, int));
...@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */ ...@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. */
#ifndef _C_TREE_H #ifndef _C_TREE_H
#define _C_TREE_H #define _C_TREE_H
#include "c-common.h"
/* Language-dependent contents of an identifier. */ /* Language-dependent contents of an identifier. */
/* The limbo_value is used for block level extern declarations, which need /* The limbo_value is used for block level extern declarations, which need
...@@ -175,116 +177,11 @@ extern tree build_objc_string PROTO((int, const char *)); ...@@ -175,116 +177,11 @@ extern tree build_objc_string PROTO((int, const char *));
/* in c-aux-info.c */ /* in c-aux-info.c */
extern void gen_aux_info_record PROTO((tree, int, int, int)); extern void gen_aux_info_record PROTO((tree, int, int, int));
/* in c-common.c */
extern void declare_function_name PROTO((void));
extern void decl_attributes PROTO((tree, tree, tree));
extern void init_function_format_info PROTO((void));
extern void check_function_format PROTO((tree, tree, tree));
extern int c_get_alias_set PROTO((tree));
extern void c_apply_type_quals_to_decl PROTO((int, tree));
/* Print an error message for invalid operands to arith operation CODE.
NOP_EXPR is used as a special case (see truthvalue_conversion). */
extern void binary_op_error PROTO((enum tree_code));
extern void c_expand_expr_stmt PROTO((tree));
extern void c_expand_start_cond PROTO((tree, int, int));
extern void c_expand_start_else PROTO((void));
extern void c_expand_end_cond PROTO((void));
/* Validate the expression after `case' and apply default promotions. */
extern tree check_case_value PROTO((tree));
/* Concatenate a list of STRING_CST nodes into one STRING_CST. */
extern tree combine_strings PROTO((tree));
extern void constant_expression_warning PROTO((tree));
extern tree convert_and_check PROTO((tree, tree));
extern void overflow_warning PROTO((tree));
extern void unsigned_conversion_warning PROTO((tree, tree));
/* Read the rest of the current #-directive line. */
#if USE_CPPLIB
extern char *get_directive_line PROTO((void));
#define GET_DIRECTIVE_LINE() get_directive_line ()
#else
extern char *get_directive_line PROTO((FILE *));
#define GET_DIRECTIVE_LINE() get_directive_line (finput)
#endif
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type. */
extern tree shorten_compare PROTO((tree *, tree *, tree *, enum tree_code *));
/* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
or validate its data type for an `if' or `while' statement or ?..: exp. */
extern tree truthvalue_conversion PROTO((tree));
extern tree type_for_mode PROTO((enum machine_mode, int));
extern tree type_for_size PROTO((unsigned, int));
/* in c-convert.c */ /* in c-convert.c */
extern tree convert PROTO((tree, tree)); extern tree convert PROTO((tree, tree));
/* in c-decl.c */ /* in c-decl.c */
/* Standard named or nameless data types of the C compiler. */
extern tree char_array_type_node;
extern tree char_type_node;
extern tree const_ptr_type_node;
extern tree const_string_type_node;
extern tree default_function_type;
extern tree double_ftype_double;
extern tree double_ftype_double_double;
extern tree double_type_node;
extern tree float_type_node;
#if HOST_BITS_PER_WIDE_INT >= 64
extern tree intTI_type_node;
#endif
extern tree intDI_type_node;
extern tree intHI_type_node;
extern tree intQI_type_node;
extern tree intSI_type_node;
extern tree int_array_type_node;
extern tree int_ftype_cptr_cptr_sizet;
extern tree int_ftype_int;
extern tree int_ftype_ptr_ptr_int;
extern tree int_ftype_string_string;
extern tree integer_type_node;
extern tree long_double_type_node;
extern tree long_ftype_long;
extern tree long_integer_type_node;
extern tree long_unsigned_type_node;
extern tree long_long_integer_type_node;
extern tree long_long_unsigned_type_node;
extern tree widest_integer_literal_type_node;
extern tree widest_unsigned_literal_type_node;
extern tree complex_integer_type_node;
extern tree complex_float_type_node;
extern tree complex_double_type_node;
extern tree complex_long_double_type_node;
extern tree ptr_type_node;
extern tree ptrdiff_type_node;
extern tree short_integer_type_node;
extern tree short_unsigned_type_node;
extern tree signed_char_type_node;
extern tree signed_wchar_type_node;
extern tree string_ftype_ptr_ptr;
extern tree string_type_node;
extern tree unsigned_char_type_node;
#if HOST_BITS_PER_WIDE_INT >= 64
extern tree unsigned_intTI_type_node;
#endif
extern tree unsigned_intDI_type_node;
extern tree unsigned_intHI_type_node;
extern tree unsigned_intQI_type_node;
extern tree unsigned_intSI_type_node;
extern tree unsigned_type_node;
extern tree unsigned_wchar_type_node;
extern tree void_ftype_ptr_int_int;
extern tree void_ftype_ptr_ptr_int;
extern tree void_type_node;
extern tree wchar_array_type_node;
extern tree wchar_type_node;
extern tree boolean_type_node;
extern tree boolean_true_node;
extern tree boolean_false_node;
extern tree build_enumerator PROTO((tree, tree)); extern tree build_enumerator PROTO((tree, tree));
/* Declare a predefined function. Return the declaration. */
extern tree builtin_function PROTO((const char *, tree, enum built_in_function function_, const char *));
/* Add qualifiers to a type, in the fashion for C. */ /* Add qualifiers to a type, in the fashion for C. */
extern tree c_build_qualified_type PROTO((tree, int)); extern tree c_build_qualified_type PROTO((tree, int));
#define c_build_type_variant(TYPE, CONST_P, VOLATILE_P) \ #define c_build_type_variant(TYPE, CONST_P, VOLATILE_P) \
......
Tue Jul 20 11:24:19 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* cp-tree.h: Delete lots of declarations of tree nodes; replaced by
c_global_trees and accessor macros defined in c-common.h.
(cp_tree_index): New enumeration.
(cp_global_trees): Declare new array. Add accessor macros for it, and
delete declarations of tree nodes replaced by it.
(builtin_function): Delete macro, add declaration for new function.
Include c-common.h.
* decl.c: Delete definitions for tree nodes that were replaced by
cp_global_trees and c_global_trees.
(init_decl_processing): Call c_common_nodes_and_builtins; delete code
to generate the common builtins here.
(builtin_function): New function.
* decl2.c (abort_fndecl): Delete declaration.
* except.c (expand_builtin_return_address): Delete declaration.
(builtin_return_address_fndecl): Delete variable.
(const_ptr_type_node): Delete declaration.
* lex.c (cons_up_default_function): Delete declaration of
void_list_node.
* parse.y (void_list_node): Delete declaration.
* rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type):
Delete variables.
(const_string_type_node): Delete declaration.
* search.c (abort_fndecl): Delete declaration.
* Makefile.in: Update dependencies.
1999-07-19 Mark Mitchell <mark@codesourcery.com> 1999-07-19 Mark Mitchell <mark@codesourcery.com>
* pt.c (check_default_tmpl_args): Move test for missing default * pt.c (check_default_tmpl_args): Move test for missing default
......
...@@ -214,7 +214,7 @@ RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \ ...@@ -214,7 +214,7 @@ RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
$(srcdir)/../machmode.h $(srcdir)/../machmode.def $(srcdir)/../machmode.h $(srcdir)/../machmode.def
TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \ TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
$(srcdir)/../machmode.h $(srcdir)/../machmode.def $(srcdir)/../machmode.h $(srcdir)/../machmode.def
CXX_TREE_H = $(TREE_H) cp-tree.h cp-tree.def CXX_TREE_H = $(TREE_H) cp-tree.h $(srcdir)/../c-common.h cp-tree.def
PARSE_H = $(srcdir)/parse.h PARSE_H = $(srcdir)/parse.h
PARSE_C = $(srcdir)/parse.c PARSE_C = $(srcdir)/parse.c
EXPR_H = $(srcdir)/../expr.h ../insn-codes.h EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
......
...@@ -19,6 +19,8 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -19,6 +19,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include "c-common.h"
#ifndef _CP_TREE_H #ifndef _CP_TREE_H
#define _CP_TREE_H #define _CP_TREE_H
...@@ -329,40 +331,96 @@ extern int pedantic; ...@@ -329,40 +331,96 @@ extern int pedantic;
next exception handler. */ next exception handler. */
extern tree exception_throw_decl; extern tree exception_throw_decl;
extern tree double_type_node, long_double_type_node, float_type_node; enum cp_tree_index
extern tree char_type_node, unsigned_char_type_node, signed_char_type_node; {
extern tree ptrdiff_type_node; CPTI_JAVA_BYTE_TYPE,
CPTI_JAVA_SHORT_TYPE,
extern tree short_integer_type_node, short_unsigned_type_node; CPTI_JAVA_INT_TYPE,
extern tree long_integer_type_node, long_unsigned_type_node; CPTI_JAVA_LONG_TYPE,
extern tree long_long_integer_type_node, long_long_unsigned_type_node; CPTI_JAVA_FLOAT_TYPE,
extern tree widest_integer_literal_type_node, widest_unsigned_literal_type_node; CPTI_JAVA_DOUBLE_TYPE,
extern tree unsigned_type_node; CPTI_JAVA_CHAR_TYPE,
extern tree string_type_node, char_array_type_node, int_array_type_node; CPTI_JAVA_BOOLEAN_TYPE,
extern tree wchar_array_type_node;
extern tree wchar_type_node, signed_wchar_type_node, unsigned_wchar_type_node; CPTI_VOID_ZERO,
CPTI_WCHAR_DECL,
extern tree complex_integer_type_node; CPTI_VTABLE_ENTRY_TYPE,
extern tree complex_float_type_node; CPTI_DELTA_TYPE,
extern tree complex_double_type_node;
extern tree complex_long_double_type_node; CPTI_TP_DESC_TYPE,
CPTI_ACCESS_MODE_TYPE,
extern tree intQI_type_node, unsigned_intQI_type_node; CPTI_BLTN_DESC_TYPE,
extern tree intHI_type_node, unsigned_intHI_type_node; CPTI_USER_DESC_TYPE,
extern tree intSI_type_node, unsigned_intSI_type_node; CPTI_CLASS_DESC_TYPE,
extern tree intDI_type_node, unsigned_intDI_type_node; CPTI_PTR_DESC_TYPE,
#if HOST_BITS_PER_WIDE_INT >= 64 CPTI_ATTR_DESC_TYPE,
extern tree intTI_type_node, unsigned_intTI_type_node; CPTI_FUNC_DESC_TYPE,
#endif CPTI_PTMF_DESC_TYPE,
CPTI_PTMD_DESC_TYPE,
CPTI_CLASS_STAR_TYPE,
CPTI_CLASS_TYPE,
CPTI_RECORD_TYPE,
CPTI_UNION_TYPE,
CPTI_ENUM_TYPE,
CPTI_UNKNOWN_TYPE,
CPTI_OPAQUE_TYPE,
CPTI_SIGNATURE_TYPE,
CPTI_SIGTABLE_ENTRY_TYPE,
CPTI_VTBL_TYPE,
CPTI_VTBL_PTR_TYPE,
CPTI_STD,
CPTI_TYPE_INFO_TYPE,
CPTI_TINFO_FN_ID,
CPTI_TINFO_FN_TYPE,
CPTI_ABORT_FNDECL,
CPTI_GLOBAL_DELETE_FNDECL,
CPTI_MAX
};
extern tree java_byte_type_node; extern tree cp_global_trees[CPTI_MAX];
extern tree java_short_type_node;
extern tree java_int_type_node; #define java_byte_type_node cp_global_trees[CPTI_JAVA_BYTE_TYPE]
extern tree java_long_type_node; #define java_short_type_node cp_global_trees[CPTI_JAVA_SHORT_TYPE]
extern tree java_float_type_node; #define java_int_type_node cp_global_trees[CPTI_JAVA_INT_TYPE]
extern tree java_double_type_node; #define java_long_type_node cp_global_trees[CPTI_JAVA_LONG_TYPE]
extern tree java_char_type_node; #define java_float_type_node cp_global_trees[CPTI_JAVA_FLOAT_TYPE]
extern tree java_boolean_type_node; #define java_double_type_node cp_global_trees[CPTI_JAVA_DOUBLE_TYPE]
#define java_char_type_node cp_global_trees[CPTI_JAVA_CHAR_TYPE]
#define java_boolean_type_node cp_global_trees[CPTI_JAVA_BOOLEAN_TYPE]
#define void_zero_node cp_global_trees[CPTI_VOID_ZERO]
#define wchar_decl_node cp_global_trees[CPTI_WCHAR_DECL]
#define vtable_entry_type cp_global_trees[CPTI_VTABLE_ENTRY_TYPE]
#define delta_type_node cp_global_trees[CPTI_DELTA_TYPE]
#define __tp_desc_type_node cp_global_trees[CPTI_TP_DESC_TYPE]
#define __access_mode_type_node cp_global_trees[CPTI_ACCESS_MODE_TYPE]
#define __bltn_desc_type_node cp_global_trees[CPTI_BLTN_DESC_TYPE]
#define __user_desc_type_node cp_global_trees[CPTI_USER_DESC_TYPE]
#define __class_desc_type_node cp_global_trees[CPTI_CLASS_DESC_TYPE]
#define __ptr_desc_type_node cp_global_trees[CPTI_PTR_DESC_TYPE]
#define __attr_desc_type_node cp_global_trees[CPTI_ATTR_DESC_TYPE]
#define __func_desc_type_node cp_global_trees[CPTI_FUNC_DESC_TYPE]
#define __ptmf_desc_type_node cp_global_trees[CPTI_PTMF_DESC_TYPE]
#define __ptmd_desc_type_node cp_global_trees[CPTI_PTMD_DESC_TYPE]
#define class_star_type_node cp_global_trees[CPTI_CLASS_STAR_TYPE]
#define class_type_node cp_global_trees[CPTI_CLASS_TYPE]
#define record_type_node cp_global_trees[CPTI_RECORD_TYPE]
#define union_type_node cp_global_trees[CPTI_UNION_TYPE]
#define enum_type_node cp_global_trees[CPTI_ENUM_TYPE]
#define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE]
#define opaque_type_node cp_global_trees[CPTI_OPAQUE_TYPE]
#define signature_type_node cp_global_trees[CPTI_SIGNATURE_TYPE]
#define sigtable_entry_type cp_global_trees[CPTI_SIGTABLE_ENTRY_TYPE]
#define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE]
#define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE]
#define std_node cp_global_trees[CPTI_STD]
#define type_info_type_node cp_global_trees[CPTI_TYPE_INFO_TYPE]
#define tinfo_fn_id cp_global_trees[CPTI_TINFO_FN_ID]
#define tinfo_fn_type cp_global_trees[CPTI_TINFO_FN_TYPE]
#define abort_fndecl cp_global_trees[CPTI_ABORT_FNDECL]
#define global_delete_fndecl cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL]
extern int current_function_returns_value; extern int current_function_returns_value;
extern int current_function_returns_null; extern int current_function_returns_null;
...@@ -2048,9 +2106,6 @@ extern int flag_new_for_scope; ...@@ -2048,9 +2106,6 @@ extern int flag_new_for_scope;
#define DEFARG_LENGTH(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.length) #define DEFARG_LENGTH(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.length)
#define DEFARG_POINTER(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.pointer) #define DEFARG_POINTER(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.pointer)
#define builtin_function(NAME, TYPE, CODE, LIBNAME) \
define_function (NAME, TYPE, CODE, (void (*) PROTO((tree)))pushdecl, LIBNAME)
/* These macros provide convenient access to the various _STMT nodes /* These macros provide convenient access to the various _STMT nodes
created when parsing template declarations. */ created when parsing template declarations. */
#define IF_COND(NODE) TREE_OPERAND (NODE, 0) #define IF_COND(NODE) TREE_OPERAND (NODE, 0)
...@@ -2153,22 +2208,6 @@ extern tree type_for_size PROTO((unsigned, int)); ...@@ -2153,22 +2208,6 @@ extern tree type_for_size PROTO((unsigned, int));
extern int c_get_alias_set PROTO((tree)); extern int c_get_alias_set PROTO((tree));
/* in decl{2}.c */ /* in decl{2}.c */
extern tree void_list_node;
extern tree void_zero_node;
extern tree default_function_type;
extern tree vtable_entry_type;
extern tree sigtable_entry_type;
extern tree __t_desc_type_node;
#if 0
extern tree __tp_desc_type_node;
#endif
extern tree __access_mode_type_node;
extern tree __bltn_desc_type_node, __user_desc_type_node;
extern tree __class_desc_type_node, __attr_desc_type_node;
extern tree __ptr_desc_type_node, __func_desc_type_node;
extern tree __ptmf_desc_type_node, __ptmd_desc_type_node;
extern tree type_info_type_node;
extern tree class_star_type_node;
extern tree this_identifier; extern tree this_identifier;
extern tree ctor_identifier, dtor_identifier; extern tree ctor_identifier, dtor_identifier;
extern tree pfn_identifier; extern tree pfn_identifier;
...@@ -2182,36 +2221,19 @@ extern tree vt_off_identifier; ...@@ -2182,36 +2221,19 @@ extern tree vt_off_identifier;
/* A node that is a list (length 1) of error_mark_nodes. */ /* A node that is a list (length 1) of error_mark_nodes. */
extern tree error_mark_list; extern tree error_mark_list;
extern tree ptr_type_node;
extern tree class_type_node, record_type_node, union_type_node, enum_type_node;
extern tree unknown_type_node;
extern tree opaque_type_node, signature_type_node;
/* Node for "pointer to (virtual) function". /* Node for "pointer to (virtual) function".
This may be distinct from ptr_type_node so gdb can distinguish them. */ This may be distinct from ptr_type_node so gdb can distinguish them. */
#define vfunc_ptr_type_node \ #define vfunc_ptr_type_node \
(flag_vtable_thunks ? vtable_entry_type : ptr_type_node) (flag_vtable_thunks ? vtable_entry_type : ptr_type_node)
/* The type of a vtbl, i.e., an array of vtable entries. */
extern tree vtbl_type_node;
/* The type of a class vtbl pointer, i.e., a pointer to a vtable entry. */
extern tree vtbl_ptr_type_node;
extern tree delta_type_node;
extern tree std_node;
extern tree long_long_integer_type_node, long_long_unsigned_type_node;
/* For building calls to `delete'. */ /* For building calls to `delete'. */
extern tree integer_two_node, integer_three_node; extern tree integer_two_node, integer_three_node;
extern tree boolean_type_node, boolean_true_node, boolean_false_node;
extern tree null_node; extern tree null_node;
extern tree anonymous_namespace_name; extern tree anonymous_namespace_name;
/* The FUNCTION_DECL for the default `::operator delete'. */
extern tree global_delete_fndecl;
/* in pt.c */ /* in pt.c */
/* These values are used for the `STRICT' parameter to type_unfication and /* These values are used for the `STRICT' parameter to type_unfication and
...@@ -2862,7 +2884,7 @@ extern void init_decl_processing PROTO((void)); ...@@ -2862,7 +2884,7 @@ extern void init_decl_processing PROTO((void));
extern int init_type_desc PROTO((void)); extern int init_type_desc PROTO((void));
extern tree define_function extern tree define_function
PROTO((const char *, tree, enum built_in_function, PROTO((const char *, tree, enum built_in_function,
void (*) (tree), const char *)); void (*) (tree), const char *));
extern tree check_tag_decl PROTO((tree)); extern tree check_tag_decl PROTO((tree));
extern void shadow_tag PROTO((tree)); extern void shadow_tag PROTO((tree));
extern tree groktypename PROTO((tree)); extern tree groktypename PROTO((tree));
......
...@@ -2394,8 +2394,6 @@ coerce_delete_type (type) ...@@ -2394,8 +2394,6 @@ coerce_delete_type (type)
return type; return type;
} }
extern tree abort_fndecl;
static void static void
mark_vtable_entries (decl) mark_vtable_entries (decl)
tree decl; tree decl;
......
...@@ -37,13 +37,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -37,13 +37,6 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h" #include "toplev.h"
#include "eh-common.h" #include "eh-common.h"
rtx expand_builtin_return_addr PROTO((enum built_in_function, int, rtx));
/* Holds the fndecl for __builtin_return_address. */
tree builtin_return_address_fndecl;
/* A couple of backend routines from m88k.c */
static void push_eh_cleanup PROTO((void)); static void push_eh_cleanup PROTO((void));
static tree build_eh_type_type PROTO((tree)); static tree build_eh_type_type PROTO((tree));
static tree build_eh_type PROTO((tree)); static tree build_eh_type PROTO((tree));
...@@ -184,7 +177,6 @@ static tree Unwind; ...@@ -184,7 +177,6 @@ static tree Unwind;
========================================================================= */ ========================================================================= */
extern rtx catch_clauses; extern rtx catch_clauses;
extern tree const_ptr_type_node;
/* ========================================================================= */ /* ========================================================================= */
......
...@@ -2002,7 +2002,6 @@ cons_up_default_function (type, full_name, kind) ...@@ -2002,7 +2002,6 @@ cons_up_default_function (type, full_name, kind)
tree type, full_name; tree type, full_name;
int kind; int kind;
{ {
extern tree void_list_node;
tree declspecs = NULL_TREE; tree declspecs = NULL_TREE;
tree fn, args = NULL_TREE; tree fn, args = NULL_TREE;
tree argtype; tree argtype;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -47,7 +47,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -47,7 +47,6 @@ Boston, MA 02111-1307, USA. */
definition here. (fnf) */ definition here. (fnf) */
char *language_string = "GNU C++"; char *language_string = "GNU C++";
extern tree void_list_node;
extern struct obstack permanent_obstack; extern struct obstack permanent_obstack;
extern int end_of_file; extern int end_of_file;
......
...@@ -48,10 +48,6 @@ static void expand_ptr_desc PROTO((tree, tree)); ...@@ -48,10 +48,6 @@ static void expand_ptr_desc PROTO((tree, tree));
static void expand_generic_desc PROTO((tree, tree, const char *)); static void expand_generic_desc PROTO((tree, tree, const char *));
static tree throw_bad_cast PROTO((void)); static tree throw_bad_cast PROTO((void));
static tree throw_bad_typeid PROTO((void)); static tree throw_bad_typeid PROTO((void));
tree type_info_type_node;
tree tinfo_fn_id;
tree tinfo_fn_type;
void void
init_rtti_processing () init_rtti_processing ()
...@@ -726,8 +722,6 @@ build_dynamic_cast (type, expr) ...@@ -726,8 +722,6 @@ build_dynamic_cast (type, expr)
Note: these constructors always return the address of the descriptor Note: these constructors always return the address of the descriptor
info, since that is simplest for their mutual interaction. */ info, since that is simplest for their mutual interaction. */
extern tree const_string_type_node;
/* Build an initializer for a __si_type_info node. */ /* Build an initializer for a __si_type_info node. */
static void static void
......
...@@ -37,7 +37,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -37,7 +37,6 @@ Boston, MA 02111-1307, USA. */
#define obstack_chunk_free free #define obstack_chunk_free free
extern struct obstack *current_obstack; extern struct obstack *current_obstack;
extern tree abort_fndecl;
#include "stack.h" #include "stack.h"
......
...@@ -66,8 +66,9 @@ cc1obj$(exeext): $(P) $(OBJS) $(OBJC_OBJS) $(LIBDEPS) ...@@ -66,8 +66,9 @@ cc1obj$(exeext): $(P) $(OBJS) $(OBJC_OBJS) $(LIBDEPS)
objc-parse.o : $(srcdir)/objc/objc-parse.c \ objc-parse.o : $(srcdir)/objc/objc-parse.c \
$(CONFIG_H) $(TREE_H) $(srcdir)/toplev.h \ $(CONFIG_H) $(TREE_H) $(srcdir)/toplev.h \
$(srcdir)/c-lex.h $(srcdir)/c-tree.h $(srcdir)/input.h \ $(srcdir)/c-lex.h $(srcdir)/c-tree.h $(srcdir)/c-common.h \
$(srcdir)/flags.h $(srcdir)/output.h $(srcdir)/objc/objc-act.h system.h $(srcdir)/input.h $(srcdir)/flags.h $(srcdir)/output.h \
$(srcdir)/objc/objc-act.h system.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \
-c $(srcdir)/objc/objc-parse.c -c $(srcdir)/objc/objc-parse.c
...@@ -85,9 +86,10 @@ $(srcdir)/objc/objc-parse.y: $(srcdir)/c-parse.in ...@@ -85,9 +86,10 @@ $(srcdir)/objc/objc-parse.y: $(srcdir)/c-parse.in
objc-act.o : $(srcdir)/objc/objc-act.c \ objc-act.o : $(srcdir)/objc/objc-act.c \
$(CONFIG_H) $(TREE_H) $(RTL_H) system.h \ $(CONFIG_H) $(TREE_H) $(RTL_H) system.h \
$(srcdir)/c-tree.h $(srcdir)/c-lex.h $(srcdir)/toplev.h \ $(srcdir)/c-tree.h $(srcdir)/c-common.h $(srcdir)/c-lex.h \
$(srcdir)/flags.h $(srcdir)/objc/objc-act.h $(srcdir)/input.h \ $(srcdir)/toplev.h $(srcdir)/flags.h $(srcdir)/objc/objc-act.h \
$(srcdir)/function.h $(srcdir)/output.h $(srcdir)/c-parse.h $(srcdir)/input.h $(srcdir)/function.h $(srcdir)/output.h \
$(srcdir)/c-parse.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \
-c $(srcdir)/objc/objc-act.c -c $(srcdir)/objc/objc-act.c
......
...@@ -1769,17 +1769,17 @@ build_module_descriptor () ...@@ -1769,17 +1769,17 @@ build_module_descriptor ()
return 0; return 0;
{ {
tree parms, function_decl, decelerator, void_list_node; tree parms, function_decl, decelerator, void_list_node_1;
tree function_type; tree function_type;
tree init_function_name = get_file_function_name ('I'); tree init_function_name = get_file_function_name ('I');
/* Declare void __objc_execClass (void *); */ /* Declare void __objc_execClass (void *); */
void_list_node = build_tree_list (NULL_TREE, void_type_node); void_list_node_1 = build_tree_list (NULL_TREE, void_type_node);
function_type function_type
= build_function_type (void_type_node, = build_function_type (void_type_node,
tree_cons (NULL_TREE, ptr_type_node, tree_cons (NULL_TREE, ptr_type_node,
void_list_node)); void_list_node_1));
function_decl = build_decl (FUNCTION_DECL, function_decl = build_decl (FUNCTION_DECL,
get_identifier (TAG_EXECCLASS), get_identifier (TAG_EXECCLASS),
function_type); function_type);
...@@ -1797,12 +1797,12 @@ build_module_descriptor () ...@@ -1797,12 +1797,12 @@ build_module_descriptor ()
/* void _GLOBAL_$I$<gnyf> () {objc_execClass (&L_OBJC_MODULES);} */ /* void _GLOBAL_$I$<gnyf> () {objc_execClass (&L_OBJC_MODULES);} */
start_function (void_list_node, start_function (void_list_node_1,
build_parse_node (CALL_EXPR, init_function_name, build_parse_node (CALL_EXPR, init_function_name,
/* This has the format of the output /* This has the format of the output
of get_parm_info. */ of get_parm_info. */
tree_cons (NULL_TREE, NULL_TREE, tree_cons (NULL_TREE, NULL_TREE,
void_list_node), void_list_node_1),
NULL_TREE), NULL_TREE),
NULL_TREE, NULL_TREE, 0); NULL_TREE, NULL_TREE, 0);
#if 0 /* This should be turned back on later #if 0 /* This should be turned back on later
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment