From: Ted Kremenek Date: Thu, 26 Feb 2009 21:04:07 +0000 (+0000) Subject: Refine some grammar in the retain/release diagnostics. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e198116646fcfe6b7e8f3665f3365a648141d6bd;p=clang Refine some grammar in the retain/release diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65571 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index dbfe418da7..8f694fa946 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -2189,7 +2189,7 @@ namespace { : CFRefBug(tf, "use-after-release") {} const char* getDescription() const { - return "Reference-counted object is used after it is released."; + return "Reference-counted object is used after it is released"; } }; @@ -2199,8 +2199,8 @@ namespace { const char* getDescription() const { return "Incorrect decrement of the reference count of a " - "CoreFoundation object: " - "The object is not owned at this point by the caller."; + "Core Foundation object (" + "the object is not owned at this point by the caller)"; } }; @@ -2329,16 +2329,16 @@ void CFRefCount::RegisterChecks(BugReporter& BR) { } static const char* Msgs[] = { - "Code is compiled in garbage collection only mode" // GC only - " (the bug occurs with garbage collection enabled).", - - "Code is compiled without garbage collection.", // No GC. - - "Code is compiled for use with and without garbage collection (GC)." - " The bug occurs with GC enabled.", // Hybrid, with GC. - - "Code is compiled for use with and without garbage collection (GC)." - " The bug occurs in non-GC mode." // Hyrbird, without GC/ + // GC only + "Code is compiled to only use garbage collection", + // No GC. + "Code is compiled to not use reference counts and not garbage collection", + // Hybrid, with GC. + "Code is compiled to use either garbage collection (GC) or reference counts" + " (non-GC). The bug occurs with GC enabled", + // Hybrid, without GC + "Code is compiled to use either garbage collection (GC) or reference counts" + " (non-GC). The bug occurs in non-GC mode" }; std::pair CFRefReport::getExtraDescriptiveText() { @@ -2537,14 +2537,8 @@ PathDiagnosticPiece* CFRefReport::VisitNode(const ExplodedNode* N, else os << "Reference count incremented."; - if (unsigned Count = CurrV.getCount()) { - os << " The object now has +" << Count; - - if (Count > 1) - os << " retain counts."; - else - os << " retain count."; - } + if (unsigned Count = CurrV.getCount()) + os << " The object now has a +" << Count << " retain count."; if (PrevV.getKind() == RefVal::Released) { assert(TF.isGCEnabled() && CurrV.getCount() > 0);