aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 922c2e6..77a5b7e 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -91,6 +91,7 @@ static tree get_vfield_name PARAMS ((tree));
static void finish_struct_anon PARAMS ((tree));
static tree build_vbase_pointer PARAMS ((tree, tree));
static tree build_vtable_entry PARAMS ((tree, tree, tree));
+static tree get_vtable_name PARAMS ((tree));
static tree get_derived_offset PARAMS ((tree, tree));
static tree get_basefndecls PARAMS ((tree, tree));
static int build_primary_vtable PARAMS ((tree, tree));
@@ -627,6 +628,34 @@ build_vfn_ref (ptr_to_instptr, instance, idx)
return build_component_ref (aref, pfn_identifier, NULL_TREE, 0);
}
+/* Return the name of the virtual function table (as an IDENTIFIER_NODE)
+ for the given TYPE. */
+
+static tree
+get_vtable_name (type)
+ tree type;
+{
+ if (flag_new_abi)
+ return mangle_vtbl_for_type (type);
+ else
+ return build_overload_with_type (get_identifier (VTABLE_NAME_PREFIX),
+ type);
+}
+
+/* Return an IDENTIFIER_NODE for the name of the virtual table table
+ for TYPE. */
+
+tree
+get_vtt_name (type)
+ tree type;
+{
+ if (flag_new_abi)
+ return mangle_vtt_for_type (type);
+ else
+ return build_overload_with_type (get_identifier (VTT_NAME_PREFIX),
+ type);
+}
+
/* Return the offset to the main vtable for a given base BINFO. */
tree
@@ -703,7 +732,7 @@ get_vtable_decl (type, complete)
tree type;
int complete;
{
- tree name = mangle_vtbl_for_type (type);
+ tree name = get_vtable_name (type);
tree decl = IDENTIFIER_GLOBAL_VALUE (name);
if (decl)
@@ -6558,7 +6587,7 @@ build_vtt (t)
type = build_cplus_array_type (const_ptr_type_node, type);
/* Now, build the VTT object itself. */
- vtt = build_vtable (t, mangle_vtt_for_type (t), type);
+ vtt = build_vtable (t, get_vtt_name (t), type);
pushdecl_top_level (vtt);
initialize_array (vtt, inits);
}
@@ -6742,7 +6771,10 @@ build_ctor_vtbl_group (binfo, t)
tree id;
/* See if we've already create this construction vtable group. */
- id = mangle_ctor_vtbl_for_type (t, binfo);
+ if (flag_new_abi)
+ id = mangle_ctor_vtbl_for_type (t, binfo);
+ else
+ id = get_ctor_vtbl_name (t, binfo);
if (IDENTIFIER_GLOBAL_VALUE (id))
return;