summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineLoopInfo.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-02-21 20:39:50 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-02-21 20:39:50 +0000
commit8de6150816ce1efec2b1180fd8fe70364b45270f (patch)
tree0389a693a270e89471039a84b8a9f0332f79d7d9 /lib/CodeGen/MachineLoopInfo.cpp
parentd73d33fedf5dd5ad2b6a34eef0afa24a8cebe84e (diff)
ADT: Remove == and != comparisons between ilist iterators and pointers
I missed == and != when I removed implicit conversions between iterators and pointers in r252380 since they were defined outside ilist_iterator. Since they depend on getNodePtrUnchecked(), they indirectly rely on UB. This commit removes all uses of these operators. (I'll delete the operators themselves in a separate commit so that it can be easily reverted if necessary.) There should be NFC here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261498 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineLoopInfo.cpp')
-rw-r--r--lib/CodeGen/MachineLoopInfo.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/MachineLoopInfo.cpp b/lib/CodeGen/MachineLoopInfo.cpp
index 117c390f032..376f78fda1c 100644
--- a/lib/CodeGen/MachineLoopInfo.cpp
+++ b/lib/CodeGen/MachineLoopInfo.cpp
@@ -50,11 +50,12 @@ void MachineLoopInfo::getAnalysisUsage(AnalysisUsage &AU) const {
MachineBasicBlock *MachineLoop::getTopBlock() {
MachineBasicBlock *TopMBB = getHeader();
MachineFunction::iterator Begin = TopMBB->getParent()->begin();
- if (TopMBB != Begin) {
+ if (TopMBB->getIterator() != Begin) {
MachineBasicBlock *PriorMBB = &*std::prev(TopMBB->getIterator());
while (contains(PriorMBB)) {
TopMBB = PriorMBB;
- if (TopMBB == Begin) break;
+ if (TopMBB->getIterator() == Begin)
+ break;
PriorMBB = &*std::prev(TopMBB->getIterator());
}
}
@@ -64,7 +65,7 @@ MachineBasicBlock *MachineLoop::getTopBlock() {
MachineBasicBlock *MachineLoop::getBottomBlock() {
MachineBasicBlock *BotMBB = getHeader();
MachineFunction::iterator End = BotMBB->getParent()->end();
- if (BotMBB != std::prev(End)) {
+ if (BotMBB->getIterator() != std::prev(End)) {
MachineBasicBlock *NextMBB = &*std::next(BotMBB->getIterator());
while (contains(NextMBB)) {
BotMBB = NextMBB;