summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-06-23 19:32:16 +0000
committerEd Schouten <ed@FreeBSD.org>2009-06-23 19:32:16 +0000
commitf698f7e71940663e26a4806a96fb0bdfa160c886 (patch)
tree258c14596f927fd77ae8d727dc9c3d4471bf0f46 /include
parentd6aff018d446f22be4e4e0277080ebfa5b157288 (diff)
Notes
Diffstat (limited to 'include')
-rw-r--r--include/clang/Analysis/PathSensitive/GRState.h39
-rw-r--r--include/clang/Analysis/PathSensitive/MemRegion.h14
2 files changed, 19 insertions, 34 deletions
diff --git a/include/clang/Analysis/PathSensitive/GRState.h b/include/clang/Analysis/PathSensitive/GRState.h
index 2cb3f9470cf0e..98f1242ad81ec 100644
--- a/include/clang/Analysis/PathSensitive/GRState.h
+++ b/include/clang/Analysis/PathSensitive/GRState.h
@@ -530,21 +530,6 @@ public:
private:
- // Methods that query & manipulate the Environment.
- SVal GetSVal(const GRState* St, const Stmt* Ex) {
- return St->getEnvironment().GetSVal(Ex, ValueMgr);
- }
-
- SVal GetSValAsScalarOrLoc(const GRState* state, const Stmt *S) {
- if (const Expr *Ex = dyn_cast<Expr>(S)) {
- QualType T = Ex->getType();
- if (Loc::IsLocType(T) || T->isIntegerType())
- return GetSVal(state, S);
- }
-
- return UnknownVal();
- }
-
SVal GetBlkExprSVal(const GRState* St, const Stmt* Ex) {
return St->getEnvironment().GetBlkExprSVal(Ex, ValueMgr);
}
@@ -589,21 +574,11 @@ public:
// Methods that manipulate the GDM.
const GRState* addGDM(const GRState* St, void* Key, void* Data);
- // Methods that query or create regions.
- bool hasStackStorage(const MemRegion* R) {
- return getRegionManager().hasStackStorage(R);
- }
-
// Methods that query & manipulate the Store.
void iterBindings(const GRState* state, StoreManager::BindingsHandler& F) {
StoreMgr->iterBindings(state->getStore(), F);
}
-
-
- SVal GetSVal(const GRState* state, Loc LV, QualType T = QualType()) {
- return StoreMgr->Retrieve(state, LV, T);
- }
SVal GetSVal(const GRState* state, const MemRegion* R) {
return StoreMgr->Retrieve(state, loc::MemRegionVal(R));
@@ -781,19 +756,25 @@ inline const llvm::APSInt *GRState::getSymVal(SymbolRef sym) const {
}
inline SVal GRState::getSVal(const Stmt* Ex) const {
- return Mgr->GetSVal(this, Ex);
+ return getEnvironment().GetSVal(Ex, Mgr->ValueMgr);
}
inline SVal GRState::getBlkExprSVal(const Stmt* Ex) const {
return Mgr->GetBlkExprSVal(this, Ex);
}
-inline SVal GRState::getSValAsScalarOrLoc(const Stmt *Ex) const {
- return Mgr->GetSValAsScalarOrLoc(this, Ex);
+inline SVal GRState::getSValAsScalarOrLoc(const Stmt *S) const {
+ if (const Expr *Ex = dyn_cast<Expr>(S)) {
+ QualType T = Ex->getType();
+ if (Loc::IsLocType(T) || T->isIntegerType())
+ return getSVal(S);
+ }
+
+ return UnknownVal();
}
inline SVal GRState::getSVal(Loc LV, QualType T) const {
- return Mgr->GetSVal(this, LV, T);
+ return Mgr->StoreMgr->Retrieve(this, LV, T);
}
inline SVal GRState::getSVal(const MemRegion* R) const {
diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Analysis/PathSensitive/MemRegion.h
index ac158dc88f5c4..65ac0b53027c8 100644
--- a/include/clang/Analysis/PathSensitive/MemRegion.h
+++ b/include/clang/Analysis/PathSensitive/MemRegion.h
@@ -33,7 +33,7 @@ namespace llvm { class raw_ostream; }
namespace clang {
class MemRegionManager;
-
+class MemSpaceRegion;
/// MemRegion - The root abstract class for all memory regions.
class MemRegion : public llvm::FoldingSetNode {
@@ -68,6 +68,14 @@ public:
virtual MemRegionManager* getMemRegionManager() const = 0;
std::string getString() const;
+
+ const MemSpaceRegion *getMemorySpace() const;
+
+ bool hasStackStorage() const;
+
+ bool hasHeapStorage() const;
+
+ bool hasHeapOrStackStorage() const;
virtual void print(llvm::raw_ostream& os) const;
@@ -668,10 +676,6 @@ public:
assert(R);
return R == globals;
}
-
- bool hasStackStorage(const MemRegion* R);
-
- bool hasHeapStorage(const MemRegion* R);
private:
MemSpaceRegion* LazyAllocate(MemSpaceRegion*& region);