From 212000e24cf11da0badea90c23d4f300da34e607 Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Tue, 28 Feb 2012 21:49:08 +0000 Subject: [PATCH] [analyzer] Retain release: drop the line number info from the leak message. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151657 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 5 ++--- test/Analysis/plist-output-alternate.m | 2 +- test/Analysis/retain-release-gc-only.m | 2 +- test/Analysis/retain-release.m | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index 3ae76e0203..2350298b63 100644 --- a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -2257,15 +2257,14 @@ CFRefLeakReport::CFRefLeakReport(CFRefBug &D, const LangOptions &LOpts, // Fill in the description of the bug. Description.clear(); llvm::raw_string_ostream os(Description); - unsigned AllocLine = SMgr.getExpansionLineNumber(AllocStmt->getLocStart()); os << "Potential leak "; if (GCEnabled) os << "(when using garbage collection) "; - os << "of an object allocated on line " << AllocLine; + os << "of an object"; // FIXME: AllocBinding doesn't get populated for RegionStore yet. if (AllocBinding) - os << " and stored into '" << AllocBinding->getString() << '\''; + os << " stored into '" << AllocBinding->getString() << '\''; addVisitor(new CFRefLeakReportVisitor(sym, GCEnabled, Log)); } diff --git a/test/Analysis/plist-output-alternate.m b/test/Analysis/plist-output-alternate.m index 23a260a129..d619a7aa38 100644 --- a/test/Analysis/plist-output-alternate.m +++ b/test/Analysis/plist-output-alternate.m @@ -990,7 +990,7 @@ void rdar8331641(int x) { // CHECK: Object leaked: object allocated and stored into 'value' is not referenced later in this execution path and has a retain count of +1 // CHECK: // CHECK: -// CHECK: descriptionPotential leak of an object allocated on line 53 and stored into 'value' +// CHECK: descriptionPotential leak of an object stored into 'value' // CHECK: categoryMemory (Core Foundation/Objective-C) // CHECK: typeLeak // CHECK: location diff --git a/test/Analysis/retain-release-gc-only.m b/test/Analysis/retain-release-gc-only.m index 4e1b8466c3..b12e1e04b9 100644 --- a/test/Analysis/retain-release-gc-only.m +++ b/test/Analysis/retain-release-gc-only.m @@ -279,7 +279,7 @@ void f5b() { @implementation TestReturnNotOwnedWhenExpectedOwned - (NSString*)newString { - NSString *s = [NSString stringWithUTF8String:"hello"]; // expected-warning{{Potential leak (when using garbage collection) of an object allocated}} + NSString *s = [NSString stringWithUTF8String:"hello"]; // expected-warning{{Potential leak (when using garbage collection) of an object}} CFRetain(s); return s; } diff --git a/test/Analysis/retain-release.m b/test/Analysis/retain-release.m index bb32635b4b..1ca4876d5f 100644 --- a/test/Analysis/retain-release.m +++ b/test/Analysis/retain-release.m @@ -1468,7 +1468,7 @@ static void rdar_8724287(CFErrorRef error) while (error_to_dump != ((void*)0)) { CFDictionaryRef info; - info = CFErrorCopyUserInfo(error_to_dump); // expected-warning{{Potential leak of an object allocated on line}} + info = CFErrorCopyUserInfo(error_to_dump); // expected-warning{{Potential leak of an object}} if (info != ((void*)0)) { } -- 2.50.1