aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog25
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/config/alpha/alpha.c3
-rw-r--r--gcc/config/d30v/d30v.c3
-rw-r--r--gcc/config/i386/i386.c3
-rw-r--r--gcc/config/rs6000/rs6000.c2
-rw-r--r--gcc/config/s390/s390.c4
-rw-r--r--gcc/config/stormy16/stormy16.c3
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/cp-lang.c3
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/lex.c4
-rw-r--r--gcc/cp/tree.c1
-rw-r--r--gcc/except.c3
-rw-r--r--gcc/langhooks-def.h10
-rw-r--r--gcc/langhooks.h9
-rw-r--r--gcc/tree.c15
-rw-r--r--gcc/tree.h2
18 files changed, 71 insertions, 31 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index effce52..fbed9ce 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index c5192e9..7162b32 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -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 \
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 73baa89..4dfd5c5 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -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;
diff --git a/gcc/config/d30v/d30v.c b/gcc/config/d30v/d30v.c
index 4bfd4bb..ba4d90b 100644
--- a/gcc/config/d30v/d30v.c
+++ b/gcc/config/d30v/d30v.c
@@ -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);
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 7794f3f..95873e2 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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"),
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 63275b18..7d96164 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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"),
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 8c183e7..ce601f0 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -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);
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index dedc9be..db809d6 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -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"),
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 20faafd..6a69a7a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index 7516b43..a3ede8d 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -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;
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index bab908b..1339fd6 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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;
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index f67ea29..8ab072e 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -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);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 2cc78a7..d66d3d8 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -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);
diff --git a/gcc/except.c b/gcc/except.c
index fa92368..9aa5a0a 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -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"),
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 61559a1..821def7 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -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 */
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index a71f7ec..88a45f9 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -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. */
};
diff --git a/gcc/tree.c b/gcc/tree.c
index 96a2d3b..1b5bddd 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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. */
diff --git a/gcc/tree.h b/gcc/tree.h
index 6635248..c40b611 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -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