make findDebugLoc a class method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dale Johannesen
2010-01-20 21:36:02 +00:00
parent 917d628256
commit 73e884bb3e
4 changed files with 26 additions and 23 deletions
+18 -16
View File
@@ -524,24 +524,26 @@ bool MachineBasicBlock::CorrectExtraCFGEdges(MachineBasicBlock *DestA,
return MadeChange;
}
/// findDebugLoc - find the next valid DebugLoc starting at MBBI, skipping
/// any DEBUG_VALUE instructions. Return UnknownLoc if there is none.
DebugLoc
MachineBasicBlock::findDebugLoc(MachineBasicBlock::iterator &MBBI) {
DebugLoc DL;
MachineBasicBlock::iterator E = end();
if (MBBI != E) {
// Skip debug declarations, we don't want a DebugLoc from them.
MachineBasicBlock::iterator MBBI2 = MBBI;
while (MBBI2 != E &&
MBBI2->getOpcode()==TargetInstrInfo::DEBUG_VALUE)
MBBI2++;
if (MBBI2 != E)
DL = MBBI2->getDebugLoc();
}
return DL;
}
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) {
DebugLoc DL;
if (MBBI != MBB.end()) {
// Skip debug declarations, we don't want a DebugLoc from them.
MachineBasicBlock::iterator MBBI2 = MBBI;
while (MBBI2 != MBB.end() &&
MBBI2->getOpcode()==TargetInstrInfo::DEBUG_VALUE)
MBBI2++;
if (MBBI2 != MBB.end())
DL = MBBI2->getDebugLoc();
}
return DL;
}