projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0304090
)
[IR] Simplify removeDeadConstantUsers. NFC
author
Fangrui Song
<maskray@google.com>
Wed, 14 Aug 2019 11:38:45 +0000
(11:38 +0000)
committer
Fangrui Song
<maskray@google.com>
Wed, 14 Aug 2019 11:38:45 +0000
(11:38 +0000)
llvm-svn: 368833
llvm/lib/IR/Constants.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/IR/Constants.cpp
b/llvm/lib/IR/Constants.cpp
index
cc1eaed
..
a78de6a
100644
(file)
--- a/
llvm/lib/IR/Constants.cpp
+++ b/
llvm/lib/IR/Constants.cpp
@@
-575,13
+575,10
@@
void Constant::removeDeadConstantUsers() const {
}
// 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);
}
}