<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Vladimir,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>The e = end() is no longer needed.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Cheers,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-- Jim</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV><DIV>On Jun 8, 2006, at 12:46 PM, Vladimir Prus wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+Instruction* BasicBlock::getFirstNonPHI()</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+{</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>BasicBlock::iterator i = begin(), e = end();</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>// All valid basic blocks should have a terminator,</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>// which is not a PHINode. If we have invalid basic</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>// block we'll get assert when dereferencing past-the-end</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>// iterator.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>while (isa<PHINode>(i)) ++i;</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+<SPAN class="Apple-converted-space">    </SPAN>return &*i;</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+}</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="2" style="font: 10.0px Monaco">+</FONT></P> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>