From 6b1a4c83fb661c612c4a872d6c85e7a1aecd044f Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Fri, 8 Nov 2013 17:23:33 +0000 Subject: [PATCH] Revert 'Tweak ContainerNonEmptyMap with "int" instead of "bool"'. I've added the missing ImutProfileInfo [sic] specialization for bool, so this patch on r194235 is no longer needed. This reverts r194244 / 2baea2887dfcf023c8e3560e5d4713c42eed7b6b. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194265 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp index 83851eb9ae..f66f8b75ed 100644 --- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp +++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp @@ -790,7 +790,7 @@ void VariadicMethodTypeChecker::checkPreObjCMessage(const ObjCMethodCall &msg, // The map from container symbol to the container count symbol. // We currently will remember the last countainer count symbol encountered. REGISTER_MAP_WITH_PROGRAMSTATE(ContainerCountMap, SymbolRef, SymbolRef) -REGISTER_MAP_WITH_PROGRAMSTATE(ContainerNonEmptyMap, SymbolRef, int) +REGISTER_MAP_WITH_PROGRAMSTATE(ContainerNonEmptyMap, SymbolRef, bool) namespace { class ObjCLoopChecker @@ -906,7 +906,7 @@ assumeCollectionNonEmpty(CheckerContext &C, ProgramStateRef State, const SymbolRef *CountS = State->get(CollectionS); if (!CountS) { - const int *KnownNonEmpty = State->get(CollectionS); + const bool *KnownNonEmpty = State->get(CollectionS); if (!KnownNonEmpty) return State->set(CollectionS, Assumption); return (Assumption == *KnownNonEmpty) ? State : NULL; @@ -1036,7 +1036,7 @@ void ObjCLoopChecker::checkPostObjCMessage(const ObjCMethodCall &M, C.getSymbolManager().addSymbolDependency(ContainerS, CountS); State = State->set(ContainerS, CountS); - if (const int *NonEmpty = State->get(ContainerS)) { + if (const bool *NonEmpty = State->get(ContainerS)) { State = State->remove(ContainerS); State = assumeCollectionNonEmpty(C, State, ContainerS, *NonEmpty); } -- 2.40.0