From 81125c449708be9fa520ee6e823dd29f9023e930 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Tue, 21 Aug 2012 20:52:19 +0000 Subject: [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. llvm-svn: 162313 --- clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp') diff --git a/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp b/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp index 2b883cf9b9b..550404a5107 100644 --- a/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp +++ b/clang/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)); } //===------------------------------------------------------------------------=== -- cgit v1.2.3