aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-12 10:49:54 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-12 10:49:54 +0000
commitd19eac5be5507f538e254f6269b894726385f253 (patch)
treeeecfb14d5a8614fb9bf27fb789c8f78de9abd9a3 /lib/Transforms/Utils/Local.cpp
parentbd9e2354797a0dce3ef4cbd618da08c18ca1a54c (diff)
downloadexternal_llvm-d19eac5be5507f538e254f6269b894726385f253.zip
external_llvm-d19eac5be5507f538e254f6269b894726385f253.tar.gz
external_llvm-d19eac5be5507f538e254f6269b894726385f253.tar.bz2
cache dereferenced iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/Local.cpp')
-rw-r--r--lib/Transforms/Utils/Local.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp
index b9fcfd5..0b48a8f 100644
--- a/lib/Transforms/Utils/Local.cpp
+++ b/lib/Transforms/Utils/Local.cpp
@@ -432,9 +432,11 @@ static bool CanPropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
// Use that list to make another list of common predecessors of BB and Succ
BlockSet CommonPreds;
for (pred_iterator PI = pred_begin(Succ), PE = pred_end(Succ);
- PI != PE; ++PI)
- if (BBPreds.count(*PI))
- CommonPreds.insert(*PI);
+ PI != PE; ++PI) {
+ BasicBlock *P = *PI;
+ if (BBPreds.count(P))
+ CommonPreds.insert(P);
+ }
// Shortcut, if there are no common predecessors, merging is always safe
if (CommonPreds.empty())