diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-08-21 20:52:19 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-08-21 20:52:19 +0000 |
commit | 58fc86d68d53eb6c47cc34974b6f37627a5f386c (patch) | |
tree | 7de669d7b0955cbe94c4808e3eaa60dbbf8b1d80 /lib/StaticAnalyzer/Core/RangeConstraintManager.cpp | |
parent | 51a6b3f58b0dbbc51a77b8f4a509720954406ceb (diff) |
[analyzer] Push "references are non-null" knowledge up to the common parent.
This reduces duplication across the Basic and Range constraint managers, and
keeps their internals free of dealing with the semantics of C++. It's still
a little unfortunate that the constraint manager is dealing with this at all,
but this is pretty much the only place to put it so that it will apply to all
symbolic values, even when embedded in larger expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162313 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/RangeConstraintManager.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/RangeConstraintManager.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp b/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp index 2b883cf9b9..550404a510 100644 --- a/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp +++ b/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp @@ -380,17 +380,7 @@ RangeConstraintManager::GetRange(ProgramStateRef state, SymbolRef sym) { // given symbol type. BasicValueFactory &BV = getBasicVals(); QualType T = sym->getType(BV.getContext()); - - RangeSet Result(F, BV.getMinValue(T), BV.getMaxValue(T)); - - // Special case: references are known to be non-zero. - if (T->isReferenceType()) { - APSIntType IntType = BV.getAPSIntType(T); - Result = Result.Intersect(BV, F, ++IntType.getZeroValue(), - --IntType.getZeroValue()); - } - - return Result; + return RangeSet(F, BV.getMinValue(T), BV.getMaxValue(T)); } //===------------------------------------------------------------------------=== |