summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-08-06 21:28:02 +0000
committerJordan Rose <jordan_rose@apple.com>2012-08-06 21:28:02 +0000
commit1c715609df9821dcc7021f4c1c544a118849f647 (patch)
tree5b3c4aa86ce0a26aa93524e3937e6bfe7ae9d8e0
parent84491abb201a2df0fadf7654e0912cb0d42a4874 (diff)
downloadbcm5719-llvm-1c715609df9821dcc7021f4c1c544a118849f647.tar.gz
bcm5719-llvm-1c715609df9821dcc7021f4c1c544a118849f647.zip
[analyzer] Ignore OS X 10.8's annotations for NSMakeCollectable.
The frameworks correctly use the 'cf_consumed' and 'ns_returns_retained' attributes for NSMakeCollectable, but we can model the behavior under garbage collection more precisely than that. No functionality change. llvm-svn: 161349
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
index 53656cf6a08..86e6cae826f 100644
--- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
@@ -981,6 +981,7 @@ RetainSummaryManager::getFunctionSummary(const FunctionDecl *FD) {
// No summary? Generate one.
const RetainSummary *S = 0;
+ bool AllowAnnotations = true;
do {
// We generate "stop" summaries for implicitly defined functions.
@@ -1018,6 +1019,9 @@ RetainSummaryManager::getFunctionSummary(const FunctionDecl *FD) {
S = (RetTy->isObjCIdType())
? getUnarySummary(FT, cfmakecollectable)
: getPersistentStopSummary();
+ // The headers on OS X 10.8 use cf_consumed/ns_returns_retained,
+ // but we can fully model NSMakeCollectable ourselves.
+ AllowAnnotations = false;
} else if (FName == "IOBSDNameMatching" ||
FName == "IOServiceMatching" ||
FName == "IOServiceNameMatching" ||
@@ -1178,7 +1182,8 @@ RetainSummaryManager::getFunctionSummary(const FunctionDecl *FD) {
S = getDefaultSummary();
// Annotations override defaults.
- updateSummaryFromAnnotations(S, FD);
+ if (AllowAnnotations)
+ updateSummaryFromAnnotations(S, FD);
FuncSummaries[FD] = S;
return S;
OpenPOWER on IntegriCloud