For LLVM Basic Blocks, represented by class BasicBlock
, how can I identify which nearest loop (if any) contains that block . And I want to identify this inside a runOnModule
pass.
You can register an LoopInfo dependency and use getLoopFor(BasicBlock *BB):
Loop* llvm::LoopInfo::getLoopFor(const BasicBlock *BB) const
You can check the documentation in: http://llvm.org/doxygen/classllvm_1_1LoopInfo.html#a4abca289c73cd09487e05d11d9f7d877
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With