[cfe-dev] Attribute nobuiltin for operator new (Znwm)

Friedman, Eli via cfe-dev cfe-dev at lists.llvm.org
Thu May 24 11:07:51 PDT 2018


On 5/24/2018 10:49 AM, Dávid Bolvanský via cfe-dev wrote:
> Hello,
>
> Clang emits attribute "nobuiltin" for operator new/delete (and other 
> variants) even without "-fno-builtin".
>
> Is there any reason for that? This blocks potential "new/delete" 
> transformations...

We mark new expressions with the "builtin" attribute; other uses of 
operator new are treated as nobuiltin because the global operator new 
can be replaced by the user.  See https://reviews.llvm.org/rL186799 and 
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3664.html .  
(At least, that's how it's supposed to work... it's possible there are 
bugs on the LLVM side.)

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project




More information about the cfe-dev mailing list