[cfe-commits] r68800 - in /cfe/trunk: include/clang/Analysis/PathSensitive/SVals.h include/clang/Analysis/PathSensitive/ValueManager.h lib/Analysis/GRSimpleVals.cpp lib/Analysis/SVals.cpp
Ted Kremenek
kremenek at apple.com
Fri Apr 10 11:11:44 PDT 2009
Author: kremenek
Date: Fri Apr 10 13:11:44 2009
New Revision: 68800
URL: http://llvm.org/viewvc/llvm-project?rev=68800&view=rev
Log:
Move a few more NonLoc static functions to ValueManager.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h
cfe/trunk/include/clang/Analysis/PathSensitive/ValueManager.h
cfe/trunk/lib/Analysis/GRSimpleVals.cpp
cfe/trunk/lib/Analysis/SVals.cpp
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=68800&r1=68799&r2=68800&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h Fri Apr 10 13:11:44 2009
@@ -164,15 +164,6 @@
void print(llvm::raw_ostream& Out) const;
// Utility methods to create NonLocs.
- static NonLoc MakeVal(SymbolRef sym);
-
- static NonLoc MakeVal(SymbolManager& SymMgr, const SymExpr *lhs,
- BinaryOperator::Opcode op, const llvm::APSInt& rhs,
- QualType T);
-
- static NonLoc MakeVal(SymbolManager& SymMgr, const SymExpr *lhs,
- BinaryOperator::Opcode op, const SymExpr *rhs,
- QualType T);
static NonLoc MakeIntVal(BasicValueFactory& BasicVals, uint64_t X,
bool isUnsigned);
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=68800&r1=68799&r2=68800&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/ValueManager.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/ValueManager.h Fri Apr 10 13:11:44 2009
@@ -84,6 +84,14 @@
SVal getConjuredSymbolVal(const Expr* E, QualType T, unsigned Count);
SVal getFunctionPointer(const FunctionDecl* FD);
+
+ NonLoc makeNonLoc(SymbolRef sym);
+
+ NonLoc makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op,
+ const llvm::APSInt& rhs, QualType T);
+
+ NonLoc makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op,
+ const SymExpr *rhs, QualType T);
};
} // end clang namespace
#endif
Modified: cfe/trunk/lib/Analysis/GRSimpleVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRSimpleVals.cpp?rev=68800&r1=68799&r2=68800&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRSimpleVals.cpp (original)
+++ cfe/trunk/lib/Analysis/GRSimpleVals.cpp Fri Apr 10 13:11:44 2009
@@ -231,10 +231,11 @@
}
case nonloc::SymbolValKind:
- if (isa<nonloc::ConcreteInt>(R))
- return NonLoc::MakeVal(Eng.getSymbolManager(),
- cast<nonloc::SymbolVal>(L).getSymbol(), Op,
- cast<nonloc::ConcreteInt>(R).getValue(), T);
+ if (isa<nonloc::ConcreteInt>(R)) {
+ ValueManager &ValMgr = Eng.getValueManager();
+ return ValMgr.makeNonLoc(cast<nonloc::SymbolVal>(L).getSymbol(), Op,
+ cast<nonloc::ConcreteInt>(R).getValue(), T);
+ }
else
return UnknownVal();
}
Modified: cfe/trunk/lib/Analysis/SVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SVals.cpp?rev=68800&r1=68799&r2=68800&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/SVals.cpp (original)
+++ cfe/trunk/lib/Analysis/SVals.cpp Fri Apr 10 13:11:44 2009
@@ -218,12 +218,12 @@
// Utility methods for constructing Non-Locs.
//===----------------------------------------------------------------------===//
-NonLoc NonLoc::MakeVal(SymbolRef sym) {
+NonLoc ValueManager::makeNonLoc(SymbolRef sym) {
return nonloc::SymbolVal(sym);
}
-NonLoc NonLoc::MakeVal(SymbolManager& SymMgr, const SymExpr *lhs,
- BinaryOperator::Opcode op, const APSInt& v, QualType T) {
+NonLoc ValueManager::makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op,
+ const APSInt& v, QualType T) {
// The Environment ensures we always get a persistent APSInt in
// BasicValueFactory, so we don't need to get the APSInt from
// BasicValueFactory again.
@@ -231,9 +231,8 @@
return nonloc::SymExprVal(SymMgr.getSymIntExpr(lhs, op, v, T));
}
-NonLoc NonLoc::MakeVal(SymbolManager& SymMgr, const SymExpr *lhs,
- BinaryOperator::Opcode op, const SymExpr *rhs,
-QualType T) {
+NonLoc ValueManager::makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op,
+ const SymExpr *rhs, QualType T) {
assert(SymMgr.getType(lhs) == SymMgr.getType(rhs));
assert(!Loc::IsLocType(T));
return nonloc::SymExprVal(SymMgr.getSymSymExpr(lhs, op, rhs, T));
@@ -294,7 +293,7 @@
// Only handle integers for now.
if (T->isIntegerType() && T->isScalarType())
- return NonLoc::MakeVal(sym);
+ return makeNonLoc(sym);
}
return UnknownVal();
@@ -314,7 +313,7 @@
return Loc::MakeVal(MemMgr.getSymbolicRegion(sym));
if (T->isIntegerType() && T->isScalarType())
- return NonLoc::MakeVal(sym);
+ return makeNonLoc(sym);
return UnknownVal();
}
@@ -334,7 +333,7 @@
return Loc::MakeVal(MemMgr.getSymbolicRegion(sym));
if (T->isIntegerType() && T->isScalarType())
- return NonLoc::MakeVal(sym);
+ return makeNonLoc(sym);
return UnknownVal();
}
More information about the cfe-commits
mailing list