summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2017-11-25 14:57:42 +0000
committerDevin Coughlin <dcoughlin@apple.com>2017-11-25 14:57:42 +0000
commitcc5915a5e15d098952605556b2b7a75632fb41e3 (patch)
treef05a5ff589a30db450500626fc9f27b41201ad0b /clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
parent67e60434c30e9a53cf8c994a4c97a689732cfc8f (diff)
downloadbcm5719-llvm-cc5915a5e15d098952605556b2b7a75632fb41e3.tar.gz
bcm5719-llvm-cc5915a5e15d098952605556b2b7a75632fb41e3.zip
[analyzer] Teach RetainCountChecker about CoreMedia APIs
Teach the retain-count checker that CoreMedia reference types use CoreFoundation-style reference counting. This enables the checker to catch leaks and over releases of those types. rdar://problem/33599757 llvm-svn: 318979
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
index 4db83af17f3..e47494a3e90 100644
--- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
@@ -1201,10 +1201,10 @@ RetainSummaryManager::getFunctionSummary(const FunctionDecl *FD) {
break;
}
- // For the Disk Arbitration API (DiskArbitration/DADisk.h)
- if (cocoa::isRefType(RetTy, "DADisk") ||
- cocoa::isRefType(RetTy, "DADissenter") ||
- cocoa::isRefType(RetTy, "DASessionRef")) {
+ // For all other CF-style types, use the Create/Get
+ // rule for summaries but don't support Retain functions
+ // with framework-specific prefixes.
+ if (coreFoundation::isCFObjectRef(RetTy)) {
S = getCFCreateGetRuleSummary(FD);
break;
}
OpenPOWER on IntegriCloud