<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">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>