projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3f4491
)
Correct a glitch in r194424 which may invalidate iterator.
author
Shuxin Yang
<shuxin.llvm@gmail.com>
Tue, 12 Nov 2013 08:33:03 +0000
(08:33 +0000)
committer
Shuxin Yang
<shuxin.llvm@gmail.com>
Tue, 12 Nov 2013 08:33:03 +0000
(08:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194457
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/GVN.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/GVN.cpp
b/lib/Transforms/Scalar/GVN.cpp
index d353765b42ae9e6c38e4407603caacd204780a88..6af269dfed32ef184ee1c883a8d91f78fa40a9a1 100644
(file)
--- a/
lib/Transforms/Scalar/GVN.cpp
+++ b/
lib/Transforms/Scalar/GVN.cpp
@@
-2730,7
+2730,9
@@
void GVN::addDeadBlock(BasicBlock *BB) {
if (DeadBlocks.count(B))
continue;
- for (pred_iterator PI = pred_begin(B), PE = pred_end(B); PI != PE; PI++) {
+ SmallVector<BasicBlock *, 4> Preds(pred_begin(B), pred_end(B));
+ for (SmallVectorImpl<BasicBlock *>::iterator PI = Preds.begin(),
+ PE = Preds.end(); PI != PE; PI++) {
BasicBlock *P = *PI;
if (!DeadBlocks.count(P))