c-common.c (c_tree_code_type, [...]): Delete.

* 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.

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.

From-SVN: r50705
This commit is contained in:
Kaveh R. Ghazi 2002-03-13 01:42:43 +00:00 committed by Kaveh Ghazi
parent 36ad243642
commit 2f9834e805
23 changed files with 274 additions and 270 deletions

View File

@ -1,3 +1,26 @@
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

View File

@ -1,3 +1,11 @@
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.

View File

@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
* $Revision$
* $Revision: 1.20 $
* *
* Copyright (C) 1992-2002 Free Software Foundation, Inc. *
* *
@ -77,42 +77,6 @@ extern FILE *asm_out_file;
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 **));
@ -146,6 +110,45 @@ static int gnat_eh_type_covers PARAMS ((tree, tree));
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;
@ -358,21 +361,6 @@ gnat_init (filename)
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. */

View File

@ -3696,56 +3696,6 @@ c_staticp (exp)
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))

View File

@ -728,7 +728,6 @@ enum c_tree_code {
#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));

View File

@ -73,6 +73,41 @@ static void c_post_options PARAMS ((void));
/* 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 ()

View File

@ -217,7 +217,7 @@ c_objc_common_init (filename)
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;

View File

@ -1,3 +1,11 @@
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

View File

@ -534,7 +534,8 @@ int warn_missing_braces;
#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"
};
@ -546,7 +547,8 @@ int warn_missing_braces;
#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"
};
@ -557,7 +559,8 @@ int chill_tree_code_length[] = {
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"
};
@ -3482,18 +3485,6 @@ init_decl_processing ()
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);

View File

@ -1,3 +1,15 @@
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

View File

@ -152,6 +152,47 @@ ok_to_generate_alias_set_for_type (t)
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

View File

@ -3781,7 +3781,7 @@ duplicate_decls (newdecl, olddecl)
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;

View File

@ -205,37 +205,6 @@ int interface_only; /* whether or not current file is only for
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
/* Post-switch processing. */
void
@ -682,17 +651,7 @@ cxx_init (filename)
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 ();

View File

@ -1,3 +1,8 @@
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.

View File

@ -14224,6 +14224,37 @@ static void ffe_print_identifier PARAMS ((FILE *, tree, int));
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;

View File

@ -1,3 +1,11 @@
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

View File

@ -70,7 +70,8 @@ static int process_option_with_no PARAMS ((const char *,
#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"
};
@ -82,7 +83,8 @@ static const char java_tree_code_type[] = {
#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"
};
@ -92,7 +94,8 @@ static const int java_tree_code_length[] = {
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"
};
@ -505,19 +508,6 @@ java_init (filename)
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 ();

View File

@ -86,40 +86,6 @@ Boston, MA 02111-1307, USA. */
#define OBJC_FORWARDING_MIN_OFFSET 0
#endif
/* 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
/* Set up for use of obstacks. */
@ -270,7 +236,6 @@ static void dump_interface PARAMS ((FILE *, tree));
/* 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));
@ -511,7 +476,6 @@ objc_init (filename)
const char *filename;
{
filename = c_objc_common_init (filename);
add_objc_tree_codes ();
decl_printable_name = objc_printable_name;
@ -8072,22 +8036,6 @@ objc_printable_name (decl, kind)
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 ()
{

View File

@ -66,6 +66,50 @@ static void objc_post_options PARAMS ((void));
/* 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 ()
{

View File

@ -4998,11 +4998,6 @@ lang_independent_init ()
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);

View File

@ -56,37 +56,6 @@ extern int _obstack_allocated_p PARAMS ((struct obstack *h, PTR obj));
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
{

View File

@ -49,7 +49,7 @@ DEFTREECODE (ERROR_MARK, "error_mark", 'x', 0)
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

View File

@ -46,7 +46,7 @@ enum tree_code {
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
@ -57,12 +57,12 @@ extern char tree_code_type[MAX_TREE_CODES];
/* 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[];
/* 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. */