[cfe-dev] __builtin_malloc, __builtin_calloc support in cfe

Jean-Daniel Dupas devlists at shadowlab.org
Tue Apr 17 04:23:14 PDT 2012


Le 17 avr. 2012 à 12:55, Joerg Sonnenberger a écrit :

> On Tue, Apr 17, 2012 at 02:08:37PM +0530, rajesh viswabramana wrote:
>> Hi,
>> 
>> Is builtin's __builtin_malloc, __builtin_calloc supported in clang fe??
>> 
>> 
>> I checked in
>> - "tools/clang/include/clang/Basic/Builtins.def",
>> - "tools/clang/lib/CodeGen/CGBuiltin.cpp" and couldn't find the
>> implementation.
>> 
>> 
>> Is there any particular reason for not supporting it currently ?
> 
> What's the point of them? Can the compiler do anything useful with them
> except turning them back to calls of the corresponding library
> functions? "GCC has them" IMO is a bad reason in this case by itself.
> 

Especially when the workaround is as simple as 

#define __builtin_malloc malloc


-- Jean-Daniel








More information about the cfe-dev mailing list