aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2002-03-13 01:42:43 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2002-03-13 01:42:43 +0000
commit2f9834e8055d89ec753d6bea65cb734dcd8f0dc0 (patch)
tree2e0cc6a8c103f156968a4851003a3fc1f9435589 /gcc/objc
parent36ad2436427c37bac46dc216589ed936f8106f2d (diff)
downloadgcc-2f9834e8055d89ec753d6bea65cb734dcd8f0dc0.zip
gcc-2f9834e8055d89ec753d6bea65cb734dcd8f0dc0.tar.gz
gcc-2f9834e8055d89ec753d6bea65cb734dcd8f0dc0.tar.bz2
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
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/objc-act.c52
-rw-r--r--gcc/objc/objc-lang.c44
2 files changed, 44 insertions, 52 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 814e675..0c9e9fd 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -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 ()
{
diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c
index 8f155c2..2577f65 100644
--- a/gcc/objc/objc-lang.c
+++ b/gcc/objc/objc-lang.c
@@ -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 ()
{