This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [IFUNC] PATCH: Add an ifunc attribute
- From: Richard Henderson <rth at redhat dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Paolo Bonzini <bonzini at gnu dot org>, "H.J. Lu" <hjl dot tools at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>, Richard Guenther <richard dot guenther at gmail dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 02 Jul 2009 11:58:03 -0700
- Subject: Re: [IFUNC] PATCH: Add an ifunc attribute
- References: <84fc9c000906280957r26be86d4h8130d8d0ae5455a1@mail.gmail.com> <84fc9c000906281020h6a63ed83kd109df656729229a@mail.gmail.com> <6dc9ffc80906281027u37d13ec7w931add5f095b1df9@mail.gmail.com> <84fc9c000906281113td6522cxd0f5057512874eed@mail.gmail.com> <6dc9ffc80906281208m67e7abb8q5b35b405f77e572@mail.gmail.com> <Pine.LNX.4.64.0906281928420.26388@digraph.polyomino.org.uk> <6dc9ffc80906281239u2589c6f0uc12fae2225d421db@mail.gmail.com> <84fc9c000906281240y39c679e3uc54a5eeb716fa126@mail.gmail.com> <4A4C4E94.8090705@codesourcery.com> <20090702072020.GL4462@tyan-ft48-01.lab.bos.redhat.com> <6dc9ffc80907020547w3531b29eke4cdc3275f58d51d@mail.gmail.com> <4A4CB532.4060603@gnu.org> <4A4CD737.2060105@codesourcery.com>
On 07/02/2009 08:50 AM, Mark Mitchell wrote:
The other would be to use the same rules that apply when
performing a cast. For example:
mangle((void (*)())f);
Not being a C++ programmer, I didn't know something like that would
work; I kinda like it.
The suggestion I had been about to post was
mangle_type(foo, typename)
mangle_type("bar", typename)
where the first argument can be either an identifier or a string,
and typename can be anything that names a type, e.g. a typedef or
template argument or suchlike.
The idea being the string/identifier would be used as the base
name of the function, with the rest of the goop coming from the
given type. One could then create mangled names that don't
correspond to any function declaration in scope.
r~