summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-01-28 06:25:48 +0000
committerTed Kremenek <kremenek@apple.com>2009-01-28 06:25:48 +0000
commit4daeccf28fffbc73667669e04529840bf50247d0 (patch)
tree42a059cbea606ef75ce56c6d6c9b0121b6bb81d0 /clang/lib
parentf0ec316a04d358c5dd1023a30b1e65f68d15c5ce (diff)
downloadbcm5719-llvm-4daeccf28fffbc73667669e04529840bf50247d0.tar.gz
bcm5719-llvm-4daeccf28fffbc73667669e04529840bf50247d0.zip
retain/release checker: Improve diagnostics to indicate that CF objects are not automatically garbage collected.
llvm-svn: 63187
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index bd5e3b4d537..625eda4fb19 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -2356,8 +2356,15 @@ PathDiagnosticPiece* CFRefReport::VisitNode(const ExplodedNode<GRState>* N,
os << " returns an Objective-C object with a ";
}
- if (CurrV.isOwned())
- os << "+1 retain count (owning reference).";
+ if (CurrV.isOwned()) {
+ os << "+1 retain count (owning reference).";
+
+ if (static_cast<CFRefBug&>(getBugType()).getTF().isGCEnabled()) {
+ assert(CurrV.getObjKind() == RetEffect::CF);
+ os << " "
+ "Core Foundation objects are not automatically garbage collected.";
+ }
+ }
else {
assert (CurrV.isNotOwned());
os << "+0 retain count (non-owning reference).";
OpenPOWER on IntegriCloud