Paolo Bonzini wrote:
> Accept __attribute__ ((ifunc (int foo(int, long)) then. And then do
> typedef int foo_type (int, long);
> foo *bar (void) __attribute__ ((ifunc (foo_type foo)))
I don't object to something like this, or Jakub's "mangle" suggestion.
I agree with Jakub that if we can build something that is useful in more
contexts, that is a good thing.
I think that for C++, there are two reasonably natural ways to deal with
overloading. The first is a full declaration, just as would be required
to declare the function. This is what Paolo demonstrates above. Of
course, in the case of templates, this might be complex. For example:
mangle(template <> void S<int>::f(double))
or some such. The other would be to use the same rules that apply when
performing a cast. For example:
Here, the overloaded "f" can be resolved based on the cast-to type. A
further extension that gets you the type of the top level declaration
being declared would be useful. For example:
void f(int) attribute((asm(mangle((typeof)g))));
The intent here is that we pick the "g" that matches the type of "f".
(650) 331-3385 x713