diff options
| author | Hongbin Zheng <etherzhhb@gmail.com> | 2016-02-13 15:13:02 +0000 |
|---|---|---|
| committer | Hongbin Zheng <etherzhhb@gmail.com> | 2016-02-13 15:13:02 +0000 |
| commit | fec328083af1366635d5b5d0ef9d5945d06d82f0 (patch) | |
| tree | 543f33b6c8d837e3deafa7a4e050c64c284b63b8 /polly/lib/Analysis/ScopInfo.cpp | |
| parent | 660f3ccfa5beb7ea057613bbc42a7a5070ad9c61 (diff) | |
| download | bcm5719-llvm-fec328083af1366635d5b5d0ef9d5945d06d82f0.tar.gz bcm5719-llvm-fec328083af1366635d5b5d0ef9d5945d06d82f0.zip | |
Use unique_ptr to manage Scop inside ScopInfo.
llvm-svn: 260821
Diffstat (limited to 'polly/lib/Analysis/ScopInfo.cpp')
| -rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 14 |
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; |

