aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-10-11 11:48:42 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-10-11 11:48:42 -0700
commit4a8d0c9c68d8ce12453255695bfab8b2111dd772 (patch)
tree36b169e5937e71fb76f555ec055b161e29728e84 /gcc/varasm.c
parent94e091c8336b9ec8ed70f5e0b9b5b31b189f10a4 (diff)
downloadgcc-4a8d0c9c68d8ce12453255695bfab8b2111dd772.zip
gcc-4a8d0c9c68d8ce12453255695bfab8b2111dd772.tar.gz
gcc-4a8d0c9c68d8ce12453255695bfab8b2111dd772.tar.bz2
rtl.h (REG_VTABLE_REF): New.
* rtl.h (REG_VTABLE_REF): New. * rtl.c (reg_note_name): Add it. * combine.c (distribute_notes): Handle it. * final.c (final_scan_insn): Handle it. * tree.def (VTABLE_REF): New. * expr.c (expand_expr): Handle it. * varasm.c (assemble_vtable_entry, assemble_vtable_inherit): New. * output.h: Declare them. cp/ * class.c (build_vtable_entry_ref): Create a VTABLE_REF instead of an asm statement. (build_vtbl_ref_1): Split out from build_vtbl_ref. (build_vfn_ref): Use it to handle vtable descriptors before calling build_vtable_entry_ref. * decl2.c (output_vtable_inherit): Use assemble_vtable_inherit. testsuite/ * g++.old-deja/g++.other/crash18.C: Add -S to options. From-SVN: r46195
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 3123875..0d6dc76 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -5297,3 +5297,32 @@ default_pe_asm_named_section (name, flags)
(flags & SECTION_CODE ? "discard" : "same_size"));
}
}
+
+/* Used for vtable gc in GNU binutils. Record that the pointer at OFFSET
+ from SYMBOL is used in all classes derived from SYMBOL. */
+
+void
+assemble_vtable_entry (symbol, offset)
+ rtx symbol;
+ HOST_WIDE_INT offset;
+{
+ fputs ("\t.vtable_entry ", asm_out_file);
+ output_addr_const (asm_out_file, symbol);
+ fputs (", ", asm_out_file);
+ fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, offset);
+ fputc ('\n', asm_out_file);
+}
+
+/* Used for vtable gc in GNU binutils. Record the class heirarchy by noting
+ that the vtable symbol CHILD is derived from the vtable symbol PARENT. */
+
+void
+assemble_vtable_inherit (child, parent)
+ rtx child, parent;
+{
+ fputs ("\t.vtable_inherit ", asm_out_file);
+ output_addr_const (asm_out_file, child);
+ fputs (", ", asm_out_file);
+ output_addr_const (asm_out_file, parent);
+ fputc ('\n', asm_out_file);
+}