aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-02-16 22:21:33 +0000
committerTed Kremenek <kremenek@apple.com>2009-02-16 22:21:33 +0000
commit4b441f057688cf0d3e6d74ac530ce3eb2d965c5e (patch)
tree63080b07d354b1fdf80a569bc0665e0f0134b6da
parent2140e904dbe53657339cb5b1cc13de563ca0d1fc (diff)
Modify getMaxValue/getMinValue to take pointer values as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64682 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/PathSensitive/BasicValueFactory.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/clang/Analysis/PathSensitive/BasicValueFactory.h b/include/clang/Analysis/PathSensitive/BasicValueFactory.h
index a494962789..f25bf5da1d 100644
--- a/include/clang/Analysis/PathSensitive/BasicValueFactory.h
+++ b/include/clang/Analysis/PathSensitive/BasicValueFactory.h
@@ -90,15 +90,15 @@ public:
}
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) {