__builtin_malloc, __builtin_calloc support in cfe

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 ?

Thanks in advance,
Viswa

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.

Joerg

Especially when the workaround is as simple as

#define __builtin_malloc malloc

-- Jean-Daniel