summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-05-05 00:46:09 +0000
committerTed Kremenek <kremenek@apple.com>2009-05-05 00:46:09 +0000
commit94c464ef2273e6a050e874ce154347acd6e420c3 (patch)
tree8685e06a8226dd70071e507463038617840bd118 /clang/lib/Analysis/CFRefCount.cpp
parent3f86b9cb069136c17baa65f63b285b3df4f5f228 (diff)
downloadbcm5719-llvm-94c464ef2273e6a050e874ce154347acd6e420c3.tar.gz
bcm5719-llvm-94c464ef2273e6a050e874ce154347acd6e420c3.zip
Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').
llvm-svn: 70952
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index 976bfad188d..07dbf10c408 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -1128,6 +1128,9 @@ RetainSummaryManager::updateSummaryFromAnnotations(RetainSummary &Summ,
? RetEffect::MakeGCNotOwned()
: RetEffect::MakeOwned(RetEffect::ObjC, true));
}
+ else if (FD->getAttr<CFOwnershipReturnsAttr>()) {
+ Summ.setRetEffect(RetEffect::MakeOwned(RetEffect::CF, true));
+ }
}
// Determine if there are any arguments with a specific ArgEffect.
@@ -1150,6 +1153,9 @@ RetainSummaryManager::updateSummaryFromAnnotations(RetainSummary &Summ,
? RetEffect::MakeGCNotOwned()
: RetEffect::MakeOwned(RetEffect::ObjC, true));
}
+ else if (MD->getAttr<CFOwnershipReturnsAttr>()) {
+ Summ.setRetEffect(RetEffect::MakeOwned(RetEffect::CF, true));
+ }
}
// Determine if there are any arguments with a specific ArgEffect.
OpenPOWER on IntegriCloud