]> granicus.if.org Git - clang/commitdiff
Make CF retain diagnostics more succinct.
authorTed Kremenek <kremenek@apple.com>
Mon, 5 May 2008 23:16:31 +0000 (23:16 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 5 May 2008 23:16:31 +0000 (23:16 +0000)
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

lib/Analysis/CFRefCount.cpp

index ed8c595745af5aa6d99db309231bb33618729fd2..83e796371444fec7ff267d3afb9bc07ac64d110c 100644 (file)
@@ -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 {