Makefile.in (except.o): Update.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Fri, 29 Mar 2002 08:43:22 +0000 (08:43 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Fri, 29 Mar 2002 08:43:22 +0000 (08:43 +0000)
* Makefile.in (except.o): Update.
* except.c: Include langhooks.h.
(init_eh): Use langhook.
* langhooks-def.h (LANG_HOOKS_MAKE_TYPE,
LANG_HOOKS_FOR_TYPES_INITIALIZER): New.
(LANG_HOOKS_INITIALIZER): Update.
* langhooks.h (lang_hooks_for_types): New.
(struct lang_hooks): Add it.
* tree.c (make_lang_type_fn, make_lang_type): Remove.
* tree.h (make_lang_type_fn, make_lang_type): Remove.
config:
* alpha/alpha.c: Include langhooks.h.
(alpha_build_va_list): Use langhook.
* d30v/d30v.c: Include langhooks.h.
(d30v_build_va_list): Use langhook.
* i386/i386.c: Include langhooks.h.
(ix86_build_va_list): Use langhook.
* rs6000/rs6000.c (rs6000_build_va_list): Use langhook.
* s390/s390.c: Include langhooks.h.
(s390_build_va_list): Use langhook.
* stormy16/stormy16.c: Include langhooks.h.
(stormy16_build_va_list): Use langhook.
cp:
* cp-lang.c (LANG_HOOKS_MAKE_TYPE): Redefine.
* cp-tree.h (cp_make_lang_type): Rename.
* lex.c (cp_make_lang_type): Rename.
(make_aggr_type): Update.
* tree.c (init_tree): Don't set make_lang_type_fn.

From-SVN: r51558

18 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/config/alpha/alpha.c
gcc/config/d30v/d30v.c
gcc/config/i386/i386.c
gcc/config/rs6000/rs6000.c
gcc/config/s390/s390.c
gcc/config/stormy16/stormy16.c
gcc/cp/ChangeLog
gcc/cp/cp-lang.c
gcc/cp/cp-tree.h
gcc/cp/lex.c
gcc/cp/tree.c
gcc/except.c
gcc/langhooks-def.h
gcc/langhooks.h
gcc/tree.c
gcc/tree.h

index effce5242f713c1290e800773d1ca218f0ff3f0b..fbed9ce4623c95553c44304294a31bd01b9d8a11 100644 (file)
@@ -1,3 +1,28 @@
+2002-03-29  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * Makefile.in (except.o): Update.
+       * except.c: Include langhooks.h.
+       (init_eh): Use langhook.
+       * langhooks-def.h (LANG_HOOKS_MAKE_TYPE,
+       LANG_HOOKS_FOR_TYPES_INITIALIZER): New.
+       (LANG_HOOKS_INITIALIZER): Update.
+       * langhooks.h (lang_hooks_for_types): New.
+       (struct lang_hooks): Add it.
+       * tree.c (make_lang_type_fn, make_lang_type): Remove.
+       * tree.h (make_lang_type_fn, make_lang_type): Remove.
+config:
+       * alpha/alpha.c: Include langhooks.h.
+       (alpha_build_va_list): Use langhook.
+       * d30v/d30v.c: Include langhooks.h.
+       (d30v_build_va_list): Use langhook.
+       * i386/i386.c: Include langhooks.h.
+       (ix86_build_va_list): Use langhook.
+       * rs6000/rs6000.c (rs6000_build_va_list): Use langhook.
+       * s390/s390.c: Include langhooks.h.
+       (s390_build_va_list): Use langhook.
+       * stormy16/stormy16.c: Include langhooks.h.
+       (stormy16_build_va_list): Use langhook.
+
 2002-03-29  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/5964
index c5192e9642254c03c724d46724d3ef7e616df78d..7162b3264c2edea8e97a536f1b7a6b521ebb3d59 100644 (file)
@@ -1384,7 +1384,7 @@ stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h  \
    $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \
    langhooks.h
 except.o : except.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
-   except.h function.h $(EXPR_H) libfuncs.h integrate.h \
+   except.h function.h $(EXPR_H) libfuncs.h integrate.h langhooks.h \
    insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
    dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H)
 expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h \
index 73baa891e7e477c24be8bba684118323dd165c97..4dfd5c5e346d21495f83f59de7f136beb8b656fa 100644 (file)
@@ -47,6 +47,7 @@ Boston, MA 02111-1307, USA.  */
 #include "target.h"
 #include "target-def.h"
 #include "debug.h"
+#include "langhooks.h"
 
 /* Specify which cpu to schedule for.  */
 
@@ -5707,7 +5708,7 @@ alpha_build_va_list ()
   if (TARGET_ABI_OPEN_VMS || TARGET_ABI_UNICOSMK)
     return ptr_type_node;
 
-  record = make_lang_type (RECORD_TYPE);
+  record = (*lang_hooks.types.make_type) (RECORD_TYPE);
   type_decl = build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
   TREE_CHAIN (record) = type_decl;
   TYPE_NAME (record) = type_decl;
index 4bfd4bb9976bb88ae0883d31b7d7f1abdb2af5a1..ba4d90b9f87943927b04d6d2ae5c7a4afb86a173 100644 (file)
@@ -42,6 +42,7 @@
 #include "ggc.h"
 #include "target.h"
 #include "target-def.h"
+#include "langhooks.h"
 
 static void d30v_print_operand_memory_reference PARAMS ((FILE *, rtx));
 static void d30v_build_long_insn PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT,
@@ -2202,7 +2203,7 @@ d30v_build_va_list ()
   tree f_arg_ptr, f_arg_num, record, type_decl;
   tree int_type_node;
 
-  record = make_lang_type (RECORD_TYPE);
+  record = (*lang_hooks.types.make_type) (RECORD_TYPE);
   type_decl = build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
   int_type_node = make_signed_type (INT_TYPE_SIZE);
 
index 7794f3fd9cc052cdcb7233a2c71fd0d6ec1f7ff9..95873e26cf459fd7b6cecf70d1acf4b7b19f4f84 100644 (file)
@@ -42,6 +42,7 @@ Boston, MA 02111-1307, USA.  */
 #include "ggc.h"
 #include "target.h"
 #include "target-def.h"
+#include "langhooks.h"
 
 #ifndef CHECK_STACK_LIMIT
 #define CHECK_STACK_LIMIT (-1)
@@ -2297,7 +2298,7 @@ ix86_build_va_list ()
   if (!TARGET_64BIT)
     return build_pointer_type (char_type_node);
 
-  record = make_lang_type (RECORD_TYPE);
+  record = (*lang_hooks.types.make_type) (RECORD_TYPE);
   type_decl = build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
 
   f_gpr = build_decl (FIELD_DECL, get_identifier ("gp_offset"), 
index 63275b18c0391a02b2ef7dacec90053a799bb4df..7d961643e76e969e197263d2abb1ccc1b61e6c8a 100644 (file)
@@ -2980,7 +2980,7 @@ rs6000_build_va_list ()
   if (DEFAULT_ABI != ABI_V4)
     return build_pointer_type (char_type_node);
 
-  record = make_lang_type (RECORD_TYPE);
+  record = (*lang_hooks.types.make_type) (RECORD_TYPE);
   type_decl = build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
 
   f_gpr = build_decl (FIELD_DECL, get_identifier ("gpr"), 
index 8c183e77acb1481c9f729d6c77b13ee8af01e6c7..ce601f0ab48a5524cc6553fa1cf20da01f72c733 100644 (file)
@@ -44,7 +44,7 @@ Boston, MA 02111-1307, USA.  */
 #include "target.h"
 #include "target-def.h"
 #include "debug.h"
-
+#include "langhooks.h"
 
 static bool s390_assemble_integer PARAMS ((rtx, unsigned int, int));
 static int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int));
@@ -3420,7 +3420,7 @@ s390_build_va_list ()
 {
   tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl;
 
-  record = make_lang_type (RECORD_TYPE);
+  record = (*lang_hooks.types.make_type) (RECORD_TYPE);
 
   type_decl =
     build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
index dedc9be5ffe52baf754e4ce7295b1eab8fa903be..db809d67c3f943157334c7491d443de6ee6ffeb9 100644 (file)
@@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA.  */
 #include "target.h"
 #include "target-def.h"
 #include "tm_p.h"
+#include "langhooks.h"
 
 static rtx emit_addhi3_postreload PARAMS ((rtx, rtx, rtx));
 static void xstormy16_asm_out_constructor PARAMS ((rtx, int));
@@ -1140,7 +1141,7 @@ xstormy16_build_va_list ()
 {
   tree f_1, f_2, record, type_decl;
 
-  record = make_lang_type (RECORD_TYPE);
+  record = (*lang_hooks.types.make_type) (RECORD_TYPE);
   type_decl = build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
 
   f_1 = build_decl (FIELD_DECL, get_identifier ("base"),
index 20faafd46b62df077fd99fb8a306b54561534e55..6a69a7a8b53118378b3c8d0ab1d52d899b5ab0f1 100644 (file)
@@ -1,3 +1,11 @@
+2002-03-29  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * cp-lang.c (LANG_HOOKS_MAKE_TYPE): Redefine.
+       * cp-tree.h (cp_make_lang_type): Rename.
+       * lex.c (cp_make_lang_type): Rename.
+       (make_aggr_type): Update.
+       * tree.c (init_tree): Don't set make_lang_type_fn.
+
 2002-03-29  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/6073
index 7516b4352ecfa59118f208c95150de9a757459d6..a3ede8da133974c06c08fd1e992591127a0e89d6 100644 (file)
@@ -109,6 +109,9 @@ static bool ok_to_generate_alias_set_for_type PARAMS ((tree));
 #undef LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN
 #define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN cp_type_quals
 
+#undef LANG_HOOKS_MAKE_TYPE
+#define LANG_HOOKS_MAKE_TYPE cxx_make_type
+
 /* Each front end provides its own hooks, for toplev.c.  */
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
 
index bab908b9a818f73363e6d329fb81c210c2fbf08d..1339fd6f173f95193bf440e514b5da78c202d629 100644 (file)
@@ -3971,7 +3971,7 @@ extern tree build_lang_decl                       PARAMS ((enum tree_code, tree, tree));
 extern void retrofit_lang_decl                 PARAMS ((tree));
 extern tree copy_decl                           PARAMS ((tree));
 extern tree copy_type                           PARAMS ((tree));
-extern tree cp_make_lang_type                  PARAMS ((enum tree_code));
+extern tree cxx_make_type                      PARAMS ((enum tree_code));
 extern tree make_aggr_type                     PARAMS ((enum tree_code));
 extern void compiler_error                     PARAMS ((const char *, ...))
   ATTRIBUTE_PRINTF_1;
index f67ea2985688b666d0c3cd22f4b390c1782ad4f2..8ab072ed07acaeb1e3fa270ed6584ae48aa15356 100644 (file)
@@ -1550,7 +1550,7 @@ copy_type (type)
 }
 
 tree
-cp_make_lang_type (code)
+cxx_make_type (code)
      enum tree_code code;
 {
   register tree t = make_node (code);
@@ -1605,7 +1605,7 @@ tree
 make_aggr_type (code)
      enum tree_code code;
 {
-  tree t = cp_make_lang_type (code);
+  tree t = cxx_make_type (code);
 
   if (IS_AGGR_TYPE_CODE (code))
     SET_IS_AGGR_TYPE (t, 1);
index 2cc78a75aaf1d31845dc83296fffa9aa76929d0a..d66d3d8b8628843e052018301927bd96b2cb217c 100644 (file)
@@ -2294,7 +2294,6 @@ cp_end_inlining (fn)
 void
 init_tree ()
 {
-  make_lang_type_fn = cp_make_lang_type;
   lang_statement_code_p = cp_statement_code_p;
   lang_set_decl_assembler_name = mangle_decl;
   list_hash_table = htab_create (31, list_hash, list_hash_eq, NULL);
index fa92368ec8d4465805a8e6b91ee47802f46b8fb1..9aa5a0a34fd487c7d19229eac732493fd597ac06 100644 (file)
@@ -70,6 +70,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "ggc.h"
 #include "tm_p.h"
 #include "target.h"
+#include "langhooks.h"
 
 /* Provide defaults for stuff that may not be defined when using
    sjlj exceptions.  */
@@ -383,7 +384,7 @@ init_eh ()
     {
       tree f_jbuf, f_per, f_lsda, f_prev, f_cs, f_data, tmp;
 
-      sjlj_fc_type_node = make_lang_type (RECORD_TYPE);
+      sjlj_fc_type_node = (*lang_hooks.types.make_type) (RECORD_TYPE);
       ggc_add_tree_root (&sjlj_fc_type_node, 1);
 
       f_prev = build_decl (FIELD_DECL, get_identifier ("__prev"),
index 61559a17d3b817b3e14e33ff32e26740ebc00ae2..821def7940286a53843761d42d1db919c128bbc9 100644 (file)
@@ -145,6 +145,13 @@ int lhd_tree_dump_type_quals                       PARAMS ((tree));
   LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN \
 }
 
+/* Types hooks.  */
+#define LANG_HOOKS_MAKE_TYPE make_node
+
+#define LANG_HOOKS_FOR_TYPES_INITIALIZER { \
+  LANG_HOOKS_MAKE_TYPE \
+}
+
 /* Declaration hooks.  */
 #define LANG_HOOKS_PUSHLEVEL   pushlevel
 #define LANG_HOOKS_POPLEVEL    poplevel
@@ -195,7 +202,8 @@ int lhd_tree_dump_type_quals                        PARAMS ((tree));
   LANG_HOOKS_SET_YYDEBUG, \
   LANG_HOOKS_TREE_INLINING_INITIALIZER, \
   LANG_HOOKS_TREE_DUMP_INITIALIZER, \
-  LANG_HOOKS_DECLS \
+  LANG_HOOKS_DECLS, \
+  LANG_HOOKS_FOR_TYPES_INITIALIZER \
 }
 
 #endif /* GCC_LANG_HOOKS_DEF_H */
index a71f7ec37f64cc85c5d712a500aae45792ac0ea1..88a45f969ae0d2ec5704a479dd12d95ce5a657a2 100644 (file)
@@ -67,6 +67,13 @@ struct lang_hooks_for_tree_dump
   int (*type_quals) PARAMS ((tree));
 };
 
+/* Hooks related to types.  */
+
+struct lang_hooks_for_types
+{
+  tree (*make_type) PARAMS ((enum tree_code));
+};
+
 /* Language hooks related to decls and the symbol table.  */
 
 struct lang_hooks_for_decls
@@ -233,6 +240,8 @@ struct lang_hooks
 
   struct lang_hooks_for_decls decls;
 
+  struct lang_hooks_for_types types;
+
   /* Whenever you add entries here, make sure you adjust langhooks-def.h
      and langhooks.c accordingly.  */
 };
index 96a2d3b7160ba1a7e0fda6eb713e596fec9069fa..1b5bddda152a7038e3ccae3061724eec7a915914 100644 (file)
@@ -421,21 +421,6 @@ make_node (code)
 
   return t;
 }
-
-/* A front-end can reset this to an appropriate function if types need
-   special handling.  */
-
-tree (*make_lang_type_fn) PARAMS ((enum tree_code)) = make_node;
-
-/* Return a new type (with the indicated CODE), doing whatever
-   language-specific processing is required.  */
-
-tree
-make_lang_type (code)
-     enum tree_code code;
-{
-  return (*make_lang_type_fn) (code);
-}
 \f
 /* Return a new node with the same contents as NODE except that its
    TREE_CHAIN is zero and it has a fresh uid.  */
index 6635248f928f7c714482818d9c0d03dfb0c3f70e..c40b611d018c5ecd121acb45a8b206951809ba8b 100644 (file)
@@ -2068,8 +2068,6 @@ extern size_t tree_size                   PARAMS ((tree));
    to zero except for a few of the common fields.  */
 
 extern tree make_node                  PARAMS ((enum tree_code));
-extern tree make_lang_type             PARAMS ((enum tree_code));
-extern tree (*make_lang_type_fn)               PARAMS ((enum tree_code));
 
 /* Make a copy of a node, with all the same contents except
    for TREE_PERMANENT.  (The copy is permanent