<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 15, 2014 at 5:01 PM, Philip Reames <span dir="ltr"><<a href="mailto:listmail@philipreames.com" target="_blank">listmail@philipreames.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div><div class="h5">
<br>
<div>On 12/04/2014 04:11 PM, Richard Smith
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">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:
<div><br>
</div>
<div>Â call _ZdlPvm(i8* %p, i64 8) builtin</div>
<div><br>
</div>
<div>// ...</div>
<div><br>
</div>
<div>Â define linkonce void @_ZdlPvm(i8* %p, i64) nobuiltin {</div>
<div>Â Â call void @_ZdlPvm(i8* %p)</div>
<div>Â Â ret void</div>
<div>Â }</div>
<div><br>
</div>
<div>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:</div>
<div><br>
</div>
<div>Â <a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091102/090282.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091102/090282.html</a><br>
</div>
<div><br>
</div>
<div>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?</div>
</div>
</blockquote></div></div>
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.Â
<br></div></blockquote><div><br></div><div>Me too, thanks. Committed as r226069.</div></div></div></div>