diff options
author | chelf <chelf@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-06-17 02:37:23 +0000 |
---|---|---|
committer | chelf <chelf@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-06-17 02:37:23 +0000 |
commit | 51444f0d6cc406e37f802123bb38208bc3c66ab7 (patch) | |
tree | 0de1cb8ed60b2da04d155bdb3c2d0ec60c45632c | |
parent | edb5e81d85e5f0f3396fee13a4662c5221a464ca (diff) | |
download | gcc-51444f0d6cc406e37f802123bb38208bc3c66ab7.tar.gz |
* c-common.c (c_tree_code_type): New array.
(c_tree_code_length): Likewise.
(c_tree_code_name): Likewise.
(add_c_tree_codes): New function.
* c-common.h (add_c_tree_codes): Declare.
(enum c_tree_code): New enum.
* c-lex.c (init_parse): Added call to add_c_tree_codes.
* cp/cp-tree.h (enum cplus_tree_code): Changed __DUMMY to
CP_DUMMY_TREE_CODE. Remove #include "c-common.def".
* cp/lex.c (cplus_tree_code_type[]): Removed #include "c-common.def".
(cplus_tree_code_length[]): Likewise.
(cplus_tree_code_name[]): Likewise.
(init_parse): Added call to add_c_tree_codes. Changed
LAST_AND_UNUSED_TREE_CODE to LAST_C_TREE_CODE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34577 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/c-common.c | 49 | ||||
-rw-r--r-- | gcc/c-common.h | 13 | ||||
-rw-r--r-- | gcc/c-lex.c | 2 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 3 | ||||
-rw-r--r-- | gcc/cp/lex.c | 22 |
7 files changed, 100 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 90f25e27d5f..1a6a25fd75f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2000-06-16 Benjamin Chelf <chelf@codesourcery.com> + + * c-common.c (c_tree_code_type): New array. + (c_tree_code_length): Likewise. + (c_tree_code_name): Likewise. + (add_c_tree_codes): New function. + + * c-common.h (add_c_tree_codes): Declare. + (enum c_tree_code): New enum. + + * c-lex.c (init_parse): Added call to add_c_tree_codes. + 2000-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * fixinc/inclhack.def (ctrl_quotes_def, io_quotes_def): Modify @@ -37,7 +49,7 @@ Wed Jun 14 23:46:26 2000 J"orn Rennecke <amylaar@cygnus.co.uk> (print_operand): Remove unused variables neg and op. (toc_hash_mark_entry): Fix prototype. -2000-06-14 Benjamin Chelf <chelf@cabriolet.stanford.edu> +2000-06-14 Benjamin Chelf <chelf@codesourcery.com> * c-common.h (IF_COND): Moved here from cp/cp-tree.h. (THEN_CLAUSE): Likewise. diff --git a/gcc/c-common.c b/gcc/c-common.c index 445ec0941c4..f74cad28ab8 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -3962,3 +3962,52 @@ expand_tree_builtin (function, params, coerced_params) return NULL_TREE; } + +/* Tree code classes. */ + +#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, + +static char c_tree_code_type[] = { + 'x', +#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, + +static int c_tree_code_length[] = { + 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, + +static const char *c_tree_code_name[] = { + "@@dummy", +#include "c-common.def" +}; +#undef DEFTREECODE + +/* Adds the tree codes specific to the C front end to the list of all + tree codes. */ + +void +add_c_tree_codes (void) +{ + memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE, + c_tree_code_type, + (int)LAST_C_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE); + memcpy (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE, + c_tree_code_length, + (LAST_C_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (int)); + memcpy (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE, + c_tree_code_name, + (LAST_C_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (char *)); +} diff --git a/gcc/c-common.h b/gcc/c-common.h index 4b5cb97760a..81a5127dbf4 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -246,3 +246,16 @@ extern tree simple_type_promotes_to PARAMS ((tree)); function ended. */ #define STMT_LINENO_FOR_FN_P(NODE) \ (TREE_LANG_FLAG_2 ((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 void add_c_tree_codes PARAMS ((void)); diff --git a/gcc/c-lex.c b/gcc/c-lex.c index beda889d589..2e6e5a9ad88 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -252,6 +252,8 @@ init_parse (filename) cpp_token = CPP_DIRECTIVE; #endif + add_c_tree_codes (); + init_lex (); init_pragma (); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 72e017261f2..cdc722111ac 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,14 @@ +2000-06-16 Benjamin Chelf <chelf@codesourcery.com> + + * cp-tree.h (enum cplus_tree_code): Changed __DUMMY to + CP_DUMMY_TREE_CODE. Remove #include "c-common.def". + + * lex.c (cplus_tree_code_type[]): Removed #include "c-common.def". + (cplus_tree_code_length[]): Likewise. + (cplus_tree_code_name[]): Likewise. + (init_parse): Added call to add_c_tree_codes. Changed + LAST_AND_UNUSED_TREE_CODE to LAST_C_TREE_CODE. + 2000-06-16 Mark Mitchell <mark@codesourcery.com> * cp-tree.h (finish_mem_initializers): Declare. @@ -69,7 +80,7 @@ * cp-tree.h (DECL_PENDING_INLINE_P): Relax checking. -2000-06-14 Benjamin Chelf <chelf@cabriolet.stanford.edu> +2000-06-14 Benjamin Chelf <chelf@codesourcery.com> * cp-tree.h (IF_COND): Move to c-common.h. (THEN_CLAUSE): Likewise. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index b73e8737500..d7848ba92fd 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1250,8 +1250,7 @@ extern void (*back_end_hook) PARAMS ((tree)); /* C++ language-specific tree codes. */ #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM, enum cplus_tree_code { - __DUMMY = LAST_AND_UNUSED_TREE_CODE, -#include "c-common.def" + CP_DUMMY_TREE_CODE = LAST_C_TREE_CODE, #include "cp-tree.def" LAST_CPLUS_TREE_CODE }; diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index c17a6ccc864..fee13f4a968 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -341,15 +341,13 @@ get_time_identifier (name) return time_identifier; } -/* 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/cp-tree.def for details. */ + +/* Tree code classes. */ #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, static char cplus_tree_code_type[] = { 'x', -#include "c-common.def" #include "cp-tree.def" }; #undef DEFTREECODE @@ -362,7 +360,6 @@ static char cplus_tree_code_type[] = { static int cplus_tree_code_length[] = { 0, -#include "c-common.def" #include "cp-tree.def" }; #undef DEFTREECODE @@ -373,7 +370,6 @@ static int cplus_tree_code_length[] = { static const char *cplus_tree_code_name[] = { "@@dummy", -#include "c-common.def" #include "cp-tree.def" }; #undef DEFTREECODE @@ -584,15 +580,17 @@ init_parse (filename) init_tree (); init_cplus_expand (); - memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE, + add_c_tree_codes (); + + memcpy (tree_code_type + (int) LAST_C_TREE_CODE, cplus_tree_code_type, - (int)LAST_CPLUS_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE); - memcpy (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE, + (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_AND_UNUSED_TREE_CODE) * sizeof (int)); - memcpy (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE, + (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_AND_UNUSED_TREE_CODE) * sizeof (char *)); + (LAST_CPLUS_TREE_CODE - (int)LAST_C_TREE_CODE) * sizeof (char *)); init_operators (); init_method (); |