diff options
author | Dale Johannesen <dalej@apple.com> | 2010-01-20 21:36:02 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2010-01-20 21:36:02 +0000 |
commit | 73e884bb3e971b1e794ba2501df15138f73b8b1a (patch) | |
tree | faeace4a1ac5310bba52fb09b777f44711436340 /lib/CodeGen/MachineBasicBlock.cpp | |
parent | 917d6282567e4d0bb0e0e4ef4b4cd153661fccfa (diff) |
make findDebugLoc a class method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94032 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | lib/CodeGen/MachineBasicBlock.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 030438fceb..9215bd583b 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/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(); +} + |