diff options
| author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2002-03-13 01:42:43 +0000 |
|---|---|---|
| committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2002-03-13 01:42:43 +0000 |
| commit | 2f9834e8055d89ec753d6bea65cb734dcd8f0dc0 (patch) | |
| tree | 2e0cc6a8c103f156968a4851003a3fc1f9435589 /gcc/cp | |
| parent | 36ad2436427c37bac46dc216589ed936f8106f2d (diff) | |
| download | gcc-2f9834e8055d89ec753d6bea65cb734dcd8f0dc0.zip gcc-2f9834e8055d89ec753d6bea65cb734dcd8f0dc0.tar.gz gcc-2f9834e8055d89ec753d6bea65cb734dcd8f0dc0.tar.bz2 | |
c-common.c (c_tree_code_type, [...]): Delete.
* c-common.c (c_tree_code_type, c_tree_code_length,
c_tree_code_name, add_c_tree_codes): Delete.
* c-common.h (add_c_tree_codes): Delete.
* c-lang.c (tree_code_type, tree_code_length, tree_code_name):
Define.
* c-objc-common.c (c_objc_common_init): Don't call
add_c_tree_codes, instead set lang_unsafe_for_reeval.
* objc/objc-act.c (objc_tree_code_type, objc_tree_code_length,
objc_tree_code_name, add_objc_tree_codes): Delete.
(objc_init): Don't call add_objc_tree_codes.
* objc/objc-lang.c (tree_code_type, tree_code_length,
tree_code_name): Define.
* toplev.c (lang_independent_init): Don't set
tree_code_length[IDENTIFIER_NODE].
* tree.c (tree_code_type, tree_code_length, tree_code_name):
Delete definitions, moved to language front-ends.
* tree.def (IDENTIFIER_NODE): Hardwire the length.
* tree.h (tree_code_type, tree_code_length, tree_code_name):
Const-ify.
(tree_code_length): Change type to unsigned char.
ada:
* misc.c (gnat_tree_code_type, gnat_tree_code_length,
gnat_tree_code_name): Delete.
(tree_code_type, tree_code_length, tree_code_name): Define.
(gnat_init): Don't try to copy into the various tree_code
arrays.
ch:
* decl.c (chill_tree_code_type, chill_tree_code_length,
chill_tree_code_name): Delete.
(tree_code_type, tree_code_length, tree_code_name): Define.
(init_decl_processing): Don't try to copy into the various
tree_code arrays.
cp:
* cp-lang.c (tree_code_type, tree_code_length, tree_code_name):
Define.
* decl.c (duplicate_decls): Use TREE_CODE_LENGTH, not
tree_code_length.
* lex.c (cplus_tree_code_type, cplus_tree_code_length,
cplus_tree_code_name): Delete.
(cxx_init): Don't call add_c_tree_codes, instead set
lang_unsafe_for_reeval. Don't try to copy into the various
tree_code arrays.
f:
* com.c (tree_code_type, tree_code_length, tree_code_name):
Define.
java:
* lang.c (java_tree_code_type, java_tree_code_length,
tree_code_name): Delete.
(tree_code_type, tree_code_length, tree_code_name): Define.
(java_init): Don't try to copy into the various tree_code
arrays.
From-SVN: r50705
Diffstat (limited to 'gcc/cp')
| -rw-r--r-- | gcc/cp/ChangeLog | 12 | ||||
| -rw-r--r-- | gcc/cp/cp-lang.c | 41 | ||||
| -rw-r--r-- | gcc/cp/decl.c | 2 | ||||
| -rw-r--r-- | gcc/cp/lex.c | 43 |
4 files changed, 55 insertions, 43 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e9d8283..7ff6499 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,15 @@ +2002-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * cp-lang.c (tree_code_type, tree_code_length, tree_code_name): + Define. + * decl.c (duplicate_decls): Use TREE_CODE_LENGTH, not + tree_code_length. + * lex.c (cplus_tree_code_type, cplus_tree_code_length, + cplus_tree_code_name): Delete. + (cxx_init): Don't call add_c_tree_codes, instead set + lang_unsafe_for_reeval. Don't try to copy into the various + tree_code arrays. + 2002-03-12 Nathan Sidwell <nathan@codesourcery.com> PR c++/5659 diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index da0718e..1a27136 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -152,6 +152,47 @@ ok_to_generate_alias_set_for_type (t) return true; } +/* Tree code classes. */ + +#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, + +const char tree_code_type[] = { +#include "tree.def" + 'x', +#include "c-common.def" + 'x', +#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 + /* Special routine to get the alias set for C++. */ static HOST_WIDE_INT diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9b5d3e9..2417202 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -3781,7 +3781,7 @@ duplicate_decls (newdecl, olddecl) memcpy ((char *) olddecl + sizeof (struct tree_common), (char *) newdecl + sizeof (struct tree_common), sizeof (struct tree_decl) - sizeof (struct tree_common) - + tree_code_length [(int)TREE_CODE (newdecl)] * sizeof (char *)); + + TREE_CODE_LENGTH (TREE_CODE (newdecl)) * sizeof (char *)); } DECL_UID (olddecl) = olddecl_uid; diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 1eb7075..5990df9 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -205,37 +205,6 @@ int interface_only; /* whether or not current file is only for int interface_unknown; /* whether or not we know this class to behave according to #pragma interface. */ -/* Tree code classes. */ - -#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, - -static const char cplus_tree_code_type[] = { - 'x', -#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, - -static const int cplus_tree_code_length[] = { - 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, - -static const char *const cplus_tree_code_name[] = { - "@@dummy", -#include "cp-tree.def" -}; -#undef DEFTREECODE /* Post-switch processing. */ void @@ -682,17 +651,7 @@ cxx_init (filename) init_cplus_expand (); init_cp_semantics (); - add_c_tree_codes (); - - memcpy (tree_code_type + (int) LAST_C_TREE_CODE, - cplus_tree_code_type, - (int)LAST_CPLUS_TREE_CODE - (int)LAST_C_TREE_CODE); - memcpy (tree_code_length + (int) LAST_C_TREE_CODE, - cplus_tree_code_length, - (LAST_CPLUS_TREE_CODE - (int)LAST_C_TREE_CODE) * sizeof (int)); - memcpy (tree_code_name + (int) LAST_C_TREE_CODE, - cplus_tree_code_name, - (LAST_CPLUS_TREE_CODE - (int)LAST_C_TREE_CODE) * sizeof (char *)); + lang_unsafe_for_reeval = c_unsafe_for_reeval; init_operators (); init_method (); |
