This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

make_lang_type langhook


Bootstrapped x86 Linux.  Compile tested the other 5 target files.

OK to commit?

Neil.

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

============================================================
Index: gcc/Makefile.in
--- gcc/Makefile.in	2002/03/27 23:15:42	1.848
+++ gcc/Makefile.in	2002/03/28 00:09:20
@@ -1384,7 +1384,7 @@ stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_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: gcc/except.c
--- gcc/except.c	2002/03/20 00:49:13	1.213
+++ gcc/except.c	2002/03/28 00:09:27
@@ -70,6 +70,7 @@ Software Foundation, 59 Temple Place - S
 #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: gcc/langhooks-def.h
--- gcc/langhooks-def.h	2002/03/27 23:15:44	1.18
+++ gcc/langhooks-def.h	2002/03/28 00:09:27
@@ -145,6 +145,13 @@ int lhd_tree_dump_type_quals			PARAMS ((
   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 ((
   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: gcc/langhooks.h
--- gcc/langhooks.h	2002/03/27 23:15:44	1.25
+++ gcc/langhooks.h	2002/03/28 00:09:28
@@ -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
@@ -232,6 +239,8 @@ struct lang_hooks
   struct lang_hooks_for_tree_dump tree_dump;
 
   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: gcc/tree.c
--- gcc/tree.c	2002/03/25 20:52:14	1.246
+++ gcc/tree.c	2002/03/28 00:09:38
@@ -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);
-}
 
 /* Return a new node with the same contents as NODE except that its
    TREE_CHAIN is zero and it has a fresh uid.  */
============================================================
Index: gcc/tree.h
--- gcc/tree.h	2002/03/27 23:15:45	1.319
+++ gcc/tree.h	2002/03/28 00:09:48
@@ -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
============================================================
Index: gcc/config/alpha/alpha.c
--- gcc/config/alpha/alpha.c	2002/03/27 03:03:18	1.241
+++ gcc/config/alpha/alpha.c	2002/03/28 00:10:07
@@ -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.  */
 
@@ -5699,7 +5700,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: gcc/config/d30v/d30v.c
--- gcc/config/d30v/d30v.c	2002/01/03 17:40:00	1.20
+++ gcc/config/d30v/d30v.c	2002/03/28 00:10:13
@@ -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: gcc/config/i386/i386.c
--- gcc/config/i386/i386.c	2002/03/27 22:53:08	1.378
+++ gcc/config/i386/i386.c	2002/03/28 00:10:39
@@ -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: gcc/config/rs6000/rs6000.c
--- gcc/config/rs6000/rs6000.c	2002/03/21 18:30:09	1.301
+++ gcc/config/rs6000/rs6000.c	2002/03/28 00:11:02
@@ -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: gcc/config/s390/s390.c
--- gcc/config/s390/s390.c	2002/03/26 08:44:47	1.31
+++ gcc/config/s390/s390.c	2002/03/28 00:11:09
@@ -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: gcc/config/stormy16/stormy16.c
--- gcc/config/stormy16/stormy16.c	2002/03/03 04:23:19	1.20
+++ gcc/config/stormy16/stormy16.c	2002/03/28 00:11:16
@@ -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: gcc/cp/cp-lang.c
--- gcc/cp/cp-lang.c	2002/03/27 23:16:06	1.19
+++ gcc/cp/cp-lang.c	2002/03/28 00:11:16
@@ -109,6 +109,9 @@ static bool ok_to_generate_alias_set_for
 #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: gcc/cp/cp-tree.h
--- gcc/cp/cp-tree.h	2002/03/27 23:16:06	1.699
+++ gcc/cp/cp-tree.h	2002/03/28 00:11:29
@@ -3971,7 +3971,7 @@ extern tree build_lang_decl			PARAMS ((e
 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: gcc/cp/lex.c
--- gcc/cp/lex.c	2002/03/27 18:27:56	1.272
+++ gcc/cp/lex.c	2002/03/28 00:11:33
@@ -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: gcc/cp/tree.c
--- gcc/cp/tree.c	2002/03/25 19:11:06	1.275
+++ gcc/cp/tree.c	2002/03/28 00:11:38
@@ -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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]