retain/release checker: Improve diagnostics to indicate that CF objects are not automatically garbage collected.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63187 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index bd5e3b4..625eda4 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -2356,8 +2356,15 @@
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).";