]> granicus.if.org Git - clang/commitdiff
Add utility methods.
authorZhongxing Xu <xuzhongxing@gmail.com>
Mon, 24 Nov 2008 09:38:21 +0000 (09:38 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Mon, 24 Nov 2008 09:38:21 +0000 (09:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59956 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/SVals.h
lib/Analysis/SVals.cpp

index 0bacc863e14eded64c567a6df069025e35db3a9c..ca78f66099b0f58c094539ac365a9e42930d6859 100644 (file)
@@ -174,12 +174,17 @@ public:
   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);
 
index 0210729b46964c2c8498209a2fc6a6ecefc8dfc0..524904dafaffee68687d1d22c0e3bf107709804d 100644 (file)
@@ -248,6 +248,11 @@ NonLoc NonLoc::MakeVal(BasicValueFactory& BasicVals, unsigned X,
                                                 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 @@ NonLoc NonLoc::MakeVal(BasicValueFactory& BasicVals, const llvm::APInt& I,
   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));
 }