From: Ted Kremenek Date: Mon, 5 May 2008 23:16:31 +0000 (+0000) Subject: Make CF retain diagnostics more succinct. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=789deacdadc452c92f3fc608917c7c161798b5f1;p=clang Make CF retain diagnostics more succinct. In a leak's "name", indicate GC or non-GC bugs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50680 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index ed8c595745..83e7963714 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -1509,7 +1509,8 @@ namespace { CFRefBug(CFRefCount& tf) : TF(tf) {} CFRefCount& getTF() { return TF; } - + const CFRefCount& getTF() const { return TF; } + virtual bool isLeak() const { return false; } }; @@ -1518,7 +1519,7 @@ namespace { UseAfterRelease(CFRefCount& tf) : CFRefBug(tf) {} virtual const char* getName() const { - return "Core Foundation: Use-After-Release"; + return "Use-After-Release"; } virtual const char* getDescription() const { return "Reference-counted object is used" @@ -1533,7 +1534,7 @@ namespace { BadRelease(CFRefCount& tf) : CFRefBug(tf) {} virtual const char* getName() const { - return "Core Foundation: Release of non-owned object"; + return "Bad Release"; } virtual const char* getDescription() const { return "Incorrect decrement of the reference count of a " @@ -1549,7 +1550,7 @@ namespace { Leak(CFRefCount& tf) : CFRefBug(tf) {} virtual const char* getName() const { - return "Core Foundation: Memory Leak"; + return getTF().isGCEnabled() ? "Memory Leak (GC)" : "Memory Leak"; } virtual const char* getDescription() const {