Sorry, forgot to add group to CC.<br><div class="gmail_quote">On Sun, Nov 20, 2011 at 6:14 PM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com">ryta1203@gmail.com</a>></span> wrote:<br><blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote">
<div>Cameron,</div><div> </div><div>  To make it less vague, I would ideally like to traverse top down. I believe what you suggested is what I want, I will have a look at it. </div><div> </div><div>  Currently, I am iterating over the BBs in a Function, so Function::iterator BBitr=F->begin(), BBitrE=F->end(); BBitr!=BBitrE;++BBitr, does that help clarify what I'm looking for? With this current iteration method, I seem to sometimes get top down but other times get bottom up and sometimes it starts top down then jumps to the bottom and goes bottom up. Is there a reason for this randomness?<br>

<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_quote">On Sun, Nov 20, 2011 at 6:10 PM, Cameron Zwarich <span dir="ltr"><<a href="mailto:zwarich@apple.com" target="_blank">zwarich@apple.com</a>></span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote">
Your question is a bit vague, but you probably want ReversePostOrderTraversal from include/llvm/ADT/PostOrderIterator.h.<br>
<br>
Cameron<br>
<div><div><br>
On Nov 20, 2011, at 3:00 PM, Ryan Taylor wrote:<br>
<br>
> LLVMers,<br>
><br>
>   Is there any way to guarantee iteration of the basic blocks from top down or path to path? Currently it looks sort of semi-random, sometimes visiting loop heads first and other times loop tails, is there a way I can visit the BBs top down or path to path?<br>


><br>
> Thank you.<br>
</div></div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">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><br>
</div></div></blockquote></div><br>