This is the mail archive of the
mailing list for the GCC project.
Re: [IFUNC] PATCH: Add an ifunc attribute
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 28 Jun 2009 18:17:25 +0200
- Subject: Re: [IFUNC] PATCH: Add an ifunc attribute
- References: <20090628151052.GA17118@lucon.org>
On Sun, Jun 28, 2009 at 5:10 PM, H.J. Lu<firstname.lastname@example.org> wrote:
> Here is a patch to add ifunc attribute, including many testscases
> in C and C++. ?Any comments?
+/* Get the function return type inside function body. Return a pointer
+ to the function for IFUNC function. */
+static inline tree
+function_return_type (const_tree decl)
+ if (DECL_IS_IFUNC (decl))
+ return build_pointer_type (TREE_TYPE (decl));
+ return TREE_TYPE (TREE_TYPE (decl));
that's just ... gross. Instead adjust the function signature properly.
Which of course makes your proposal not viable at all.
I think your solution is overdesigned. Do you really expect so much
usage that you need to make it easy to use from C++ (easy as in
not mangle manually)?