Hi Alfie,

> +             inform (DECL_SOURCE_LOCATION (new_decl),
> +                     "previous declaration of %qD", new_decl);

That should really say "other declaration" or something similar since it is not
known whether it is the previous or the newer declaration...


@@ -15571,60 +15573,78 @@ disjoint_version_decls (tree fn1, tree fn2)


I think all this is hopelessy complicated. It doesn't make any sense at all
to go over the full crossproduct when all we need is a set of strings.
I expect the code to be as trivial as:


auto_vec<string_slice> old_versions = get_all_clones (old_decl);
auto_vec<string_slice> new_versions = get_all_clones (new_decl);

for (string_slice v1 : old_versions)
  for (string_slice v2 : new_versions)
    if (targetm.target_option.same_function_versions (v1, v2))
      return false;
return true;

This uses a tiny helper get_all_clones (needs better name) that either returns
get_clone_versions or get_target_version or "default". That's all.

Cheers,
Wilco

Reply via email to