<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Adding duncan since he (probably to his dismay), knows a lot about ilist:</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><div>Adding</div></span><div>Because the reverse iterator does not support in-place replacement. If I move the current instruction out of the BB, even if I pre-increment the iterator before, the pre-incremented iterator will also be moved to the new BB. I checked around llvm code base, seems there is no in-place update for reverse iterators.</div></div></div></div></blockquote><div><br></div><div>That seems ... broken.</div><div><br></div><div>I assume the preincrement issue is due to how std::reverse_iterator works (duncan, i assume nothing can be done here)</div><div><br></div><div>However, that just probably means we should make movebefore do the same thing we made eraseFromParent do, so you can construct iterators from the result.</div><div><br></div></div></div></div>