[PATCH] Use more DECL_BUILT_IN_P macro.

Martin Liška mliska@suse.cz
Tue Aug 28 07:17:00 GMT 2018


On 08/27/2018 06:02 PM, Martin Sebor wrote:
> On 08/27/2018 01:20 AM, Martin Liška wrote:
>> +/* For a FUNCTION_DECL NODE, nonzero means a built in function of a
>> + standard library or more generally a built in function that is
>> + recognized by optimizers and expanders.

Hi.

Thanks for help with that.

> 
> I'm a little confused by this description: the last part makes
> me wonder about what a true value implies about a function.  It
> sounds like the function returns true for any built-in, library
> or otherwise, correct (i.e., including a front-end built-in)?
> If yes, then maybe drop the part about standard library functions?
> Say:
> 
>   Return true if a FUNCTION_DECL NODE is a GCC built-in function.

Yes, it's better!

> 
> 
>> +
>> + Note that it is different from the DECL_IS_BUILTIN accessor. For
>> + instance, user declared prototypes of C library functions are not
>> + DECL_IS_BUILTIN but may be DECL_BUILT_IN.
>> +
>> + When a NULL argument is pass or tree code of the NODE is not
>> FUNCTION_DECL
>> + false is returned. */
> 
> "Passed" -- so perhaps "When NODE is null..."

Ho be honest this part became out of date, I'm going to remove that.

There's a part that I'm going to install.

Martin

> 
> Martin
> 
>> +
>> +inline bool
>> +fndecl_built_in_p (const_tree node)
>> +{
>> + return (node != NULL_TREE
>> + && DECL_BUILT_IN_CLASS (node) != NOT_BUILT_IN);
>> +}
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Update-documentation-of-fndecl_built_in_p.patch
Type: text/x-patch
Size: 2709 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180828/43b5552c/attachment.bin>


More information about the Gcc-patches mailing list