* langhooks-def.h (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): New macro.
* langhooks.h (lang_hooks_for_decls): Add prepare_assemble_variable.
* varasm.c (assemble_variable): Call prepare_assemble_variable.
* class.c (build_vtable): Make vtables.
* cp-tree.h (DECL_VTABLE_OR_VTT_P): New macro.
* decl2.c (output_vtable_inherit): Rename to ...
(prepare_assemble_variable): ... this one; change interface.
(maybe_emit_vtables): Do not call output_vtable_inherit.
* cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Define.
* cp-tree.h (prepare_assemble_variable): New.
From-SVN: r68418
+Tue Jun 24 13:52:11 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * langhooks-def.h (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): New macro.
+ * langhooks.h (lang_hooks_for_decls): Add prepare_assemble_variable.
+ * varasm.c (assemble_variable): Call prepare_assemble_variable.
+
2003-06-23 Roger Sayle <roger@eyesopen.com>
* builtins.c (expand_builtin): Use expand_builtin_pow to expand
$(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H) $(TREE_H) $(TARGET_H)
cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- langhooks.h tree-inline.h toplev.h flags.h ggc.h $(TARGET_H) cgraph.h gt-cgraph.h
+ langhooks.h toplev.h flags.h ggc.h $(TARGET_H) cgraph.h gt-cgraph.h output.h
cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
langhooks.h tree-inline.h toplev.h flags.h ggc.h $(TARGET_H) cgraph.h
coverage.o : coverage.c gcov-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+Tue Jun 24 13:52:34 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * class.c (build_vtable): Make vtables.
+ * cp-tree.h (DECL_VTABLE_OR_VTT_P): New macro.
+ * decl2.c (output_vtable_inherit): Rename to ...
+ (prepare_assemble_variable): ... this one; change interface.
+ (maybe_emit_vtables): Do not call output_vtable_inherit.
+ * cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Define.
+ * cp-tree.h (prepare_assemble_variable): New.
+
2003-06-23 Andrew Pinski <pinskia@physics.uc.edu>
* method.c: add prototype for make_alias_for_thunk.
TREE_READONLY (decl) = 1;
DECL_VIRTUAL_P (decl) = 1;
DECL_ALIGN (decl) = TARGET_VTABLE_ENTRY_ALIGN;
+ DECL_VTABLE_OR_VTT_P (decl) = 1;
/* At one time the vtable info was grabbed 2 words at a time. This
fails on sparc unless you have 8-byte alignment. (tiemann) */
#undef LANG_HOOKS_EXPR_SIZE
#define LANG_HOOKS_EXPR_SIZE cp_expr_size
+#undef LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE
+#define LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE prepare_assemble_variable
+
#undef LANG_HOOKS_MAKE_TYPE
#define LANG_HOOKS_MAKE_TYPE cxx_make_type
#undef LANG_HOOKS_TYPE_FOR_MODE
NEED_TEMPORARY_P (in REF_BIND, BASE_CONV)
IDENTIFIER_TYPENAME_P (in IDENTIFIER_NODE)
5: C_IS_RESERVED_WORD (in IDENTIFIER_NODE)
+ DECL_VTABLE_OR_VTT_P (in VAR_DECL)
6: For future expansion
Usage of TYPE_LANG_FLAG_?:
(DECL_CONTEXT (NODE) \
&& TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL)
+/* 1 iff VAR_DECL node NODE is virtual table or VTT. */
+#define DECL_VTABLE_OR_VTT_P(NODE) TREE_LANG_FLAG_5 (VAR_DECL_CHECK (NODE))
+
/* 1 iff NODE is function-local, but for types. */
#define LOCAL_CLASS_P(NODE) \
(decl_function_context (TYPE_MAIN_DECL (NODE)) != NULL_TREE)
extern tree get_guard (tree);
extern tree get_guard_cond (tree);
extern tree set_guard (tree);
+extern void prepare_assemble_variable (tree);
extern void cp_error_at (const char *msgid, ...);
extern void cp_warning_at (const char *msgid, ...);
static cxx_binding *ambiguous_decl (tree, cxx_binding *, cxx_binding *, int);
static tree build_anon_union_vars (tree);
static bool acceptable_java_type (tree);
-static void output_vtable_inherit (tree);
static tree start_objects (int, int);
static void finish_objects (int, int, tree);
static tree merge_functions (tree, tree);
/* We need to describe to the assembler the relationship between
a vtable and the vtable of the parent class. */
-static void
-output_vtable_inherit (tree vars)
+void
+prepare_assemble_variable (tree vars)
{
tree parent;
rtx child_rtx, parent_rtx;
+ if (!flag_vtable_gc || TREE_CODE (vars) != VAR_DECL
+ || !DECL_VTABLE_OR_VTT_P (vars))
+ return;
+
child_rtx = XEXP (DECL_RTL (vars), 0); /* strip the mem ref */
parent = binfo_for_vtable (vars);
rest_of_decl_compilation (vtbl, NULL, 1, 1);
- if (flag_vtable_gc)
- output_vtable_inherit (vtbl);
-
/* Because we're only doing syntax-checking, we'll never end up
actually marking the variable as written. */
if (flag_syntax_only)
#define LANG_HOOKS_GETDECLS getdecls
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL lhd_warn_unused_global_decl
#define LANG_HOOKS_WRITE_GLOBALS write_global_declarations
+#define LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE NULL
#define LANG_HOOKS_DECL_OK_FOR_SIBCALL lhd_decl_ok_for_sibcall
#define LANG_HOOKS_DECLS { \
LANG_HOOKS_GETDECLS, \
LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, \
LANG_HOOKS_WRITE_GLOBALS, \
+ LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE, \
LANG_HOOKS_DECL_OK_FOR_SIBCALL, \
}
of compilation */
void (*final_write_globals) PARAMS ((void));
+ /* Do necessary preparations before assemble_variable can proceed. */
+ void (*prepare_assemble_variable) PARAMS ((tree));
+
/* True if this decl may be called via a sibcall. */
bool (*ok_for_sibcall) PARAMS ((tree));
};
int reloc = 0;
rtx decl_rtl;
+ if (lang_hooks.decls.prepare_assemble_variable)
+ (*lang_hooks.decls.prepare_assemble_variable) (decl);
+
last_assemble_variable_decl = 0;
/* Normally no need to say anything here for external references,