From 2baea2887dfcf023c8e3560e5d4713c42eed7b6b Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Fri, 8 Nov 2013 04:00:53 +0000 Subject: [PATCH] StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp: Tweak ContainerNonEmptyMap with "int" instead of "bool", to appease building since r194235. In ADT/ImmutableSet, ImutProfileInfo cannot be matched to ImutProfileInteger. I didn't have idea it'd the right way if PROFILE_INTEGER_INFO(bool) could be added there. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194244 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 f66f8b75ed..83851eb9ae 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, bool) +REGISTER_MAP_WITH_PROGRAMSTATE(ContainerNonEmptyMap, SymbolRef, int) namespace { class ObjCLoopChecker @@ -906,7 +906,7 @@ assumeCollectionNonEmpty(CheckerContext &C, ProgramStateRef State, const SymbolRef *CountS = State->get(CollectionS); if (!CountS) { - const bool *KnownNonEmpty = State->get(CollectionS); + const int *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 bool *NonEmpty = State->get(ContainerS)) { + if (const int *NonEmpty = State->get(ContainerS)) { State = State->remove(ContainerS); State = assumeCollectionNonEmpty(C, State, ContainerS, *NonEmpty); } -- 2.40.0