[PATCH] Detect deallocation calls even if the deallocation function has a definition

Philip Reames listmail at philipreames.com
Mon Dec 15 17:01:38 PST 2014


On 12/04/2014 04:11 PM, Richard Smith wrote:
> When Clang emits a call to a C++14 sized deallocation function, it 
> emits a weak definition of that function in case the underlying C++ 
> ABI library doesn't provide it:
>
>   call _ZdlPvm(i8* %p, i64 8) builtin
>
> // ...
>
>   define linkonce void @_ZdlPvm(i8* %p, i64) nobuiltin {
>     call void @_ZdlPvm(i8* %p)
>     ret void
>   }
>
> However, LLVM's detection of deallocation functions is broken by this: 
> it assumes that if we have a definition of the deallocation function, 
> then it's not really a deallocation function. I'm not sure why this is 
> the case. The check was added in response to this review comment:
>
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091102/090282.html
>
> The attached patch removes this condition (and thus avoids the 
> optimization regression in C++14 mode), but I'm wary about removing a 
> check that I don't understand, so I was wondering if anyone knew the 
> justification for having this test?
Reading over the review comment, the point of the comment in question 
was how to do the comparison of the call's target against the free 
function.  I suspect the declaration check was accidental.


>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141215/4e22daf9/attachment.html>


More information about the llvm-commits mailing list