[cfe-commits] r64682 - /cfe/trunk/include/clang/Analysis/PathSensitive/BasicValueFactory.h

Ted Kremenek kremenek at apple.com
Mon Feb 16 14:21:33 PST 2009


Author: kremenek
Date: Mon Feb 16 16:21:33 2009
New Revision: 64682

URL: http://llvm.org/viewvc/llvm-project?rev=64682&view=rev
Log:
Modify getMaxValue/getMinValue to take pointer values as well.

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=64682&r1=64681&r2=64682&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/BasicValueFactory.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/BasicValueFactory.h Mon Feb 16 16:21:33 2009
@@ -90,15 +90,15 @@
   }
 
   inline const llvm::APSInt& getMaxValue(QualType T) {
-    assert(T->isIntegerType());
-    return getValue(llvm::APSInt::getMaxValue(Ctx.getTypeSize(T),
-                                              T->isUnsignedIntegerType()));
+    assert(T->isIntegerType() || T->isPointerType());
+    bool isUnsigned = T->isUnsignedIntegerType() || T->isPointerType();
+    return getValue(llvm::APSInt::getMaxValue(Ctx.getTypeSize(T), isUnsigned));
   }
   
   inline const llvm::APSInt& getMinValue(QualType T) {
-    assert(T->isIntegerType());
-    return getValue(llvm::APSInt::getMinValue(Ctx.getTypeSize(T),
-                                              T->isUnsignedIntegerType()));
+    assert(T->isIntegerType() || T->isPointerType());
+    bool isUnsigned = T->isUnsignedIntegerType() || T->isPointerType();
+    return getValue(llvm::APSInt::getMinValue(Ctx.getTypeSize(T), isUnsigned));
   }
   
   inline const llvm::APSInt& Add1(const llvm::APSInt& V) {





More information about the cfe-commits mailing list