[LLVMdev] LLVM:help

John Criswell criswell at uiuc.edu
Fri Jun 25 08:08:30 PDT 2010

> How can I get list of its predecessor basic blocks from a basic block?

I believe you can use a pred_iterator to iterate over the predecessors 
of a basic block.

See the implementation of BasicBlock::getUniquePredecessor() 
(http://llvm.org/doxygen/BasicBlock_8cpp_source.html#l00157) for an 
example of how to use it.

BTW, if you haven't discovered it already, the doxygen docs 
(http://llvm.org/doxygen/hierarchy.html) are extremely useful in 
figuring out how to do something in LLVM.  I use them all the time.

-- John T.
> --Rajwinder Singh

More information about the llvm-dev mailing list