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 | cd72016cabb4727bbdd01a7556056c92391d6516 (patch) | |
tree | 419f375fd11b74d5b4ada07db3f1c4258328e200 /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | bbc5bbf4f1015a1aab068adb4dedc444586aaf21 (diff) | |
download | bcm5719-llvm-cd72016cabb4727bbdd01a7556056c92391d6516.tar.gz bcm5719-llvm-cd72016cabb4727bbdd01a7556056c92391d6516.zip |
Move terminator machine verification to check MachineBasicBlock::instr_iterator instead of MBB::iterator
llvm-svn: 158154
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index a5ee1d59f31..7c64fc65e60 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/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); |