aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-02-29 00:33:41 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-02-29 00:33:41 +0000
commit30e98a03a3c524026e2da2607e04bb655b0b6350 (patch)
tree918eb0da58d10019f3f26e1de5fb0eb955db2f8b /lib/CodeGen
parentd1d721660edf3f4e76ea69fd5579f857b97a3150 (diff)
downloadexternal_llvm-30e98a03a3c524026e2da2607e04bb655b0b6350.zip
external_llvm-30e98a03a3c524026e2da2607e04bb655b0b6350.tar.gz
external_llvm-30e98a03a3c524026e2da2607e04bb655b0b6350.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151684 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/MachineVerifier.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/MachineVerifier.cpp b/lib/CodeGen/MachineVerifier.cpp
index ace8252..62e263a 100644
--- a/lib/CodeGen/MachineVerifier.cpp
+++ b/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())