summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-05-25 06:29:39 +0000
committerTed Kremenek <kremenek@apple.com>2011-05-25 06:29:39 +0000
commit86d49ce20c9652a1e5ecead504f1093d55fd9e8f (patch)
treeb14879320c0e145f992c97a9b9dbbe111f653120 /clang/lib/StaticAnalyzer/Core/CFRefCount.cpp
parent8e2c9b0180294afba4e7e070a7ae79527230785f (diff)
downloadbcm5719-llvm-86d49ce20c9652a1e5ecead504f1093d55fd9e8f.tar.gz
bcm5719-llvm-86d49ce20c9652a1e5ecead504f1093d55fd9e8f.zip
Teach analyzer about cf_returns_not_retained for C functions.
llvm-svn: 132049
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CFRefCount.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CFRefCount.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp b/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp
index 8478de59089..59fea1031ff 100644
--- a/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp
@@ -1236,6 +1236,9 @@ RetainSummaryManager::updateSummaryFromAnnotations(RetainSummary &Summ,
if (FD->getAttr<CFReturnsRetainedAttr>()) {
Summ.setRetEffect(RetEffect::MakeOwned(RetEffect::CF, true));
}
+ else if (FD->getAttr<CFReturnsNotRetainedAttr>()) {
+ Summ.setRetEffect(RetEffect::MakeNotOwned(RetEffect::CF));
+ }
}
}
OpenPOWER on IntegriCloud