Author: kremenek
Date: Mon Feb 16 16:07:07 2009
New Revision: 64678

URL: http://llvm.org/viewvc/llvm-project?rev=64678&view=rev
Log:
BasicValueFactory: Add utility methods 'Add1' and 'Sub1' to get a persistent 
APSInt value that is 1 greater or 1 less than the provided value.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/BasicValueFactory.h

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/BasicValueFactory.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/BasicValueFactory.h?rev=64678&r1=64677&r2=64678&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/BasicValueFactory.h 
(original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/BasicValueFactory.h Mon Feb 
16 16:07:07 2009
@@ -101,6 +101,18 @@
                                               T->isUnsignedIntegerType()));
   }
   
+  inline const llvm::APSInt& Add1(const llvm::APSInt& V) {
+    llvm::APSInt X = V;
+    ++X;
+    return getValue(X);
+  }
+  
+  inline const llvm::APSInt& Sub1(const llvm::APSInt& V) {
+    llvm::APSInt X = V;
+    --X;
+    return getValue(X);
+  }
+  
   inline const llvm::APSInt& getZeroWithPtrWidth(bool isUnsigned = true) {
     return getValue(0, Ctx.getTypeSize(Ctx.VoidPtrTy), isUnsigned);
   }


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to