summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
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
commite9bc579c37c038abb66ac30489a1e26e5045ef9f (patch)
tree3abf644028ed631aa020ef203627ddb7184677db /llvm/lib/Target
parentec6f7fed54cdcc0e2588f912626314c0a58b24d7 (diff)
downloadbcm5719-llvm-e9bc579c37c038abb66ac30489a1e26e5045ef9f.tar.gz
bcm5719-llvm-e9bc579c37c038abb66ac30489a1e26e5045ef9f.zip
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. llvm-svn: 261498
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/ARM/ARMConstantIslandPass.cpp2
-rw-r--r--llvm/lib/Target/X86/X86MCInstLower.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
index df168c7c8ec..904616535ff 100644
--- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -2251,7 +2251,7 @@ adjustJTTargetBlockForward(MachineBasicBlock *BB, MachineBasicBlock *JTBB) {
// If the block ends in an unconditional branch, move it. The prior block
// has to have an analyzable terminator for us to move this one. Be paranoid
// and make sure we're not trying to move the entry block of the function.
- if (!B && Cond.empty() && BB != MF->begin() &&
+ if (!B && Cond.empty() && BB != &MF->front() &&
!TII->AnalyzeBranch(*OldPrior, TBB, FBB, CondPrior)) {
BB->moveAfter(JTBB);
OldPrior->updateTerminator();
diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp
index e1ca558f0f2..45380e09ab3 100644
--- a/llvm/lib/Target/X86/X86MCInstLower.cpp
+++ b/llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -988,7 +988,7 @@ static MachineBasicBlock::const_iterator
PrevCrossBBInst(MachineBasicBlock::const_iterator MBBI) {
const MachineBasicBlock *MBB = MBBI->getParent();
while (MBBI == MBB->begin()) {
- if (MBB == MBB->getParent()->begin())
+ if (MBB == &MBB->getParent()->front())
return nullptr;
MBB = MBB->getPrevNode();
MBBI = MBB->end();
OpenPOWER on IntegriCloud