aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJohn F. Carr <jfc@mit.edu>1997-12-12 06:49:29 +0000
committerJeff Law <law@gcc.gnu.org>1997-12-11 23:49:29 -0700
commit0a6969ad7cfe5a44854a2e19a8c38505862c2528 (patch)
tree5b4b9de36c3d7dc6f7a0fd049bc566fd4636cabf /gcc/tree.c
parentc55dcc7ddd984dd72e8dc89fe18f422f4d6344fa (diff)
downloadgcc-0a6969ad7cfe5a44854a2e19a8c38505862c2528.zip
gcc-0a6969ad7cfe5a44854a2e19a8c38505862c2528.tar.gz
gcc-0a6969ad7cfe5a44854a2e19a8c38505862c2528.tar.bz2
tree.c, tree.h: Change tree_code_type, tree_code_length, and tree_code_name from pointers to arrays.
* tree.c, tree.h: Change tree_code_type, tree_code_length, and tree_code_name from pointers to arrays. * tree.c: Remove standard_tree_code_* variables, no longer used. * print-tree.c: Remove declaration of tree_code_name. * cp/lex.c (init_lex): Update for tree_code_* changes. * objc/objc-act.c (init_objc): Likewise. * tree.def, cp/cp-tree.def, objc/objc-tree.def: Update for tree_code changes. From-SVN: r17061
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 5db36c2..7b150eb 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -189,7 +189,7 @@ struct momentary_level *momentary_stack;
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-char *standard_tree_code_type[] = {
+char tree_code_type[MAX_TREE_CODES] = {
#include "tree.def"
};
#undef DEFTREECODE
@@ -200,7 +200,7 @@ char *standard_tree_code_type[] = {
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
-int standard_tree_code_length[] = {
+int tree_code_length[MAX_TREE_CODES] = {
#include "tree.def"
};
#undef DEFTREECODE
@@ -209,27 +209,11 @@ int standard_tree_code_length[] = {
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
-char *standard_tree_code_name[] = {
+char *tree_code_name[MAX_TREE_CODES] = {
#include "tree.def"
};
#undef DEFTREECODE
-/* Table indexed by tree code giving a string containing a character
- classifying the tree code. Possibilities are
- t, d, s, c, r, e, <, 1 and 2. See tree.def for details. */
-
-char **tree_code_type;
-
-/* Table indexed by tree code giving number of expression
- operands beyond the fixed part of the node structure.
- Not used for types or decls. */
-
-int *tree_code_length;
-
-/* Table indexed by tree code giving name of tree code, as a string. */
-
-char **tree_code_name;
-
/* Statistics-gathering stuff. */
typedef enum
{
@@ -942,15 +926,7 @@ resume_momentary (yes)
void
init_tree_codes ()
{
- tree_code_type = (char **) xmalloc (sizeof (standard_tree_code_type));
- tree_code_length = (int *) xmalloc (sizeof (standard_tree_code_length));
- tree_code_name = (char **) xmalloc (sizeof (standard_tree_code_name));
- bcopy ((char *) standard_tree_code_type, (char *) tree_code_type,
- sizeof (standard_tree_code_type));
- bcopy ((char *) standard_tree_code_length, (char *) tree_code_length,
- sizeof (standard_tree_code_length));
- bcopy ((char *) standard_tree_code_name, (char *) tree_code_name,
- sizeof (standard_tree_code_name));
+
}
/* Return a newly allocated node of code CODE.
@@ -3906,8 +3882,7 @@ simple_cst_equal (t1, t2)
handled above. If this is a language-specific tree code, we can't
trust what might be in the operand, so say we don't know
the situation. */
- if ((int) code1
- >= sizeof standard_tree_code_type / sizeof standard_tree_code_type[0])
+ if ((int) code1 >= (int) LAST_AND_UNUSED_TREE_CODE)
return -1;
switch (TREE_CODE_CLASS (code1))