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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50705
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * 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.
+
2002-03-12 Richard Henderson <rth@redhat.com>
* config/i386/i386.c (ix86_expand_prologue): Revert 2002-03-03
+2002-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * 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.
+
2002-03-11 Richard Henderson <rth@redhat.com>
* Makefile.in (.NOTPARALLEL): Add fake tag.
* *
* C Implementation File *
* *
- * $Revision$
+ * $Revision: 1.20 $
* *
* Copyright (C) 1992-2002 Free Software Foundation, Inc. *
* *
extern int save_argc;
extern char **save_argv;
-/* Tables describing GCC tree codes used only by GNAT.
-
- 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-tree.def for details. */
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-
-static const char gnat_tree_code_type[] = {
- 'x',
-#include "ada-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 gnat_tree_code_length[] = {
- 0,
-#include "ada-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 gnat_tree_code_name[] = {
- "@@dummy",
-#include "ada-tree.def"
-};
-#undef DEFTREECODE
-
static const char *gnat_init PARAMS ((const char *));
static void gnat_init_options PARAMS ((void));
static int gnat_decode_option PARAMS ((int, char **));
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
+/* Tables describing GCC tree codes used only by GNAT.
+
+ 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-tree.def for details. */
+
+#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
+
+const char tree_code_type[] = {
+#include "tree.def"
+ 'x',
+#include "ada-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 "ada-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 "ada-tree.def"
+};
+#undef DEFTREECODE
+
/* gnat standard argc argv */
extern int gnat_argc;
lang_expand_expr = gnat_expand_expr;
decl_printable_name = gnat_printable_name;
- memcpy ((char *) (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE),
- (char *) gnat_tree_code_type,
- ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (char *)));
-
- memcpy ((char *) (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE),
- (char *) gnat_tree_code_length,
- ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (int)));
-
- memcpy ((char *) (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE),
- (char *) gnat_tree_code_name,
- ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (char *)));
-
gnat_init_decl_processing ();
/* Add the input filename as the last argument. */
return 0;
}
-/* Tree code classes. */
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-
-static const 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 const 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 *const 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 ()
-{
- 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 *));
- lang_unsafe_for_reeval = c_unsafe_for_reeval;
-}
-
#define CALLED_AS_BUILT_IN(NODE) \
(!strncmp (IDENTIFIER_POINTER (DECL_NAME (NODE)), "__builtin_", 10))
#undef DEFTREECODE
-extern void add_c_tree_codes PARAMS ((void));
extern void genrtl_do_pushlevel PARAMS ((void));
extern void genrtl_goto_stmt PARAMS ((tree));
extern void genrtl_expr_stmt PARAMS ((tree));
/* Each front end provides its own. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
+/* Tree code classes. */
+
+#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
+
+const char tree_code_type[] = {
+#include "tree.def"
+ '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,
+
+const unsigned char tree_code_length[] = {
+#include "tree.def"
+ 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,
+
+const char *const tree_code_name[] = {
+#include "tree.def"
+ "@@dummy",
+#include "c-common.def"
+};
+#undef DEFTREECODE
+
/* Post-switch processing. */
static void
c_post_options ()
filename = c_common_init (filename);
- add_c_tree_codes ();
+ lang_unsafe_for_reeval = c_unsafe_for_reeval;
save_lang_status = &push_c_function_context;
restore_lang_status = &pop_c_function_context;
+2002-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * 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.
+
2002-02-27 Zack Weinberg <zack@codesourcery.com>
* ch-tree.h, decl.c: Delete traditional-mode-related code
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
- const char chill_tree_code_type[] = {
+const char tree_code_type[] = {
+#include "tree.def"
'x',
#include "ch-tree.def"
};
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
-int chill_tree_code_length[] = {
+const unsigned char tree_code_length[] = {
+#include "tree.def"
0,
#include "ch-tree.def"
};
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
-const char *chill_tree_code_name[] = {
+const char *const tree_code_name[] = {
+#include "tree.def"
"@@dummy",
#include "ch-tree.def"
};
DECL_SOURCE_LINE (temp) = 0;
initializer_type = TREE_TYPE (temp);
- memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
- chill_tree_code_type,
- (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (char)));
- memcpy (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE,
- chill_tree_code_length,
- (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (int)));
- memcpy (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE,
- chill_tree_code_name,
- (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (char *)));
boolean_code_name = (const char **) xcalloc (sizeof (char *),
(int) LAST_CHILL_TREE_CODE);
+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
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
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;
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
\f
/* Post-switch processing. */
void
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 ();
+Tue Mar 12 20:23:18 2002 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * com.c (tree_code_type, tree_code_length, tree_code_name):
+ Define.
+
Sun Mar 10 12:37:42 2002 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* target.c (ffetarget_print_hex): Const-ify.
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
+/* Table indexed by tree code giving a string containing a character
+ classifying the tree code. Possibilities are
+ t, d, s, c, r, <, 1, 2 and e. See tree.def for details. */
+
+#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
+
+const char tree_code_type[] = {
+#include "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"
+};
+#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"
+};
+#undef DEFTREECODE
+
static const char *
ffe_init (filename)
const char *filename;
+2002-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * 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.
+
2002-03-12 Tom Tromey <tromey@redhat.com>
* jcf-parse.c (get_constant) [CONSTANT_String]: String values are
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-static const char java_tree_code_type[] = {
+const char tree_code_type[] = {
+#include "tree.def"
'x',
#include "java-tree.def"
};
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
-static const int java_tree_code_length[] = {
+const unsigned char tree_code_length[] = {
+#include "tree.def"
0,
#include "java-tree.def"
};
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
-static const char *const java_tree_code_name[] = {
+const char *const tree_code_name[] = {
+#include "tree.def"
"@@dummy",
#include "java-tree.def"
};
print_error_function = lang_print_error;
lang_expand_expr = java_lang_expand_expr;
- /* Append to Gcc tree node definition arrays */
-
- memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
- java_tree_code_type,
- (int)LAST_JAVA_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE);
- memcpy (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE,
- java_tree_code_length,
- (LAST_JAVA_TREE_CODE -
- (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (int));
- memcpy (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE,
- java_tree_code_name,
- (LAST_JAVA_TREE_CODE -
- (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (char *));
java_init_decl_processing ();
using_eh_for_cleanups ();
#define OBJC_FORWARDING_MIN_OFFSET 0
#endif
\f
-/* Define the special tree codes that we use. */
-
-/* Table indexed by tree code giving a string containing a character
- classifying the tree code. */
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-
-static const char objc_tree_code_type[] = {
- 'x',
-#include "objc-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 objc_tree_code_length[] = {
- 0,
-#include "objc-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 objc_tree_code_name[] = {
- "@@dummy",
-#include "objc-tree.def"
-};
-#undef DEFTREECODE
\f
/* Set up for use of obstacks. */
/* Everything else. */
-static void add_objc_tree_codes PARAMS ((void));
static tree define_decl PARAMS ((tree, tree));
static tree lookup_method_in_protocol_list PARAMS ((tree, tree, int));
static tree lookup_protocol_in_reflist PARAMS ((tree, tree));
const char *filename;
{
filename = c_objc_common_init (filename);
- add_objc_tree_codes ();
decl_printable_name = objc_printable_name;
return objc_demangle (IDENTIFIER_POINTER (DECL_NAME (decl)));
}
-/* Adds the tree codes specific to the ObjC/ObjC++ front end to the
- list of all tree codes. */
-
-static void
-add_objc_tree_codes ()
-{
- int add = (int) LAST_OBJC_TREE_CODE - (int) LAST_BASE_TREE_CODE;
-
- memcpy (tree_code_type + (int) LAST_BASE_TREE_CODE,
- objc_tree_code_type, add);
- memcpy (tree_code_length + (int) LAST_BASE_TREE_CODE,
- objc_tree_code_length, add * sizeof (int));
- memcpy (tree_code_name + (int) LAST_BASE_TREE_CODE,
- objc_tree_code_name, add * sizeof (char *));
-}
-
static void
init_objc ()
{
/* Each front end provides its own hooks, for toplev.c. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
+/* Define the special tree codes that we use. */
+
+/* Table indexed by tree code giving a string containing a character
+ classifying the tree code. */
+
+#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
+
+const char tree_code_type[] = {
+#include "tree.def"
+ 'x',
+#include "c-common.def"
+ 'x',
+#include "objc-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 "objc-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 "objc-tree.def"
+};
+#undef DEFTREECODE
+
static void
objc_init_options ()
{
decl_printable_name = decl_name;
lang_expand_expr = (lang_expand_expr_t) do_abort;
- /* Set the language-dependent identifier size. */
- tree_code_length[(int) IDENTIFIER_NODE]
- = ((lang_hooks.identifier_size - sizeof (struct tree_common)
- + sizeof (tree) - 1) / sizeof (tree));
-
/* Initialize the garbage-collector, and string pools. */
init_ggc ();
ggc_add_rtx_root (&stack_limit_rtx, 1);
struct obstack permanent_obstack;
-/* Table indexed by tree code giving a string containing a character
- classifying the tree code. Possibilities are
- t, d, s, c, r, <, 1, 2 and e. See tree.def for details. */
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-
-char tree_code_type[MAX_TREE_CODES] = {
-#include "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,
-
-int tree_code_length[MAX_TREE_CODES] = {
-#include "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 *tree_code_name[MAX_TREE_CODES] = {
-#include "tree.def"
-};
-#undef DEFTREECODE
-
/* Statistics-gathering stuff. */
typedef enum
{
Internally it looks like a STRING_CST node.
There is only one IDENTIFIER_NODE ever made for any particular name.
Use `get_identifier' to get it (or create it, the first time). */
-DEFTREECODE (IDENTIFIER_NODE, "identifier_node", 'x', -1)
+DEFTREECODE (IDENTIFIER_NODE, "identifier_node", 'x', ((LANG_HOOKS_IDENTIFIER_SIZE - sizeof (struct tree_common) + sizeof (tree) - 1) / sizeof (tree)))
/* Has the TREE_VALUE and TREE_PURPOSE fields. */
/* These nodes are made into lists by chaining through the
and `x' for anything else (TREE_LIST, IDENTIFIER, etc). */
#define MAX_TREE_CODES 256
-extern char tree_code_type[MAX_TREE_CODES];
+extern const char tree_code_type[];
#define TREE_CODE_CLASS(CODE) tree_code_type[(int) (CODE)]
/* Returns non-zero iff CLASS is the tree-code class of an
/* Number of argument-words in each kind of tree-node. */
-extern int tree_code_length[MAX_TREE_CODES];
+extern const unsigned char tree_code_length[];
#define TREE_CODE_LENGTH(CODE) tree_code_length[(int) (CODE)]
/* Names of tree components. */
-extern const char *tree_code_name[MAX_TREE_CODES];
+extern const char *const tree_code_name[];
\f
/* Classify which part of the compiler has defined a given builtin function.
Note that we assume below that this is no more than two bits. */