All, Is there a fast way to retrieve all of the predecessors to a BasicBlock in a function. Specifically, is there a fast way to iterate through all BasicBlocks which can break to a specific BasicBlock? Thanks, Billy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131114/aa6220a2/attachment.html>
Hi Billy,> Is there a fast way to retrieve all of the predecessors to a BasicBlock > in a function. Specifically, is there a fast way to iterate through all > BasicBlocks which can break to a specific BasicBlock?CFG.h defines pred_iterator to do just this. So after including llvm/Support/CFG.h you can iterate through the predecessors of a BasicBlock bb using something like for (pred_iterator PI = pred_begin(bb), E = pred_end(bb); PI != E; ++PI) { .... } --Stephan