// Iterate over basic blocks in a function for (MachineFunction::iterator BB = MF.begin(), E = MF.end(); BB != E; ++BB) { // Do something with each basic block analyzeBasicBlock(BB); } // Iterate over instructions in a basic block for (MachineBasicBlock::iterator MI = BB->begin(), MIEnd = BB->end(); MI != MIEnd; ++MI) { // Do something with each instruction analyzeInstruction(MI); }These examples illustrate how the cpp machinebasicblock iterator can be used to traverse a machine code function and its basic blocks, and then further iterate over the instructions within each basic block. The package library for the cpp machinebasicblock iterator is LLVM, as it is a component of the LLVM project.