r194244 - StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp: Tweak ContainerNonEmptyMap with "int" instead of "bool", to appease building since r194235.

NAKAMURA Takumi geek4civic at gmail.com
Thu Nov 7 20:00:53 PST 2013


Author: chapuni
Date: Thu Nov  7 22:00:53 2013
New Revision: 194244

URL: http://llvm.org/viewvc/llvm-project?rev=194244&view=rev
Log:
StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp: Tweak ContainerNonEmptyMap with "int" instead of "bool", to appease building since r194235.

In ADT/ImmutableSet, ImutProfileInfo<bool> cannot be matched to ImutProfileInteger.
I didn't have idea it'd the right way if PROFILE_INTEGER_INFO(bool) could be added there.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp?rev=194244&r1=194243&r2=194244&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp Thu Nov  7 22:00:53 2013
@@ -790,7 +790,7 @@ void VariadicMethodTypeChecker::checkPre
 // 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
 
   const SymbolRef *CountS = State->get<ContainerCountMap>(CollectionS);
   if (!CountS) {
-    const bool *KnownNonEmpty = State->get<ContainerNonEmptyMap>(CollectionS);
+    const int *KnownNonEmpty = State->get<ContainerNonEmptyMap>(CollectionS);
     if (!KnownNonEmpty)
       return State->set<ContainerNonEmptyMap>(CollectionS, Assumption);
     return (Assumption == *KnownNonEmpty) ? State : NULL;
@@ -1036,7 +1036,7 @@ void ObjCLoopChecker::checkPostObjCMessa
     C.getSymbolManager().addSymbolDependency(ContainerS, CountS);
     State = State->set<ContainerCountMap>(ContainerS, CountS);
 
-    if (const bool *NonEmpty = State->get<ContainerNonEmptyMap>(ContainerS)) {
+    if (const int *NonEmpty = State->get<ContainerNonEmptyMap>(ContainerS)) {
       State = State->remove<ContainerNonEmptyMap>(ContainerS);
       State = assumeCollectionNonEmpty(C, State, ContainerS, *NonEmpty);
     }





More information about the cfe-commits mailing list