aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Chelf <chelf@codesourcery.com>2000-06-17 02:37:23 +0000
committerBen Chelf <chelf@gcc.gnu.org>2000-06-16 19:37:23 -0700
commitc7d87c0a58af4fb6906179301c48b89210be835e (patch)
tree0de1cb8ed60b2da04d155bdb3c2d0ec60c45632c
parentcf6d5133a14cca405a9d527dc966b8d15415e8e7 (diff)
downloadgcc-c7d87c0a58af4fb6906179301c48b89210be835e.zip
gcc-c7d87c0a58af4fb6906179301c48b89210be835e.tar.gz
gcc-c7d87c0a58af4fb6906179301c48b89210be835e.tar.bz2
c-common.c (c_tree_code_type): New array.
* 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. From-SVN: r34577
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/c-common.c49
-rw-r--r--gcc/c-common.h13
-rw-r--r--gcc/c-lex.c2
-rw-r--r--gcc/cp/ChangeLog13
-rw-r--r--gcc/cp/cp-tree.h3
-rw-r--r--gcc/cp/lex.c22
7 files changed, 100 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 90f25e2..1a6a25f 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 445ec09..f74cad2 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 4b5cb97..81a5127 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 beda889..2e6e5a9 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 72e0172..cdc7221 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 b73e873..d7848ba 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 c17a6cc..fee13f4 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 ();