<div dir="ltr">void Wave::init (const Function &F){<br><div class="gmail_quote"><div dir="ltr"><div>    Function::const_iterator ie = F.end();<br></div><div>    outs() << ie << "\n\n";<br></div><div>    for (Function::const_iterator I = F.begin(), IE = F.end(); I != IE; I++, K++){<br></div><div>       outs() << I << "\n";<br></div>       // some manipulation with I<br><div><div><div>    }<br>}<br><br></div><div>I used the above shown function in my pass in LLVM 3.4.2 and it used to work fine but when I am compiling this pass with 3.5.0, this is a never ending loop. Can someone please suggest me what can be wrong here ?<br><br></div><div>Upon some debugging, I found out that const_iterator I never becomes equal to IE, rather it goes past IE when incremented and hence loop never ends.<br><br></div><div>Following is the output upon executing above code.<br><br>0x2e08248 <- address of ie<br>0x2e16630 <- address of I initially<br>0x2e08250 <- incremented I<br>0x2e165e0<br>0x2e16630<br>0x2e08250<br>0x2e165e0<br>0x2e16630<br>0x2e08250<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br><br clear="all"><div><div><br>-- <br><div><div dir="ltr"><div>Regards,<br>Pranav Kant,<br></div><div>Department of Computer Science<br>National Institute of Technology Hamirpur<br></div><div><a href="http://pricked.in/" target="_blank">http://pricked.in/</a><br></div></div></div>
</div></div></div></font></span></div></div></div>
</div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Regards,<br>Pranav Kant,<br></div><div>Department of Computer Science<br>National Institute of Technology Hamirpur<br></div><div><a href="http://pricked.in/" target="_blank">http://pricked.in/</a><br></div></div></div>
</div>