diff options
author | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-04-16 22:50:26 +1000 |
---|---|---|
committer | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-05-02 11:38:54 +1000 |
commit | ad30265ccfb211fca35789df2d1404cc12302219 (patch) | |
tree | 7b9f0096bfa03b5075a1f5dc8adbec5591f24867 /ltgcc.m4 | |
parent | fd48e674fd72e9de9eaa47b12a22750512070e64 (diff) | |
download | gcc-ad30265ccfb211fca35789df2d1404cc12302219.zip gcc-ad30265ccfb211fca35789df2d1404cc12302219.tar.gz gcc-ad30265ccfb211fca35789df2d1404cc12302219.tar.bz2 |
c++: Implement modules ABI for vtable emissions
This patch implements the changes described in
https://github.com/itanium-cxx-abi/cxx-abi/pull/171.
One restriction that is lifted in the ABI that hasn't been updated here
is that the ABI no longer requires unique vtables to be emitted with
vague linkage. I haven't changed this behaviour for this patch, but in
the future we could look into changing the relevant target hook
('class_data_always_comdat') to default to 'false'. But the current
behaviour is more forgiving to changes in key function identification.
Since the ABI for vtables attached to named modules no longer depends on
key methods, this also resolves the issue described in PR c++/105224.
PR c++/105224
gcc/cp/ChangeLog:
* class.cc (finish_struct_1): Also push classes attached to a
module into the 'keyed_classes' list.
* decl.cc (record_key_method_defined): Don't push classes
attached to a named module into the 'keyed_classes' list.
* module.cc (trees_in::read_class_def): Likewise.
* decl2.cc (import_export_class): Uniquely emit vtables for
non-template classes attached to a named module.
(vtables_uniquely_emitted): New function.
(import_export_decl): Update comments. Update with knowledge
about new kinds of uniquely emitted vtables.
gcc/testsuite/ChangeLog:
* g++.dg/modules/virt-2_a.C: Update linkage requirements.
* g++.dg/modules/virt-2_b.C: Likewise.
* g++.dg/modules/virt-2_c.C: Likewise.
* g++.dg/modules/virt-4_a.C: New test.
* g++.dg/modules/virt-4_b.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'ltgcc.m4')
0 files changed, 0 insertions, 0 deletions