This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Adding new builtin function to gcc
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Ons Boutiti <ons dot boutiti at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 23 May 2016 12:41:59 +0100
- Subject: Re: Adding new builtin function to gcc
- Authentication-results: sourceware.org; auth=none
- References: <CAJ4_6Xc2wVXUre8O2-0Q=TQiDc-Q6i2HK-+AOCwZ+3sFtovE7g at mail dot gmail dot com>
On 23 May 2016 at 12:37, Ons Boutiti wrote:
> Hi all,
> I have read about gcc builtin functions and its utility, I would ask
> some basic questions: how can I implement a new built-in function into
> gcc?!
It depends what you want the function to do.
> is there a manual or an exemple to follow it because i just
> found definitions.
I added the C++ __is_final builtin with the patch attached to
https://gcc.gnu.org/ml/gcc-patches/2011-12/msg00231.html -- that might
give you some hints about how to extend the compiler to recognise a
new builtin function, but you'll still need to implement its
functionality yourself.