diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-02-29 00:33:41 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-02-29 00:33:41 +0000 |
commit | 8017d805051f1d123ccf6f3e0a3cf891c03593c5 (patch) | |
tree | 23037967b435842eb9e254e11622d3e94feb311e /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | 1dc712f7ccb96d0268b5f87400a6a577a5b9b40e (diff) | |
download | bcm5719-llvm-8017d805051f1d123ccf6f3e0a3cf891c03593c5.tar.gz bcm5719-llvm-8017d805051f1d123ccf6f3e0a3cf891c03593c5.zip |
Move the operand iterator into MachineInstrBundle.h where it belongs.
Extract a base class and provide four specific sub-classes for iterating
over const/non-const bundles/instructions.
This eliminates the mystery bool constructor argument.
llvm-svn: 151684
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index ace8252385a..62e263ac900 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -28,6 +28,7 @@ #include "llvm/CodeGen/LiveIntervalAnalysis.h" #include "llvm/CodeGen/LiveVariables.h" #include "llvm/CodeGen/LiveStackAnalysis.h" +#include "llvm/CodeGen/MachineInstrBundle.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineMemOperand.h" @@ -1104,7 +1105,7 @@ void MachineVerifier::verifyLiveIntervals() { } } else { // Non-PHI def. - MachineInstr *MI = LiveInts->getInstructionFromIndex(VNI->def); + const MachineInstr *MI = LiveInts->getInstructionFromIndex(VNI->def); if (!MI) { report("No instruction at def index", MF); *OS << "Valno #" << VNI->id << " is defined at " << VNI->def @@ -1114,7 +1115,7 @@ void MachineVerifier::verifyLiveIntervals() { bool hasDef = false; bool isEarlyClobber = false; - for (MIOperands MOI(MI, true); MOI.isValid(); ++MOI) { + for (ConstMIBundleOperands MOI(MI); MOI.isValid(); ++MOI) { if (!MOI->isReg() || !MOI->isDef()) continue; if (TargetRegisterInfo::isVirtualRegister(LI.reg)) { @@ -1197,7 +1198,7 @@ void MachineVerifier::verifyLiveIntervals() { continue; // The live segment is ending inside EndMBB - MachineInstr *MI = + const MachineInstr *MI = LiveInts->getInstructionFromIndex(I->end.getPrevSlot()); if (!MI) { report("Live segment doesn't end at a valid instruction", EndMBB); @@ -1242,7 +1243,7 @@ void MachineVerifier::verifyLiveIntervals() { // use, or a dead flag on a def. bool hasRead = false; bool hasDeadDef = false; - for (MIOperands MOI(MI, true); MOI.isValid(); ++MOI) { + for (ConstMIBundleOperands MOI(MI); MOI.isValid(); ++MOI) { if (!MOI->isReg() || MOI->getReg() != LI.reg) continue; if (MOI->readsReg()) |