<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>It also occurs on several (different) test cases. I have founded that assershion rises in <span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="color: #910e66">void</span></span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "> ValueHandleBase::ValueIsDeleted(</span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="color: #056243">Value</span></span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "> *V);</span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><br></span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; ">Code from function:</span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><br></span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(81, 145, 116); "><span style="color: #000000">  </span>// All <span style="text-decoration: underline">callbacks</span>, weak references, and assertingVHs should be dropped by now.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(23, 22, 201); "><span style="color: #000000">  </span><span style="color: #910e66">if</span><span style="color: #000000"> (V-></span>HasValueHandle<span style="color: #000000">) {</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(81, 145, 116); "><span style="color: #910e66">#ifndef</span><span style="color: #000000"> NDEBUG      </span>// Only in +Asserts mode...</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">    dbgs() << <span style="color: #411ffb">"While deleting: "</span> << *V->getType() << <span style="color: #411ffb">" %"</span> << V->getNameStr()</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">           << <span style="color: #411ffb">"\n"</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">    <span style="color: #910e66">if</span> (pImpl-><span style="color: #1716c9">ValueHandles</span>[V]->getKind() == <span style="color: #1716c9">Assert</span>)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(65, 31, 251); "><span style="color: #000000">      llvm_unreachable(</span>"An asserting value handle still pointed to this</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">                       <span style="color: #411ffb">" value!"</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(145, 14, 102); ">#endif</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(65, 31, 251); "><span style="color: #000000">    llvm_unreachable(</span>"All references to V were not removed?"<span style="color: #000000">);</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">  }</div></span></div><br><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Yours sincerely,</div><div>Kadysev Mikhail</div></div></div>
</div>

<br><div><div>22.04.2012, в 1:41, Dmitry N. Mikushin написал(а):</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Assertion occurs on some different test case? Could you attach its IR-code?<br><br>22 апреля 2012 г. 1:38 пользователь Михаил <<a href="mailto:neonomaly.x@gmail.com">neonomaly.x@gmail.com</a>> написал:<br><blockquote type="cite">Yes<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Yours sincerely,<br></blockquote><blockquote type="cite">Kadysev Mikhail<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">22.04.2012, в 0:30, Dmitry N. Mikushin написал(а):<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Could you reproduce this assertion with my test program?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">22 апреля 2012 г. 0:09 пользователь Михаил <<a href="mailto:neonomaly.x@gmail.com">neonomaly.x@gmail.com</a>> написал:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks, but I replaceAllUsesWith() - works well, but I still get bug in<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">eraseFromParent():<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">While deleting: i32 (%class.B*, i32)* %_ZN1B1xEi<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">An asserting value handle still pointed to this value!<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">UNREACHABLE executed at /Users/neonomaly/LLVM/LLVM/lib/VMCore/Value.cpp:561!<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Yours sincerely,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Kadysev Mikhail<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">21.04.2012, в 23:45, Nick Lewycky написал(а):<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Михаил wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">How correctly remove function from module?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">For example:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">int f1(int x) {<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">...<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">a = f2(smth);<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">...<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">}<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">int f2 (int y) {<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">...<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">b = f1(smth);<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">...<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">}<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I need delete from module both f1 and f2. They haven't uses in other<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">part of module, but I can't delete them with eraseFromParent, because<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">they are use each other.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Call X->replaceAllUsesWith(UndefValue::get(X->getType)) before calling<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">X->eraseFromParent().<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Nick<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">LLVM Developers mailing list<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote></div></blockquote></div><br></body></html>