summaryrefslogtreecommitdiffstats
path: root/polly/lib/Support/ScopHelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/Support/ScopHelper.cpp')
-rw-r--r--polly/lib/Support/ScopHelper.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/polly/lib/Support/ScopHelper.cpp b/polly/lib/Support/ScopHelper.cpp
index 87ee1abbb55..9541c8edffd 100644
--- a/polly/lib/Support/ScopHelper.cpp
+++ b/polly/lib/Support/ScopHelper.cpp
@@ -88,11 +88,8 @@ BasicBlock *polly::createSingleExitEdge(Region *R, Pass *P) {
static void replaceScopAndRegionEntry(polly::Scop *S, BasicBlock *OldEntry,
BasicBlock *NewEntry) {
- for (polly::ScopStmt *Stmt : *S)
- if (Stmt->getBasicBlock() == OldEntry) {
- Stmt->setBasicBlock(NewEntry);
- break;
- }
+ if (polly::ScopStmt *Stmt = S->getStmtForBasicBlock(OldEntry))
+ Stmt->setBasicBlock(NewEntry);
S->getRegion().replaceEntryRecursive(NewEntry);
}
OpenPOWER on IntegriCloud