#include "llvm/CodeGen/MachineBasicBlock.h" using namespace llvm; int main() { MachineFunction *MF = nullptr; // assume MachineFunction is a valid pointer MachineBasicBlock *MBB = nullptr; // assume MachineBasicBlock is a valid pointer // Get the first successor of the current basic block MachineBasicBlock::iterator SuccBB = MBB->succ_begin(); // Iterate over all successors of the current basic block for (MachineBasicBlock::succ_iterator SI = MBB->succ_begin(), SE = MBB->succ_end(); SI != SE; ++SI) { MachineBasicBlock *SuccMBB = *SI; // ... } return 0; }In this example, we initialize the `SuccBB` iterator with the first successor of the `MBB` basic block. We then use a `for` loop to iterate over all successors of `MBB` to do something with them. The `succ_begin` function is part of the LLVM C++ library.