diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-02-21 20:39:50 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-02-21 20:39:50 +0000 |
commit | e9bc579c37c038abb66ac30489a1e26e5045ef9f (patch) | |
tree | 3abf644028ed631aa020ef203627ddb7184677db /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | ec6f7fed54cdcc0e2588f912626314c0a58b24d7 (diff) | |
download | bcm5719-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/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index f9711e3e7a0..dc56ebb08d1 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1382,7 +1382,7 @@ static bool SinkThenElseCodeToEnd(BranchInst *BI1) { // We need to update RE1 and RE2 if we are going to sink the first // instruction in the basic block down. - bool UpdateRE1 = (I1 == BB1->begin()), UpdateRE2 = (I2 == BB2->begin()); + bool UpdateRE1 = (I1 == &BB1->front()), UpdateRE2 = (I2 == &BB2->front()); // Sink the instruction. BBEnd->getInstList().splice(FirstNonPhiInBBEnd->getIterator(), BB1->getInstList(), I1); @@ -2134,7 +2134,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) { // as "bonus instructions", and only allow this transformation when the // number of the bonus instructions does not exceed a certain threshold. unsigned NumBonusInsts = 0; - for (auto I = BB->begin(); Cond != I; ++I) { + for (auto I = BB->begin(); Cond != &*I; ++I) { // Ignore dbg intrinsics. if (isa<DbgInfoIntrinsic>(I)) continue; @@ -2232,7 +2232,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) { // We already make sure Cond is the last instruction before BI. Therefore, // all instructions before Cond other than DbgInfoIntrinsic are bonus // instructions. - for (auto BonusInst = BB->begin(); Cond != BonusInst; ++BonusInst) { + for (auto BonusInst = BB->begin(); Cond != &*BonusInst; ++BonusInst) { if (isa<DbgInfoIntrinsic>(BonusInst)) continue; Instruction *NewBonusInst = BonusInst->clone(); |