<p dir="ltr">This may be difficult yo reproduce or debug without a more complete (though preferably minimal) test case.</p>
<div class="gmail_quote">On Feb 8, 2015 8:31 AM, "Pranav Kant" <<a href="mailto:pranav913@gmail.com">pranav913@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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><font color="#888888"><br></font></span></div><span><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><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>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div>