<div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">When I'm iterating through I only directly add BitCastInsts and a<br>
single CallInst(Im assuming the functions I also created are<br>
elsewhere). Unfortunately it doesnt look like theres is a good way to<br>
convert between the the iterator I and a CallInst *. Am I missing<br>
something?<br></blockquote><div><br></div><div>I'm not entirely sure how this relates to my explanation/suggestion.</div><div><br></div><div>How does your algorithm work? If you, say, add an extra CallInst every time you see a call, then you're going to loop infinitely (inserting calls on the calls you just inserted, etc) unless you make sure you skip over everything you insert... that would be an algorithmic bug in your code, nothing to do with iterator invalidation semantics.</div>
<div><br></div><div>Once you've got that figured out, we can see what kind of loop you'll need to write/how to deal with iterator invalidation.</div><div><br></div><div>- David</div></div>