aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-03 19:02:42 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-03 19:02:42 +0000
commit14453bf723c025034823e4d4005a98ee176753a0 (patch)
treefd5d6569c6ee0ecf66a738c6a3f0219c50e0984a
parent3e9061f77bab715e3e2bc01a655d5a4e791bd985 (diff)
Don't use std::auto_ptr with getSubRegionMap().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65957 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/PathSensitive/Store.h5
-rw-r--r--lib/Analysis/BasicStore.cpp4
-rw-r--r--lib/Analysis/GRState.cpp2
-rw-r--r--lib/Analysis/RegionStore.cpp7
4 files changed, 9 insertions, 9 deletions
diff --git a/include/clang/Analysis/PathSensitive/Store.h b/include/clang/Analysis/PathSensitive/Store.h
index ac0625dd01..4514de752d 100644
--- a/include/clang/Analysis/PathSensitive/Store.h
+++ b/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<SubRegionMap> 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/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp
index 35c6652fe5..2e619baf2f 100644
--- a/lib/Analysis/BasicStore.cpp
+++ b/lib/Analysis/BasicStore.cpp
@@ -47,8 +47,8 @@ public:
~BasicStoreManager() {}
- std::auto_ptr<SubRegionMap> getSubRegionMap(const GRState *state) {
- return std::auto_ptr<SubRegionMap>(new BasicStoreSubRegionMap());
+ SubRegionMap* getSubRegionMap(const GRState *state) {
+ return new BasicStoreSubRegionMap();
}
SVal Retrieve(const GRState *state, Loc loc, QualType T = QualType());
diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp
index 28e819085a..eb6b1b5cfa 100644
--- a/lib/Analysis/GRState.cpp
+++ b/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/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index 6238ff20ed..f3d1f0a44f 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -161,7 +161,7 @@ public:
MemRegionManager& getRegionManager() { return MRMgr; }
- std::auto_ptr<SubRegionMap> 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<SubRegionMap>
-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<SubRegionMap>(M);
+ return M;
}
/// getLValueString - Returns an SVal representing the lvalue of a