forked from OSchip/llvm-project
Move terminator machine verification to check MachineBasicBlock::instr_iterator instead of MBB::iterator
llvm-svn: 158154
This commit is contained in:
parent
bbc5bbf4f1
commit
cd72016cab
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue