<div dir="ltr">OK - so would "skipDebugInstructionsForward" ever need the end iterator? since it should always come across a non-debug instruction (all valid BBs have at least one non-debug instruction, the terminator - though I guess you might call this function on an invalid basic block during construction/intermediate state changes, etc).<br><br>& if it doesn't need the end, then it doesn't need the MBB and could be a static function.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 16, 2018 at 7:49 PM Heejin Ahn via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">aheejin added a comment.<br>
<br>
> Maybe this could be tested for, though - without debug info this findDebugLoc would potentially search forever or crash, perhaps? Since it would never compare == end (because it's a comparison across two different lists)? Seems like it'd be good to have that test case?<br>
<br>
No, if there is at least a single instruction within `Header` and it does not have debug info, it would just return it's empty debug info. It wouldn't search onward past `end()`.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D45711" rel="noreferrer" target="_blank">https://reviews.llvm.org/D45711</a><br>
<br>
<br>
<br>
</blockquote></div>