[cfe-commits] r59956 - in /cfe/trunk: include/clang/Analysis/PathSensitive/SVals.h lib/Analysis/SVals.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Mon Nov 24 01:38:23 PST 2008
Author: zhongxingxu
Date: Mon Nov 24 03:38:21 2008
New Revision: 59956
URL: http://llvm.org/viewvc/llvm-project?rev=59956&view=rev
Log:
Add utility methods.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h
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=59956&r1=59955&r2=59956&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h Mon Nov 24 03:38:21 2008
@@ -174,12 +174,17 @@
static NonLoc MakeVal(BasicValueFactory& BasicVals, unsigned X,
bool isUnsigned);
+ static NonLoc MakeVal(BasicValueFactory& BasicVals, uint64_t X,
+ unsigned BitWidth, bool isUnsigned);
+
static NonLoc MakeVal(BasicValueFactory& BasicVals, uint64_t X, QualType T);
static NonLoc MakeVal(BasicValueFactory& BasicVals, IntegerLiteral* I);
static NonLoc MakeVal(BasicValueFactory& BasicVals, const llvm::APInt& I,
bool isUnsigned);
+
+ static NonLoc MakeVal(BasicValueFactory& BasicVals, const llvm::APSInt& I);
static NonLoc MakeIntTruthVal(BasicValueFactory& BasicVals, bool b);
Modified: cfe/trunk/lib/Analysis/SVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SVals.cpp?rev=59956&r1=59955&r2=59956&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/SVals.cpp (original)
+++ cfe/trunk/lib/Analysis/SVals.cpp Mon Nov 24 03:38:21 2008
@@ -248,6 +248,11 @@
isUnsigned));
}
+NonLoc NonLoc::MakeVal(BasicValueFactory& BasicVals, uint64_t X,
+ unsigned BitWidth, bool isUnsigned) {
+ return nonloc::ConcreteInt(BasicVals.getValue(X, BitWidth, isUnsigned));
+}
+
NonLoc NonLoc::MakeVal(BasicValueFactory& BasicVals, uint64_t X, QualType T) {
return nonloc::ConcreteInt(BasicVals.getValue(X, T));
}
@@ -263,6 +268,10 @@
return nonloc::ConcreteInt(BasicVals.getValue(I, isUnsigned));
}
+NonLoc NonLoc::MakeVal(BasicValueFactory& BasicVals, const llvm::APSInt& I) {
+ return nonloc::ConcreteInt(BasicVals.getValue(I));
+}
+
NonLoc NonLoc::MakeIntTruthVal(BasicValueFactory& BasicVals, bool b) {
return nonloc::ConcreteInt(BasicVals.getTruthValue(b));
}
More information about the cfe-commits
mailing list