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
diff --git a/llvm/lib/CodeGen/SjLjEHPrepare.cpp b/llvm/lib/CodeGen/SjLjEHPrepare.cpp
index daf32e4..ce01c5f 100644
--- a/llvm/lib/CodeGen/SjLjEHPrepare.cpp
+++ b/llvm/lib/CodeGen/SjLjEHPrepare.cpp
@@ -419,7 +419,7 @@
// directly to the caller's context, which is what we want anyway, so no need
// to do anything here.
for (BasicBlock &BB : F) {
- if (&BB == F.begin())
+ if (&BB == &F.front())
continue;
for (Instruction &I : BB)
if (I.mayThrow())
@@ -434,7 +434,7 @@
// Following any allocas not in the entry block, update the saved SP in the
// jmpbuf to the new value.
for (BasicBlock &BB : F) {
- if (&BB == F.begin())
+ if (&BB == &F.front())
continue;
for (Instruction &I : BB) {
if (auto *CI = dyn_cast<CallInst>(&I)) {