[cfe-commits] r65957 - in /cfe/trunk: include/clang/Analysis/PathSensitive/Store.h lib/Analysis/BasicStore.cpp lib/Analysis/GRState.cpp lib/Analysis/RegionStore.cpp
Ted Kremenek
kremenek at apple.com
Tue Mar 3 11:02:42 PST 2009
Author: kremenek
Date: Tue Mar 3 13:02:42 2009
New Revision: 65957
URL: http://llvm.org/viewvc/llvm-project?rev=65957&view=rev
Log:
Don't use std::auto_ptr with getSubRegionMap().
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/Store.h
cfe/trunk/lib/Analysis/BasicStore.cpp
cfe/trunk/lib/Analysis/GRState.cpp
cfe/trunk/lib/Analysis/RegionStore.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/Store.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/Store.h?rev=65957&r1=65956&r2=65957&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/Store.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/Store.h Tue Mar 3 13:02:42 2009
@@ -81,8 +81,9 @@
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;
Modified: cfe/trunk/lib/Analysis/BasicStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BasicStore.cpp?rev=65957&r1=65956&r2=65957&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/BasicStore.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicStore.cpp Tue Mar 3 13:02:42 2009
@@ -47,8 +47,8 @@
~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());
Modified: cfe/trunk/lib/Analysis/GRState.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRState.cpp?rev=65957&r1=65956&r2=65957&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRState.cpp (original)
+++ cfe/trunk/lib/Analysis/GRState.cpp Tue Mar 3 13:02:42 2009
@@ -278,7 +278,7 @@
// 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);
}
Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=65957&r1=65956&r2=65957&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Tue Mar 3 13:02:42 2009
@@ -161,7 +161,7 @@
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 @@
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 @@
M->add(R->getSuperRegion(), R);
}
- return std::auto_ptr<SubRegionMap>(M);
+ return M;
}
/// getLValueString - Returns an SVal representing the lvalue of a
More information about the cfe-commits
mailing list