diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index 24bb9c5b1f11..8b3c56adde24 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -1596,7 +1596,7 @@ class ScopInfo : public RegionPass { void clear(); // Build the SCoP for Region @p R. - Scop *buildScop(Region &R, DominatorTree &DT); + void buildScop(Region &R, DominatorTree &DT); /// @brief Build an instance of MemoryAccess from the Load/Store instruction. /// diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 6f3b8520bf9c..eb9bff873cdd 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -3252,9 +3252,9 @@ void ScopInfo::addPHIReadAccess(PHINode *PHI) { MemoryAccess::PHI); } -Scop *ScopInfo::buildScop(Region &R, DominatorTree &DT) { +void ScopInfo::buildScop(Region &R, DominatorTree &DT) { unsigned MaxLoopDepth = getMaxLoopDepthInRegion(R, *LI, *SD); - Scop *S = new Scop(R, AccFuncMap, *SE, DT, ctx, MaxLoopDepth); + scop = new Scop(R, AccFuncMap, *SE, DT, ctx, MaxLoopDepth); buildAccessFunctions(R, R); @@ -3268,8 +3268,7 @@ Scop *ScopInfo::buildScop(Region &R, DominatorTree &DT) { if (!R.getExitingBlock()) buildAccessFunctions(R, *R.getExit(), nullptr, /* IsExitBlock */ true); - S->init(*LI, *SD, *AA); - return S; + scop->init(*LI, *SD, *AA); } void ScopInfo::print(raw_ostream &OS, const Module *) const { @@ -3324,7 +3323,7 @@ bool ScopInfo::runOnRegion(Region *R, RGPassManager &RGM) { TD = &F->getParent()->getDataLayout(); DominatorTree &DT = getAnalysis().getDomTree(); - scop = buildScop(*R, DT); + buildScop(*R, DT); DEBUG(scop->print(dbgs()));