Author: timshen Date: Tue Oct 3 12:39:02 2017 New Revision: 314831 URL: http://llvm.org/viewvc/llvm-project?rev=314831&view=rev Log: Revert r314820 "[Analyzer] More granular special casing in RetainCountChecker"
The test retain-release.m fails with this patch. Differential Revision: https://reviews.llvm.org/D38487 Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp cfe/trunk/test/Analysis/retain-release.mm Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=314831&r1=314830&r2=314831&view=diff ============================================================================== --- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp (original) +++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Tue Oct 3 12:39:02 2017 @@ -1062,7 +1062,6 @@ RetainSummaryManager::getFunctionSummary // Inspect the result type. QualType RetTy = FT->getReturnType(); - StringRef RetTyName = RetTy.getAsString(); // FIXME: This should all be refactored into a chain of "summary lookup" // filters. @@ -1082,14 +1081,12 @@ RetainSummaryManager::getFunctionSummary AllowAnnotations = false; } else if (FName == "CFPlugInInstanceCreate") { S = getPersistentSummary(RetEffect::MakeNoRet()); - } else if (FName == "IORegistryEntrySearchCFProperty" - || (RetTyName == "CFMutableDictionaryRef" && ( - FName == "IOBSDNameMatching" || + } else if (FName == "IOBSDNameMatching" || FName == "IOServiceMatching" || FName == "IOServiceNameMatching" || + FName == "IORegistryEntrySearchCFProperty" || FName == "IORegistryEntryIDMatching" || - FName == "IOOpenFirmwarePathMatching" - ))) { + FName == "IOOpenFirmwarePathMatching") { // Part of <rdar://problem/6961230>. (IOKit) // This should be addressed using a API table. S = getPersistentSummary(RetEffect::MakeOwned(RetEffect::CF), Modified: cfe/trunk/test/Analysis/retain-release.mm URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release.mm?rev=314831&r1=314830&r2=314831&view=diff ============================================================================== --- cfe/trunk/test/Analysis/retain-release.mm (original) +++ cfe/trunk/test/Analysis/retain-release.mm Tue Oct 3 12:39:02 2017 @@ -463,10 +463,3 @@ void radar13722286::PrepareBitmap() { // rdar://34210609 void _() { _(); }; // no-warning - -// Do not assume that IOBSDNameMatching increments a reference counter, -// unless return type is CFMutableDictionaryRef. -void* IOBSDNameMatching(); -void rdar33832412() { - void* x = IOBSDNameMatching(); // no-warning -} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits