/// blocks in a function.
//===----------------------------------------------------------------------===//
+#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
unsigned CFIInstrInserter::verify(MachineFunction &MF) {
unsigned ErrorNum = 0;
- for (MachineBasicBlock &CurrMBB : MF) {
- const MBBCFAInfo &CurrMBBInfo = MBBVector[CurrMBB.getNumber()];
- for (MachineBasicBlock *Succ : CurrMBB.successors()) {
+ for (auto *CurrMBB : depth_first(&MF)) {
+ const MBBCFAInfo &CurrMBBInfo = MBBVector[CurrMBB->getNumber()];
+ for (MachineBasicBlock *Succ : CurrMBB->successors()) {
const MBBCFAInfo &SuccMBBInfo = MBBVector[Succ->getNumber()];
// Check that incoming offset and register values of successors match the
// outgoing offset and register values of CurrMBB