summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CFIInstrInserter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/CFIInstrInserter.cpp')
-rw-r--r--llvm/lib/CodeGen/CFIInstrInserter.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/CFIInstrInserter.cpp b/llvm/lib/CodeGen/CFIInstrInserter.cpp
index f3bc859b146..b021d960921 100644
--- a/llvm/lib/CodeGen/CFIInstrInserter.cpp
+++ b/llvm/lib/CodeGen/CFIInstrInserter.cpp
@@ -18,6 +18,7 @@
/// blocks in a function.
//===----------------------------------------------------------------------===//
+#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
@@ -291,9 +292,9 @@ void CFIInstrInserter::report(const MBBCFAInfo &Pred,
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
OpenPOWER on IntegriCloud