[LLVMdev] Walking all the predecessors for a basic block

Chris Lattner sabre at nondot.org
Tue Jan 22 10:30:49 PST 2008


On Tue, 22 Jan 2008, Ted Kremenek wrote:
> For your particular task, I *think* you would do the following
> (someone else please correct me if I am wrong):
>
> #include "llvm/Support/CFG.h"
> #include "llvm/ADT/DepthFirstIterator.h"
>
> for (idf_iterator<BasicBlock*> I=idf_begin(BB), E=idf_end(BB); I != E;
> ++I) {
>   BasicBlock* B = *I;

Yep, that's perfect.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list