aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
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 /gcc/c-common.c
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
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c49
1 files changed, 49 insertions, 0 deletions
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 *));
+}