summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-01-20 21:36:02 +0000
committerDale Johannesen <dalej@apple.com>2010-01-20 21:36:02 +0000
commitc5db59981395b018506d04c1e0e39c7f72c7470d (patch)
treed17916e68058f8b864cc7879470d24a173bb7af0 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent720d00553aaaac6ea2457bdc76a09edc7f1b593c (diff)
downloadbcm5719-llvm-c5db59981395b018506d04c1e0e39c7f72c7470d.tar.gz
bcm5719-llvm-c5db59981395b018506d04c1e0e39c7f72c7470d.zip
make findDebugLoc a class method
llvm-svn: 94032
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 030438fceb5..9215bd583b5 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -524,24 +524,26 @@ bool MachineBasicBlock::CorrectExtraCFGEdges(MachineBasicBlock *DestA,
return MadeChange;
}
-void llvm::WriteAsOperand(raw_ostream &OS, const MachineBasicBlock *MBB,
- bool t) {
- OS << "BB#" << MBB->getNumber();
-}
-
/// findDebugLoc - find the next valid DebugLoc starting at MBBI, skipping
/// any DEBUG_VALUE instructions. Return UnknownLoc if there is none.
DebugLoc
-llvm::findDebugLoc(MachineBasicBlock::iterator &MBBI, MachineBasicBlock &MBB) {
+MachineBasicBlock::findDebugLoc(MachineBasicBlock::iterator &MBBI) {
DebugLoc DL;
- if (MBBI != MBB.end()) {
+ MachineBasicBlock::iterator E = end();
+ if (MBBI != E) {
// Skip debug declarations, we don't want a DebugLoc from them.
MachineBasicBlock::iterator MBBI2 = MBBI;
- while (MBBI2 != MBB.end() &&
+ while (MBBI2 != E &&
MBBI2->getOpcode()==TargetInstrInfo::DEBUG_VALUE)
MBBI2++;
- if (MBBI2 != MBB.end())
+ if (MBBI2 != E)
DL = MBBI2->getDebugLoc();
}
return DL;
}
+
+void llvm::WriteAsOperand(raw_ostream &OS, const MachineBasicBlock *MBB,
+ bool t) {
+ OS << "BB#" << MBB->getNumber();
+}
+
OpenPOWER on IntegriCloud