aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-devirt.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@gcc.gnu.org>2014-08-03 14:02:19 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>2014-08-03 14:02:19 +0000
commit9716cc3efff27109cc0ac293f0a1356c2fcf249d (patch)
treead75b0f0e4dadb536b176aa8622f4faadae1fdc9 /gcc/ipa-devirt.c
parent62e4eb3553f9ce05a6d08a1ef7d8e59f81aeeee6 (diff)
downloadgcc-9716cc3efff27109cc0ac293f0a1356c2fcf249d.zip
gcc-9716cc3efff27109cc0ac293f0a1356c2fcf249d.tar.gz
gcc-9716cc3efff27109cc0ac293f0a1356c2fcf249d.tar.bz2
ipa-devirt.c (odr_type_warn_count): Add type.
* ipa-devirt.c (odr_type_warn_count): Add type. (possible_polymorphic_call_targets): Set it. (ipa_devirt): Use it. From-SVN: r213526
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r--gcc/ipa-devirt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index ca74d3b..56eeaf5 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -2518,6 +2518,7 @@ devirt_variable_node_removal_hook (varpool_node *n,
/* Record about how many calls would benefit from given type to be final. */
struct odr_type_warn_count
{
+ tree type;
int count;
gcov_type dyn_count;
};
@@ -2738,6 +2739,7 @@ possible_polymorphic_call_targets (tree otr_type,
if (binfo)
matched_vtables.add (BINFO_VTABLE (binfo));
+
/* Next walk recursively all derived types. */
if (context.speculative_maybe_derived_type)
for (i = 0; i < speculative_outer_type->derived_types.length(); i++)
@@ -2818,6 +2820,8 @@ possible_polymorphic_call_targets (tree otr_type,
final_warning_records->type_warnings[outer_type->id].count++;
final_warning_records->type_warnings[outer_type->id].dyn_count
+= final_warning_records->dyn_count;
+ final_warning_records->type_warnings[outer_type->id].type
+ = outer_type->type;
(*slot)->type_warning = outer_type->id + 1;
}
if (complete
@@ -3274,12 +3278,12 @@ ipa_devirt (void)
i < final_warning_records->type_warnings.length (); i++)
if (final_warning_records->type_warnings[i].count)
{
- odr_type type = odr_types[i];
- warning_at (DECL_SOURCE_LOCATION (TYPE_NAME (type->type)),
+ tree type = final_warning_records->type_warnings[i].type;
+ warning_at (DECL_SOURCE_LOCATION (TYPE_NAME (type)),
OPT_Wsuggest_final_types,
"Declaring type %qD final "
"would enable devirtualization of %i calls",
- type->type,
+ type,
final_warning_records->type_warnings[i].count);
}
}