From 9f276d6279dea92e7657555cb30a0a6f8d1bfa89 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 3 Mar 2009 19:02:42 +0000 Subject: [PATCH] Don't use std::auto_ptr with getSubRegionMap(). llvm-svn: 65957 --- clang/include/clang/Analysis/PathSensitive/Store.h | 5 +++-- clang/lib/Analysis/BasicStore.cpp | 4 ++-- clang/lib/Analysis/GRState.cpp | 2 +- clang/lib/Analysis/RegionStore.cpp | 7 +++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/clang/include/clang/Analysis/PathSensitive/Store.h b/clang/include/clang/Analysis/PathSensitive/Store.h index ac0625dd0199..4514de752df6 100644 --- a/clang/include/clang/Analysis/PathSensitive/Store.h +++ b/clang/include/clang/Analysis/PathSensitive/Store.h @@ -81,8 +81,9 @@ public: MemRegionManager& getRegionManager() { return MRMgr; } /// getSubRegionMap - Returns an opaque map object that clients can query - /// to get the subregions of a given MemRegion object. - virtual std::auto_ptr getSubRegionMap(const GRState *state) = 0; + /// to get the subregions of a given MemRegion object. It is the + // caller's responsibility to 'delete' the returned map. + virtual SubRegionMap* getSubRegionMap(const GRState *state) = 0; virtual SVal getLValueVar(const GRState* St, const VarDecl* VD) = 0; diff --git a/clang/lib/Analysis/BasicStore.cpp b/clang/lib/Analysis/BasicStore.cpp index 35c6652fe58b..2e619baf2f48 100644 --- a/clang/lib/Analysis/BasicStore.cpp +++ b/clang/lib/Analysis/BasicStore.cpp @@ -47,8 +47,8 @@ public: ~BasicStoreManager() {} - std::auto_ptr getSubRegionMap(const GRState *state) { - return std::auto_ptr(new BasicStoreSubRegionMap()); + SubRegionMap* getSubRegionMap(const GRState *state) { + return new BasicStoreSubRegionMap(); } SVal Retrieve(const GRState *state, Loc loc, QualType T = QualType()); diff --git a/clang/lib/Analysis/GRState.cpp b/clang/lib/Analysis/GRState.cpp index 28e819085aff..eb6b1b5cfaa9 100644 --- a/clang/lib/Analysis/GRState.cpp +++ b/clang/lib/Analysis/GRState.cpp @@ -278,7 +278,7 @@ bool ScanReachableSymbols::scan(const MemRegion *R) { // Now look at the subregions. if (!SRM.get()) - SRM.reset(state.getManager().getStoreManager().getSubRegionMap(state).get()); + SRM.reset(state.getManager().getStoreManager().getSubRegionMap(state)); return SRM->iterSubRegions(R, *this); } diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index 6238ff20ed7a..f3d1f0a44fe4 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/lib/Analysis/RegionStore.cpp @@ -161,7 +161,7 @@ public: MemRegionManager& getRegionManager() { return MRMgr; } - std::auto_ptr getSubRegionMap(const GRState *state); + SubRegionMap* getSubRegionMap(const GRState *state); const GRState* BindCompoundLiteral(const GRState* St, const CompoundLiteralExpr* CL, SVal V); @@ -303,8 +303,7 @@ StoreManager* clang::CreateRegionStoreManager(GRStateManager& StMgr) { return new RegionStoreManager(StMgr); } -std::auto_ptr -RegionStoreManager::getSubRegionMap(const GRState *state) { +SubRegionMap* RegionStoreManager::getSubRegionMap(const GRState *state) { RegionBindingsTy B = GetRegionBindings(state->getStore()); RegionStoreSubRegionMap *M = new RegionStoreSubRegionMap(); @@ -313,7 +312,7 @@ RegionStoreManager::getSubRegionMap(const GRState *state) { M->add(R->getSuperRegion(), R); } - return std::auto_ptr(M); + return M; } /// getLValueString - Returns an SVal representing the lvalue of a