aboutsummaryrefslogtreecommitdiff
path: root/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
commit91ab900a939e95d965e18299b66928fdbe2aa38d (patch)
tree365b06f4db7270f624b2a34f20588f868d0123d6 /lib/StaticAnalyzer/Core/BasicValueFactory.cpp
parentd04713598ee8af6e01b925dca4e38bfd78227dad (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163069 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/BasicValueFactory.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/BasicValueFactory.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Core/BasicValueFactory.cpp b/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
index 20c73612c4..a6c400f370 100644
--- a/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
+++ b/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*