summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-09-01 17:39:24 +0000
committerJordan Rose <jordan_rose@apple.com>2012-09-01 17:39:24 +0000
commit21580c2f92ff56fc3dc2ea239e59d2bae2e8469b (patch)
tree2e3c43005d57bd70691ed1cbc45e1daa58a42391 /clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
parenta44ad1b35c9f411dcf56058e70468da75dbbe126 (diff)
downloadbcm5719-llvm-21580c2f92ff56fc3dc2ea239e59d2bae2e8469b.tar.gz
bcm5719-llvm-21580c2f92ff56fc3dc2ea239e59d2bae2e8469b.zip
[analyzer] Disallow creation of int vals with explicit bit width / signedness.
All clients of BasicValueFactory should be using QualTypes instead, and indeed it seems they are. This caught the (fortunately harmless) bug fixed in the previous commit. No intended functionality change. llvm-svn: 163069
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp b/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
index 20c73612c48..a6c400f3704 100644
--- a/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
@@ -101,11 +101,7 @@ const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, unsigned BitWidth,
const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, QualType T) {
- unsigned bits = Ctx.getTypeSize(T);
- llvm::APSInt V(bits,
- T->isUnsignedIntegerOrEnumerationType() || Loc::isLocType(T));
- V = X;
- return getValue(V);
+ return getValue(getAPSIntType(T).getValue(X));
}
const CompoundValData*
OpenPOWER on IntegriCloud