Commit c0ed0531 by Ian Lance Taylor Committed by Ian Lance Taylor

tree.h (enum tree_code): Include all-tree.def, not tree.def.

	* tree.h (enum tree_code): Include all-tree.def, not tree.def.
	Define END_OF_BASE_TREE_CODES around inclusion.
	* tree.c (tree_code_type): New global array.
	(tree_code_length, tree_code_name): Likewise.
	* Makefile.in (TREE_H): Add all-tree.def, c-common.def, and
	$(lang_tree_files).
	(all-tree.def, s-alltree): New targets.
	(gencheck.h, s-gencheck): Remove.
	(tree.o): Depend upon all-tree.def.
	(build/gencheck.o): Remove gencheck.h dependency.
	(mostlyclean): Don't remove gencheck.h.
	* c-common.h (enum c_tree_code): Remove.
	* c-lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* gencheck.c (tree_codes): Include all-tree.def, rather than
	tree.def, c-common.def, and gencheck.h.  Undefined DEFTREECODE
	after it is used.
	* tree-browser.c (tb_tree_codes): Include all-tree.def, rather
	than tree.def.
	* cp/cp-tree.h (enum cplus_tree_code): Remove.
	(operator_name_info): Size to MAX_TREE_CODES.
	(assignment_operator_name_info): Likewise.
	* cp/cp-lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* cp/lex.c (operator_name_info): Size to MAX_TREE_CODES.
	(assignment_operator_name_info): Likewise.
	* cp/decl.c (grok_op_properties): Change LAST_CPLUS_TREE_CODE to
	MAX_TREE_CODES.
	* cp/mangle.c (write_expression): Likewise.
	* cp/Make-lang.in (CXX_TREE_H): Remove cp/cp-tree.def.
	* fortran/f95-lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* java/java-tree.h (enum java_tree_code): Remove.
	* java/lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* java/Make-lang.in (JAVA_TREE_H): Remove java/java-tree.def.
	* objc/objc-act.h (enum objc_tree_code): Remove.
	* objc/objc-lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* objcp/objcp-lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* ada/ada-tree.h (enum gnat_tree_code): Remove.
	* ada/Make-lang.in (ADA_TREE_H): Remove ada/ada-tre.def.
	* ada/misc.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.

From-SVN: r137006
parent 14e5606b
2008-06-21 Ian Lance Taylor <iant@google.com>
* tree.h (enum tree_code): Include all-tree.def, not tree.def.
Define END_OF_BASE_TREE_CODES around inclusion.
* tree.c (tree_code_type): New global array.
(tree_code_length, tree_code_name): Likewise.
* Makefile.in (TREE_H): Add all-tree.def, c-common.def, and
$(lang_tree_files).
(all-tree.def, s-alltree): New targets.
(gencheck.h, s-gencheck): Remove.
(tree.o): Depend upon all-tree.def.
(build/gencheck.o): Remove gencheck.h dependency.
(mostlyclean): Don't remove gencheck.h.
* c-common.h (enum c_tree_code): Remove.
* c-lang.c (tree_code_type): Remove.
(tree_code_length, tree_code_name): Remove.
* gencheck.c (tree_codes): Include all-tree.def, rather than
tree.def, c-common.def, and gencheck.h. Undefined DEFTREECODE
after it is used.
* tree-browser.c (tb_tree_codes): Include all-tree.def, rather
than tree.def.
* cp/cp-tree.h (enum cplus_tree_code): Remove.
(operator_name_info): Size to MAX_TREE_CODES.
(assignment_operator_name_info): Likewise.
* cp/cp-lang.c (tree_code_type): Remove.
(tree_code_length, tree_code_name): Remove.
* cp/lex.c (operator_name_info): Size to MAX_TREE_CODES.
(assignment_operator_name_info): Likewise.
* cp/decl.c (grok_op_properties): Change LAST_CPLUS_TREE_CODE to
MAX_TREE_CODES.
* cp/mangle.c (write_expression): Likewise.
* cp/Make-lang.in (CXX_TREE_H): Remove cp/cp-tree.def.
* fortran/f95-lang.c (tree_code_type): Remove.
(tree_code_length, tree_code_name): Remove.
* java/java-tree.h (enum java_tree_code): Remove.
* java/lang.c (tree_code_type): Remove.
(tree_code_length, tree_code_name): Remove.
* java/Make-lang.in (JAVA_TREE_H): Remove java/java-tree.def.
* objc/objc-act.h (enum objc_tree_code): Remove.
* objc/objc-lang.c (tree_code_type): Remove.
(tree_code_length, tree_code_name): Remove.
* objcp/objcp-lang.c (tree_code_type): Remove.
(tree_code_length, tree_code_name): Remove.
* ada/ada-tree.h (enum gnat_tree_code): Remove.
* ada/Make-lang.in (ADA_TREE_H): Remove ada/ada-tre.def.
* ada/misc.c (tree_code_type): Remove.
(tree_code_length, tree_code_name): Remove.
2008-06-21 Bernhard Fischer <aldot@gcc.gnu.org> 2008-06-21 Bernhard Fischer <aldot@gcc.gnu.org>
* tree-ssa-pre.c (fini_antic): Bitmap_sets have to be freed before * tree-ssa-pre.c (fini_antic): Bitmap_sets have to be freed before
......
...@@ -772,7 +772,8 @@ RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H) reg-notes.def insn-notes.def \ ...@@ -772,7 +772,8 @@ RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H) reg-notes.def insn-notes.def \
RTL_H = $(RTL_BASE_H) genrtl.h RTL_H = $(RTL_BASE_H) genrtl.h
PARAMS_H = params.h params.def PARAMS_H = params.h params.def
BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def
TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h $(BUILTINS_DEF) \ TREE_H = tree.h all-tree.def tree.def c-common.def $(lang_tree_files) \
$(MACHMODE_H) tree-check.h $(BUILTINS_DEF) \
input.h statistics.h vec.h treestruct.def $(HASHTAB_H) \ input.h statistics.h vec.h treestruct.def $(HASHTAB_H) \
double-int.h alias.h double-int.h alias.h
BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h $(PARTITION_H) \ BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h $(PARTITION_H) \
...@@ -1376,6 +1377,19 @@ ifneq ($(xmake_file),) ...@@ -1376,6 +1377,19 @@ ifneq ($(xmake_file),)
include $(xmake_file) include $(xmake_file)
endif endif
# all-tree.def includes all the tree.def files.
all-tree.def: s-alltree; @true
s-alltree: Makefile
rm -f tmp-all-tree.def
echo '#include "tree.def"' > tmp-all-tree.def
echo 'END_OF_BASE_TREE_CODES' >> tmp-all-tree.def
echo '#include "c-common.def"' >> tmp-all-tree.def
ltf="$(lang_tree_files)"; for f in $$ltf; do \
echo "#include \"$$f\""; \
done | sed 's|$(srcdir)/||' >> tmp-all-tree.def
$(SHELL) $(srcdir)/../move-if-change tmp-all-tree.def all-tree.def
$(STAMP) s-alltree
# #
# ----------------------------- # -----------------------------
...@@ -1895,14 +1909,6 @@ gccspec.o: gccspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) ...@@ -1895,14 +1909,6 @@ gccspec.o: gccspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H)
cppspec.o: cppspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) cppspec.o: cppspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H)
gencheck.h : s-gencheck ; @true
s-gencheck : Makefile
ltf="$(lang_tree_files)"; for f in $$ltf; do \
echo "#include \"$$f\""; \
done | sed 's|$(srcdir)/||' > tmp-gencheck.h
$(SHELL) $(srcdir)/../move-if-change tmp-gencheck.h gencheck.h
$(STAMP) s-gencheck
specs.h : s-specs ; @true specs.h : s-specs ; @true
s-specs : Makefile s-specs : Makefile
lsf="$(lang_specs_files)"; for f in $$lsf; do \ lsf="$(lang_specs_files)"; for f in $$lsf; do \
...@@ -1984,7 +1990,7 @@ langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ ...@@ -1984,7 +1990,7 @@ langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
langhooks.h $(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) $(DIAGNOSTIC_H) intl.h \ langhooks.h $(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) $(DIAGNOSTIC_H) intl.h \
$(TREE_GIMPLE_H) $(TREE_GIMPLE_H)
tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(FLAGS_H) $(FUNCTION_H) $(PARAMS_H) \ all-tree.def $(FLAGS_H) $(FUNCTION_H) $(PARAMS_H) \
toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \ toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \
$(REAL_H) gt-tree.h tree-iterator.h $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ $(REAL_H) gt-tree.h tree-iterator.h $(BASIC_BLOCK_H) $(TREE_FLOW_H) \
$(OBSTACK_H) pointer-set.h fixed-value.h $(OBSTACK_H) pointer-set.h fixed-value.h
...@@ -3239,7 +3245,7 @@ build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) \ ...@@ -3239,7 +3245,7 @@ build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) \
build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \ build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \
$(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h vec.h \ $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h vec.h \
$(HASHTAB_H) gensupport.h $(HASHTAB_H) gensupport.h
build/gencheck.o : gencheck.c gencheck.h tree.def $(BCONFIG_H) $(GTM_H) \ build/gencheck.o : gencheck.c tree.def $(BCONFIG_H) $(GTM_H) \
$(SYSTEM_H) coretypes.h $(lang_tree_files) $(SYSTEM_H) coretypes.h $(lang_tree_files)
build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H) build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H)
build/gencodes.o : gencodes.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ build/gencodes.o : gencodes.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
...@@ -3863,7 +3869,7 @@ mostlyclean: lang.mostlyclean ...@@ -3863,7 +3869,7 @@ mostlyclean: lang.mostlyclean
-rm -f mddeps.mk -rm -f mddeps.mk
# Delete other built files. # Delete other built files.
-rm -f xsys-protos.hT -rm -f xsys-protos.hT
-rm -f specs.h gencheck.h options.c options.h -rm -f specs.h options.c options.h
# Delete the stamp and temporary files. # Delete the stamp and temporary files.
-rm -f s-* tmp-* stamp-* stmp-* -rm -f s-* tmp-* stamp-* stmp-*
-rm -f */stamp-* */tmp-* -rm -f */stamp-* */tmp-*
......
...@@ -980,7 +980,7 @@ ada/sdefault.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ...@@ -980,7 +980,7 @@ ada/sdefault.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/s-wchcon.ads ada/system.ads ada/table.adb ada/table.ads ada/tree_io.ads \ ada/s-wchcon.ads ada/system.ads ada/table.adb ada/table.ads ada/tree_io.ads \
ada/types.ads ada/unchdeal.ads ada/unchconv.ads ada/types.ads ada/unchdeal.ads ada/unchconv.ads
ADA_TREE_H = ada/ada-tree.h ada/ada-tree.def ADA_TREE_H = ada/ada-tree.h
# force debugging information on s-tasdeb.o so that it is always # force debugging information on s-tasdeb.o so that it is always
# possible to set conditional breakpoints on tasks. # possible to set conditional breakpoints on tasks.
......
...@@ -23,15 +23,6 @@ ...@@ -23,15 +23,6 @@
* * * *
****************************************************************************/ ****************************************************************************/
/* Ada language-specific GC tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
enum gnat_tree_code {
__DUMMY = LAST_AND_UNUSED_TREE_CODE,
#include "ada-tree.def"
LAST_GNAT_TREE_CODE
};
#undef DEFTREECODE
/* Ada uses the lang_decl and lang_type fields to hold a tree. */ /* Ada uses the lang_decl and lang_type fields to hold a tree. */
union lang_tree_node union lang_tree_node
GTY((desc ("0"), GTY((desc ("0"),
......
...@@ -160,45 +160,6 @@ static tree gnat_type_max_size (const_tree); ...@@ -160,45 +160,6 @@ static tree gnat_type_max_size (const_tree);
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
/* Tables describing GCC tree codes used only by GNAT.
Table indexed by tree code giving a string containing a character
classifying the tree code. Possibilities are
t, d, s, c, r, <, 1 and 2. See cp-tree.def for details. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
const enum tree_code_class tree_code_type[] = {
#include "tree.def"
tcc_exceptional,
#include "ada-tree.def"
};
#undef DEFTREECODE
/* Table indexed by tree code giving number of expression
operands beyond the fixed part of the node structure.
Not used for types or decls. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
const unsigned char tree_code_length[] = {
#include "tree.def"
0,
#include "ada-tree.def"
};
#undef DEFTREECODE
/* Names of tree components.
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
const char *const tree_code_name[] = {
#include "tree.def"
"@@dummy",
#include "ada-tree.def"
};
#undef DEFTREECODE
/* How much we want of our DWARF extensions. Some of our dwarf+ extensions /* How much we want of our DWARF extensions. Some of our dwarf+ extensions
are incompatible with regular GDB versions, so we must make sure to only are incompatible with regular GDB versions, so we must make sure to only
produce them on explicit request. This is eventually reflected into the produce them on explicit request. This is eventually reflected into the
......
...@@ -763,16 +763,6 @@ extern void finish_file (void); ...@@ -763,16 +763,6 @@ extern void finish_file (void);
#define COMPOUND_LITERAL_EXPR_DECL(NODE) \ #define COMPOUND_LITERAL_EXPR_DECL(NODE) \
DECL_EXPR_DECL (COMPOUND_LITERAL_EXPR_DECL_STMT (NODE)) DECL_EXPR_DECL (COMPOUND_LITERAL_EXPR_DECL_STMT (NODE))
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
enum c_tree_code {
C_DUMMY_TREE_CODE = LAST_AND_UNUSED_TREE_CODE,
#include "c-common.def"
LAST_C_TREE_CODE
};
#undef DEFTREECODE
extern int anon_aggr_type_p (const_tree); extern int anon_aggr_type_p (const_tree);
/* For a VAR_DECL that is an anonymous union, these are the various /* For a VAR_DECL that is an anonymous union, these are the various
......
...@@ -47,41 +47,6 @@ enum c_language_kind c_language = clk_c; ...@@ -47,41 +47,6 @@ enum c_language_kind c_language = clk_c;
/* Each front end provides its own lang hook initializer. */ /* Each front end provides its own lang hook initializer. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
/* Tree code classes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
const enum tree_code_class tree_code_type[] = {
#include "tree.def"
tcc_exceptional,
#include "c-common.def"
};
#undef DEFTREECODE
/* Table indexed by tree code giving number of expression
operands beyond the fixed part of the node structure.
Not used for types or decls. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
const unsigned char tree_code_length[] = {
#include "tree.def"
0,
#include "c-common.def"
};
#undef DEFTREECODE
/* Names of tree components.
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
const char *const tree_code_name[] = {
#include "tree.def"
"@@dummy",
#include "c-common.def"
};
#undef DEFTREECODE
/* Final processing of file-scope data. The Objective-C version of /* Final processing of file-scope data. The Objective-C version of
this function still does something. */ this function still does something. */
void void
......
...@@ -222,7 +222,7 @@ c++.stagefeedback: stagefeedback-start ...@@ -222,7 +222,7 @@ c++.stagefeedback: stagefeedback-start
# #
# .o: .h dependencies. # .o: .h dependencies.
CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h $(C_COMMON_H) \ CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h $(C_COMMON_H) \
cp/cp-tree.def c-common.def $(FUNCTION_H) $(VARRAY_H) \ c-common.def $(FUNCTION_H) $(VARRAY_H) \
$(SYSTEM_H) coretypes.h $(CONFIG_H) $(TARGET_H) $(GGC_H) \ $(SYSTEM_H) coretypes.h $(CONFIG_H) $(TARGET_H) $(GGC_H) \
$(srcdir)/../include/hashtab.h $(srcdir)/../include/splay-tree.h $(srcdir)/../include/hashtab.h $(srcdir)/../include/splay-tree.h
......
...@@ -61,47 +61,6 @@ static enum classify_record cp_classify_record (tree type); ...@@ -61,47 +61,6 @@ static enum classify_record cp_classify_record (tree type);
/* Each front end provides its own lang hook initializer. */ /* Each front end provides its own lang hook initializer. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
/* Tree code classes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
const enum tree_code_class tree_code_type[] = {
#include "tree.def"
tcc_exceptional,
#include "c-common.def"
tcc_exceptional,
#include "cp-tree.def"
};
#undef DEFTREECODE
/* Table indexed by tree code giving number of expression
operands beyond the fixed part of the node structure.
Not used for types or decls. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
const unsigned char tree_code_length[] = {
#include "tree.def"
0,
#include "c-common.def"
0,
#include "cp-tree.def"
};
#undef DEFTREECODE
/* Names of tree components.
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
const char *const tree_code_name[] = {
#include "tree.def"
"@@dummy",
#include "c-common.def"
"@@dummy",
#include "cp-tree.def"
};
#undef DEFTREECODE
/* Lang hook routines common to C++ and ObjC++ appear in cp/cp-objcp-common.c; /* Lang hook routines common to C++ and ObjC++ appear in cp/cp-objcp-common.c;
there should be very few routines below. */ there should be very few routines below. */
......
...@@ -926,15 +926,6 @@ struct language_function GTY(()) ...@@ -926,15 +926,6 @@ struct language_function GTY(())
((NODE) == error_mark_node \ ((NODE) == error_mark_node \
|| ((NODE) && TREE_TYPE ((NODE)) == error_mark_node)) || ((NODE) && TREE_TYPE ((NODE)) == error_mark_node))
/* C++ language-specific tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
enum cplus_tree_code {
CP_DUMMY_TREE_CODE = LAST_C_TREE_CODE,
#include "cp-tree.def"
LAST_CPLUS_TREE_CODE
};
#undef DEFTREECODE
/* TRUE if a tree code represents a statement. */ /* TRUE if a tree code represents a statement. */
extern bool statement_code_p[MAX_TREE_CODES]; extern bool statement_code_p[MAX_TREE_CODES];
...@@ -3865,10 +3856,10 @@ typedef struct operator_name_info_t GTY(()) ...@@ -3865,10 +3856,10 @@ typedef struct operator_name_info_t GTY(())
/* A mapping from tree codes to operator name information. */ /* A mapping from tree codes to operator name information. */
extern GTY(()) operator_name_info_t operator_name_info extern GTY(()) operator_name_info_t operator_name_info
[(int) LAST_CPLUS_TREE_CODE]; [(int) MAX_TREE_CODES];
/* Similar, but for assignment operators. */ /* Similar, but for assignment operators. */
extern GTY(()) operator_name_info_t assignment_operator_name_info extern GTY(()) operator_name_info_t assignment_operator_name_info
[(int) LAST_CPLUS_TREE_CODE]; [(int) MAX_TREE_CODES];
/* A type-qualifier, or bitmask therefore, using the TYPE_QUAL /* A type-qualifier, or bitmask therefore, using the TYPE_QUAL
constants. */ constants. */
......
...@@ -9773,7 +9773,7 @@ grok_op_properties (tree decl, bool complain) ...@@ -9773,7 +9773,7 @@ grok_op_properties (tree decl, bool complain)
gcc_unreachable (); gcc_unreachable ();
} }
while (0); while (0);
gcc_assert (operator_code != LAST_CPLUS_TREE_CODE); gcc_assert (operator_code != MAX_TREE_CODES);
SET_OVERLOADED_OPERATOR_CODE (decl, operator_code); SET_OVERLOADED_OPERATOR_CODE (decl, operator_code);
if (class_type) if (class_type)
......
...@@ -89,9 +89,9 @@ cxx_finish (void) ...@@ -89,9 +89,9 @@ cxx_finish (void)
} }
/* A mapping from tree codes to operator name information. */ /* A mapping from tree codes to operator name information. */
operator_name_info_t operator_name_info[(int) LAST_CPLUS_TREE_CODE]; operator_name_info_t operator_name_info[(int) MAX_TREE_CODES];
/* Similar, but for assignment operators. */ /* Similar, but for assignment operators. */
operator_name_info_t assignment_operator_name_info[(int) LAST_CPLUS_TREE_CODE]; operator_name_info_t assignment_operator_name_info[(int) MAX_TREE_CODES];
/* Initialize data structures that keep track of operator names. */ /* Initialize data structures that keep track of operator names. */
......
...@@ -2108,7 +2108,7 @@ write_expression (tree expr) ...@@ -2108,7 +2108,7 @@ write_expression (tree expr)
/* Unfortunately, there is no easy way to go from the /* Unfortunately, there is no easy way to go from the
name of the operator back to the corresponding tree name of the operator back to the corresponding tree
code. */ code. */
for (i = 0; i < LAST_CPLUS_TREE_CODE; ++i) for (i = 0; i < MAX_TREE_CODES; ++i)
if (operator_name_info[i].identifier == member) if (operator_name_info[i].identifier == member)
{ {
/* The ABI says that we prefer binary operator /* The ABI says that we prefer binary operator
......
...@@ -154,40 +154,6 @@ static alias_set_type gfc_get_alias_set (tree); ...@@ -154,40 +154,6 @@ static alias_set_type gfc_get_alias_set (tree);
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
/* A list (chain of TREE_LIST nodes) of all LABEL_DECLs in the function
that have names. Here so we can clear out their names' definitions
at the end of the function. */
/* Tree code classes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
const enum tree_code_class tree_code_type[] = {
#include "tree.def"
};
#undef DEFTREECODE
/* Table indexed by tree code giving number of expression
operands beyond the fixed part of the node structure.
Not used for types or decls. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
const unsigned char tree_code_length[] = {
#include "tree.def"
};
#undef DEFTREECODE
/* Names of tree components.
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
const char *const tree_code_name[] = {
#include "tree.def"
};
#undef DEFTREECODE
#define NULL_BINDING_LEVEL (struct binding_level *) NULL #define NULL_BINDING_LEVEL (struct binding_level *) NULL
/* A chain of binding_level structures awaiting reuse. */ /* A chain of binding_level structures awaiting reuse. */
......
...@@ -24,14 +24,16 @@ along with GCC; see the file COPYING3. If not see ...@@ -24,14 +24,16 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h" #include "tm.h"
#define DEFTREECODE(SYM, NAME, TYPE, LEN) #SYM, #define DEFTREECODE(SYM, NAME, TYPE, LEN) #SYM,
#define END_OF_BASE_TREE_CODES
static const char *const tree_codes[] = { static const char *const tree_codes[] = {
#include "tree.def" #include "all-tree.def"
#include "c-common.def"
#include "gencheck.h"
(char*) 0 (char*) 0
}; };
#undef DEFTREECODE
#undef END_OF_BASE_TREE_CODES
static void usage (void); static void usage (void);
static void static void
......
...@@ -242,7 +242,7 @@ java.stagefeedback: stageprofile-start ...@@ -242,7 +242,7 @@ java.stagefeedback: stageprofile-start
# #
# .o:.h dependencies. # .o:.h dependencies.
JAVA_TREE_H = $(TREE_H) $(HASHTAB_H) java/java-tree.h java/java-tree.def JAVA_TREE_H = $(TREE_H) $(HASHTAB_H) java/java-tree.h
java/jcf-dump.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(JAVA_TREE_H) \ java/jcf-dump.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(JAVA_TREE_H) \
java/jcf-dump.c java/jcf-reader.c java/jcf.h java/javaop.h java/javaop.def \ java/jcf-dump.c java/jcf-reader.c java/jcf.h java/javaop.h java/javaop.def \
......
...@@ -30,15 +30,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -30,15 +30,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "hashtab.h" #include "hashtab.h"
/* Java language-specific tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
enum java_tree_code {
__DUMMY = LAST_AND_UNUSED_TREE_CODE,
#include "java-tree.def"
LAST_JAVA_TREE_CODE
};
#undef DEFTREECODE
struct JCF; struct JCF;
/* Usage of TREE_LANG_FLAG_?: /* Usage of TREE_LANG_FLAG_?:
......
...@@ -69,43 +69,6 @@ static enum classify_record java_classify_record (tree type); ...@@ -69,43 +69,6 @@ static enum classify_record java_classify_record (tree type);
# define TARGET_OBJECT_SUFFIX ".o" # define TARGET_OBJECT_SUFFIX ".o"
#endif #endif
/* Table indexed by tree code giving a string containing a character
classifying the tree code. Possibilities are
t, d, s, c, r, <, 1 and 2. See java/java-tree.def for details. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
const enum tree_code_class tree_code_type[] = {
#include "tree.def"
tcc_exceptional,
#include "java-tree.def"
};
#undef DEFTREECODE
/* Table indexed by tree code giving number of expression
operands beyond the fixed part of the node structure.
Not used for types or decls. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
const unsigned char tree_code_length[] = {
#include "tree.def"
0,
#include "java-tree.def"
};
#undef DEFTREECODE
/* Names of tree components.
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
const char *const tree_code_name[] = {
#include "tree.def"
"@@dummy",
#include "java-tree.def"
};
#undef DEFTREECODE
/* Table of machine-independent attributes. */ /* Table of machine-independent attributes. */
const struct attribute_spec java_attribute_table[] = const struct attribute_spec java_attribute_table[] =
{ {
......
...@@ -122,24 +122,6 @@ enum gimplify_status objc_gimplify_expr (tree *, tree *, tree *); ...@@ -122,24 +122,6 @@ enum gimplify_status objc_gimplify_expr (tree *, tree *, tree *);
#define OBJC_TYPE_NAME(TYPE) TYPE_NAME(TYPE) #define OBJC_TYPE_NAME(TYPE) TYPE_NAME(TYPE)
#define OBJC_SET_TYPE_NAME(TYPE, NAME) (TYPE_NAME (TYPE) = NAME) #define OBJC_SET_TYPE_NAME(TYPE, NAME) (TYPE_NAME (TYPE) = NAME)
/* Define the Objective-C or Objective-C++ language-specific tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
enum objc_tree_code {
#if defined (GCC_CP_TREE_H)
LAST_BASE_TREE_CODE = LAST_CPLUS_TREE_CODE,
#else
#if defined (GCC_C_TREE_H)
LAST_BASE_TREE_CODE = LAST_C_TREE_CODE,
#else
#error You must include <c-tree.h> or <cp/cp-tree.h> before <objc/objc-act.h>
#endif
#endif
#include "objc-tree.def"
LAST_OBJC_TREE_CODE
};
#undef DEFTREECODE
/* Hash tables to manage the global pool of method prototypes. */ /* Hash tables to manage the global pool of method prototypes. */
typedef struct hashed_entry *hash; typedef struct hashed_entry *hash;
......
...@@ -56,48 +56,6 @@ static void objc_init_ts (void); ...@@ -56,48 +56,6 @@ static void objc_init_ts (void);
/* Each front end provides its own lang hook initializer. */ /* Each front end provides its own lang hook initializer. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
/* Table indexed by tree code giving a string containing a character
classifying the tree code. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
const enum tree_code_class tree_code_type[] = {
#include "tree.def"
tcc_exceptional,
#include "c-common.def"
tcc_exceptional,
#include "objc-tree.def"
};
#undef DEFTREECODE
/* Table indexed by tree code giving number of expression
operands beyond the fixed part of the node structure.
Not used for types or decls. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
const unsigned char tree_code_length[] = {
#include "tree.def"
0,
#include "c-common.def"
0,
#include "objc-tree.def"
};
#undef DEFTREECODE
/* Names of tree components.
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
const char * const tree_code_name[] = {
#include "tree.def"
"@@dummy",
#include "c-common.def"
"@@dummy",
#include "objc-tree.def"
};
#undef DEFTREECODE
/* Lang hook routines common to C and ObjC appear in c-objc-common.c; /* Lang hook routines common to C and ObjC appear in c-objc-common.c;
there should be very few (if any) routines below. */ there should be very few (if any) routines below. */
......
...@@ -56,53 +56,6 @@ static void objcxx_init_ts (void); ...@@ -56,53 +56,6 @@ static void objcxx_init_ts (void);
/* Each front end provides its own lang hook initializer. */ /* Each front end provides its own lang hook initializer. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
/* Tree code classes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
const enum tree_code_class tree_code_type[] = {
#include "tree.def"
tcc_exceptional,
#include "c-common.def"
tcc_exceptional,
#include "cp-tree.def"
tcc_exceptional,
#include "objc-tree.def"
};
#undef DEFTREECODE
/* Table indexed by tree code giving number of expression
operands beyond the fixed part of the node structure.
Not used for types or decls. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
const unsigned char tree_code_length[] = {
#include "tree.def"
0,
#include "c-common.def"
0,
#include "cp-tree.def"
0,
#include "objc-tree.def"
};
#undef DEFTREECODE
/* Names of tree components.
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
const char *const tree_code_name[] = {
#include "tree.def"
"@@dummy",
#include "c-common.def"
"@@dummy",
#include "cp-tree.def"
"@@dummy",
#include "objc-tree.def"
};
#undef DEFTREECODE
/* Lang hook routines common to C++ and ObjC++ appear in cp/cp-objcp-common.c; /* Lang hook routines common to C++ and ObjC++ appear in cp/cp-objcp-common.c;
there should be very few (if any) routines below. */ there should be very few (if any) routines below. */
......
...@@ -71,11 +71,14 @@ struct tb_tree_code { ...@@ -71,11 +71,14 @@ struct tb_tree_code {
}; };
#define DEFTREECODE(SYM, STRING, TYPE, NARGS) { SYM, STRING, sizeof (STRING) - 1 }, #define DEFTREECODE(SYM, STRING, TYPE, NARGS) { SYM, STRING, sizeof (STRING) - 1 },
#define END_OF_BASE_TREE_CODES \
{ LAST_AND_UNUSED_TREE_CODE, "@dummy", sizeof ("@dummy") - 1 },
static const struct tb_tree_code tb_tree_codes[] = static const struct tb_tree_code tb_tree_codes[] =
{ {
#include "tree.def" #include "all-tree.def"
}; };
#undef DEFTREECODE #undef DEFTREECODE
#undef END_OF_BASE_TREE_CODES
#define TB_TREE_CODE(N) (tb_tree_codes[N].code) #define TB_TREE_CODE(N) (tb_tree_codes[N].code)
#define TB_TREE_CODE_TEXT(N) (tb_tree_codes[N].code_string) #define TB_TREE_CODE_TEXT(N) (tb_tree_codes[N].code_string)
......
...@@ -52,6 +52,44 @@ along with GCC; see the file COPYING3. If not see ...@@ -52,6 +52,44 @@ along with GCC; see the file COPYING3. If not see
#include "pointer-set.h" #include "pointer-set.h"
#include "fixed-value.h" #include "fixed-value.h"
/* Tree code classes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
#define END_OF_BASE_TREE_CODES tcc_exceptional,
const enum tree_code_class tree_code_type[] = {
#include "all-tree.def"
};
#undef DEFTREECODE
#undef END_OF_BASE_TREE_CODES
/* Table indexed by tree code giving number of expression
operands beyond the fixed part of the node structure.
Not used for types or decls. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
#define END_OF_BASE_TREE_CODES 0,
const unsigned char tree_code_length[] = {
#include "all-tree.def"
};
#undef DEFTREECODE
#undef END_OF_BASE_TREE_CODES
/* Names of tree components.
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
#define END_OF_BASE_TREE_CODES "@dummy",
const char *const tree_code_name[] = {
#include "all-tree.def"
};
#undef DEFTREECODE
#undef END_OF_BASE_TREE_CODES
/* Each tree code class has an associated string representation. /* Each tree code class has an associated string representation.
These must correspond to the tree_code_class entries. */ These must correspond to the tree_code_class entries. */
......
...@@ -33,17 +33,16 @@ along with GCC; see the file COPYING3. If not see ...@@ -33,17 +33,16 @@ along with GCC; see the file COPYING3. If not see
/* Codes of tree nodes */ /* Codes of tree nodes */
#define DEFTREECODE(SYM, STRING, TYPE, NARGS) SYM, #define DEFTREECODE(SYM, STRING, TYPE, NARGS) SYM,
#define END_OF_BASE_TREE_CODES LAST_AND_UNUSED_TREE_CODE,
enum tree_code { enum tree_code {
#include "tree.def" #include "all-tree.def"
MAX_TREE_CODES
LAST_AND_UNUSED_TREE_CODE /* A convenient way to get a value for
NUM_TREE_CODES. */
}; };
#undef DEFTREECODE #undef DEFTREECODE
#undef END_OF_BASE_TREE_CODES
#define MAX_TREE_CODES 512
extern unsigned char tree_contains_struct[MAX_TREE_CODES][64]; extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
#define CODE_CONTAINS_STRUCT(CODE, STRUCT) (tree_contains_struct[(CODE)][(STRUCT)]) #define CODE_CONTAINS_STRUCT(CODE, STRUCT) (tree_contains_struct[(CODE)][(STRUCT)])
......
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