summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/Analysis/ScopInfo.cpp')
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 3faaa1464d6..9d48ffb07a2 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -4126,7 +4126,7 @@ void ScopInfo::addPHIReadAccess(PHINode *PHI) {
void ScopInfo::buildScop(Region &R, AssumptionCache &AC) {
unsigned MaxLoopDepth = getMaxLoopDepthInRegion(R, *LI, *SD);
- scop = new Scop(R, *SE, ctx, MaxLoopDepth);
+ scop.reset(new Scop(R, *SE, ctx, MaxLoopDepth));
buildStmts(R, R);
buildAccessFunctions(R, R);
@@ -4153,15 +4153,10 @@ void ScopInfo::print(raw_ostream &OS, const Module *) const {
scop->print(OS);
}
-void ScopInfo::clear() {
- if (scop) {
- delete scop;
- scop = 0;
- }
-}
+void ScopInfo::clear() { scop.reset(); }
//===----------------------------------------------------------------------===//
-ScopInfo::ScopInfo() : RegionPass(ID), scop(0) {
+ScopInfo::ScopInfo() : RegionPass(ID) {
ctx = isl_ctx_alloc();
isl_options_set_on_error(ctx, ISL_ON_ERROR_ABORT);
}
@@ -4207,8 +4202,7 @@ bool ScopInfo::runOnRegion(Region *R, RGPassManager &RGM) {
if (scop->isEmpty() || !scop->hasFeasibleRuntimeContext()) {
Msg = "SCoP ends here but was dismissed.";
- delete scop;
- scop = nullptr;
+ scop.reset();
} else {
Msg = "SCoP ends here.";
++ScopFound;
OpenPOWER on IntegriCloud