[llvm] r368833 - [IR] Simplify removeDeadConstantUsers. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 14 04:38:46 PDT 2019
Author: maskray
Date: Wed Aug 14 04:38:45 2019
New Revision: 368833
URL: http://llvm.org/viewvc/llvm-project?rev=368833&view=rev
Log:
[IR] Simplify removeDeadConstantUsers. NFC
Modified:
llvm/trunk/lib/IR/Constants.cpp
Modified: llvm/trunk/lib/IR/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Constants.cpp?rev=368833&r1=368832&r2=368833&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Constants.cpp (original)
+++ llvm/trunk/lib/IR/Constants.cpp Wed Aug 14 04:38:45 2019
@@ -575,13 +575,10 @@ void Constant::removeDeadConstantUsers()
}
// If the constant was dead, then the iterator is invalidated.
- if (LastNonDeadUser == E) {
+ if (LastNonDeadUser == E)
I = user_begin();
- if (I == E) break;
- } else {
- I = LastNonDeadUser;
- ++I;
- }
+ else
+ I = std::next(LastNonDeadUser);
}
}
More information about the llvm-commits
mailing list