summaryrefslogtreecommitdiffstats
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
commitfc3eb09a0f5d05a9f93f6b4859a5aff40db81a2b (patch)
treee5292b1801690001cd3771af8199388b023704d9
parentb8211f643671dee1861a93ed40e2f17d39441172 (diff)
downloadbcm5719-llvm-fc3eb09a0f5d05a9f93f6b4859a5aff40db81a2b.tar.gz
bcm5719-llvm-fc3eb09a0f5d05a9f93f6b4859a5aff40db81a2b.zip
Modify getMaxValue/getMinValue to take pointer values as well.
llvm-svn: 64682
-rw-r--r--clang/include/clang/Analysis/PathSensitive/BasicValueFactory.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/BasicValueFactory.h b/clang/include/clang/Analysis/PathSensitive/BasicValueFactory.h
index a4949627897..f25bf5da1d3 100644
--- a/clang/include/clang/Analysis/PathSensitive/BasicValueFactory.h
+++ b/clang/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) {
OpenPOWER on IntegriCloud