summaryrefslogtreecommitdiffstats
path: root/clang
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
commit9f276d6279dea92e7657555cb30a0a6f8d1bfa89 (patch)
treed987fc827733d2a63c951f17ff73d21cf395d21d /clang
parente3852bd252364d684e8869b7ba066066d9fe658a (diff)
downloadbcm5719-llvm-9f276d6279dea92e7657555cb30a0a6f8d1bfa89.tar.gz
bcm5719-llvm-9f276d6279dea92e7657555cb30a0a6f8d1bfa89.zip
Don't use std::auto_ptr with getSubRegionMap().
llvm-svn: 65957
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Analysis/PathSensitive/Store.h5
-rw-r--r--clang/lib/Analysis/BasicStore.cpp4
-rw-r--r--clang/lib/Analysis/GRState.cpp2
-rw-r--r--clang/lib/Analysis/RegionStore.cpp7
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 ac0625dd019..4514de752df 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<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/clang/lib/Analysis/BasicStore.cpp b/clang/lib/Analysis/BasicStore.cpp
index 35c6652fe58..2e619baf2f4 100644
--- a/clang/lib/Analysis/BasicStore.cpp
+++ b/clang/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/clang/lib/Analysis/GRState.cpp b/clang/lib/Analysis/GRState.cpp
index 28e819085af..eb6b1b5cfaa 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 6238ff20ed7..f3d1f0a44fe 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<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
OpenPOWER on IntegriCloud