[cfe-commits] r68711 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRExprEngine.h include/clang/Analysis/PathSensitive/SVals.h include/clang/Analysis/PathSensitive/ValueManager.h lib/Analysis/GRExprEngine.cpp lib/Analysis/SVals.cpp
Ted Kremenek
kremenek at apple.com
Thu Apr 9 09:46:56 PDT 2009
Author: kremenek
Date: Thu Apr 9 11:46:55 2009
New Revision: 68711
URL: http://llvm.org/viewvc/llvm-project?rev=68711&view=rev
Log:
Remove SVal::MakeZero and replace it with ValueManager::makeZeroVal.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h
cfe/trunk/include/clang/Analysis/PathSensitive/ValueManager.h
cfe/trunk/lib/Analysis/GRExprEngine.cpp
cfe/trunk/lib/Analysis/SVals.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h?rev=68711&r1=68710&r2=68711&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Thu Apr 9 11:46:55 2009
@@ -63,6 +63,9 @@
/// SymMgr - Object that manages the symbol information.
SymbolManager& SymMgr;
+ /// ValMgr - Object that manages/creates SVals.
+ ValueManager &ValMgr;
+
/// EntryNode - The immediate predecessor node.
NodeTy* EntryNode;
@@ -465,13 +468,8 @@
return StateMgr.getBasicVals();
}
- ValueManager &getValueManager() {
- return StateMgr.getValueManager();
- }
-
- const ValueManager &getValueManager() const {
- return StateMgr.getValueManager();
- }
+ ValueManager &getValueManager() { return ValMgr; }
+ const ValueManager &getValueManager() const { return ValMgr; }
// FIXME: Remove when we migrate over to just using ValueManager.
SymbolManager& getSymbolManager() { return SymMgr; }
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h?rev=68711&r1=68710&r2=68711&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h Thu Apr 9 11:46:55 2009
@@ -97,8 +97,6 @@
return getRawKind() > UnknownKind;
}
- static SVal MakeZero(BasicValueFactory &BasicVals, QualType T);
-
bool isZeroConstant() const;
/// getAsLocSymbol - If this SVal is a location (subclasses Loc) and
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/ValueManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/ValueManager.h?rev=68711&r1=68710&r2=68711&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/ValueManager.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/ValueManager.h Thu Apr 9 11:46:55 2009
@@ -77,6 +77,9 @@
Loc makeRegionVal(SymbolRef Sym) {
return Loc::MakeVal(MemMgr->getSymbolicRegion(Sym));
}
+
+ /// makeZeroVal - Construct an SVal representing '0' for the specified type.
+ SVal makeZeroVal(QualType T);
};
} // end clang namespace
#endif
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=68711&r1=68710&r2=68711&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Thu Apr 9 11:46:55 2009
@@ -122,6 +122,7 @@
Builder(NULL),
StateMgr(G.getContext(), SMC, CMC, G.getAllocator(), cfg, CD, L),
SymMgr(StateMgr.getSymbolManager()),
+ ValMgr(StateMgr.getValueManager()),
CurrentStmt(NULL),
NSExceptionII(NULL), NSExceptionInstanceRaiseSelectors(NULL),
RaiseSel(GetNullarySelector("raise", G.getContext())),
@@ -1742,7 +1743,7 @@
// it most likely isn't nil. We should assume the semantics
// of this case unless we have *a lot* more knowledge.
//
- SVal V = SVal::MakeZero(getBasicVals(), ME->getType());
+ SVal V = ValMgr.makeZeroVal(ME->getType());
MakeNode(Dst, ME, Pred, BindExpr(StNull, ME, V));
return;
}
Modified: cfe/trunk/lib/Analysis/SVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SVals.cpp?rev=68711&r1=68710&r2=68711&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/SVals.cpp (original)
+++ cfe/trunk/lib/Analysis/SVals.cpp Thu Apr 9 11:46:55 2009
@@ -205,7 +205,7 @@
// Utility methods for constructing SVals.
//===----------------------------------------------------------------------===//
-SVal SVal::MakeZero(BasicValueFactory &BasicVals, QualType T) {
+SVal ValueManager::makeZeroVal(QualType T) {
if (Loc::IsLocType(T))
return Loc::MakeNull(BasicVals);
More information about the cfe-commits
mailing list