* 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
+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
$(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 \
#include "target.h"
#include "target-def.h"
#include "debug.h"
+#include "langhooks.h"
/* Specify which cpu to schedule for. */
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;
#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,
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);
#include "ggc.h"
#include "target.h"
#include "target-def.h"
+#include "langhooks.h"
#ifndef CHECK_STACK_LIMIT
#define CHECK_STACK_LIMIT (-1)
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"),
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"),
#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));
{
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);
#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));
{
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"),
+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
#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;
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;
}
tree
-cp_make_lang_type (code)
+cxx_make_type (code)
enum tree_code code;
{
register tree t = make_node (code);
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);
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);
#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. */
{
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"),
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
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 */
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
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. */
};
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. */
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