diff options
author | Pete Cooper <peter_cooper@apple.com> | 2012-06-07 17:41:39 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2012-06-07 17:41:39 +0000 |
commit | 83569cb062930a62e96ba87a47b002366e00124d (patch) | |
tree | 354f7920c78ce0b5ba6bb594c64fdb53ea8158d6 /lib/CodeGen/MachineVerifier.cpp | |
parent | 4efea94fa54d0e8687b965fdf3ba46022c8e15c4 (diff) |
Move terminator machine verification to check MachineBasicBlock::instr_iterator instead of MBB::iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158154 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | lib/CodeGen/MachineVerifier.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/CodeGen/MachineVerifier.cpp b/lib/CodeGen/MachineVerifier.cpp index a5ee1d59f3..7c64fc65e6 100644 --- a/lib/CodeGen/MachineVerifier.cpp +++ b/lib/CodeGen/MachineVerifier.cpp @@ -596,6 +596,17 @@ void MachineVerifier::visitMachineBundleBefore(const MachineInstr *MI) { } lastIndex = idx; } + + // Ensure non-terminators don't follow terminators. + // Ignore predicated terminators formed by if conversion. + // FIXME: If conversion shouldn't need to violate this rule. + if (MI->isTerminator() && !TII->isPredicated(MI)) { + if (!FirstTerminator) + FirstTerminator = MI; + } else if (FirstTerminator) { + report("Non-terminator instruction after the first terminator", MI); + *OS << "First terminator was:\t" << *FirstTerminator; + } } void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) { @@ -631,17 +642,6 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) { } } - // Ensure non-terminators don't follow terminators. - // Ignore predicated terminators formed by if conversion. - // FIXME: If conversion shouldn't need to violate this rule. - if (MI->isTerminator() && !TII->isPredicated(MI)) { - if (!FirstTerminator) - FirstTerminator = MI; - } else if (FirstTerminator) { - report("Non-terminator instruction after the first terminator", MI); - *OS << "First terminator was:\t" << *FirstTerminator; - } - StringRef ErrorInfo; if (!TII->verifyInstruction(MI, ErrorInfo)) report(ErrorInfo.data(), MI); |