OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c51c340
)
SCEV: Use I = vector<>.erase(I) to iterate and delete at the same time
author
Tobias Grosser
<tobias@grosser.es>
Thu, 8 May 2014 07:12:44 +0000
(07:12 +0000)
committer
Tobias Grosser
<tobias@grosser.es>
Thu, 8 May 2014 07:12:44 +0000
(07:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208282
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
patch
|
blob
|
history
diff --git
a/lib/Analysis/ScalarEvolution.cpp
b/lib/Analysis/ScalarEvolution.cpp
index
148e58d
..
8f5a2a9
100644
(file)
--- a/
lib/Analysis/ScalarEvolution.cpp
+++ b/
lib/Analysis/ScalarEvolution.cpp
@@
-7223,12
+7223,9
@@
static void findArrayDimensionsRec(ScalarEvolution &SE,
Terms[I] = Q;
}
- // Remove all SCEVConstants.
- for (unsigned I = 0; I < Terms.size();)
- if (isa<SCEVConstant>(Terms[I]))
- Terms.erase(Terms.begin() + I);
- else
- ++I;
+ for (auto I = Terms.begin(), E = Terms.end(); I != E; I++)
+ if (isa<SCEVConstant>(*I))
+ I = Terms.erase(I);
if (Terms.size() > 0)
findArrayDimensionsRec(SE, Terms, Sizes, Zero, One);