diff options
author | Anna Zaks <ganna@apple.com> | 2012-02-28 21:49:08 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-02-28 21:49:08 +0000 |
commit | 212000e24cf11da0badea90c23d4f300da34e607 (patch) | |
tree | c153694b451cdca35ac90d60f391ce278775ed15 | |
parent | c2994283aa7538b7420c8e398cde7afa328d7042 (diff) |
[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
-rw-r--r-- | lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 5 | ||||
-rw-r--r-- | test/Analysis/plist-output-alternate.m | 2 | ||||
-rw-r--r-- | test/Analysis/retain-release-gc-only.m | 2 | ||||
-rw-r--r-- | 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: <string>Object leaked: object allocated and stored into 'value' is not referenced later in this execution path and has a retain count of +1</string> // CHECK: </dict> // CHECK: </array> -// CHECK: <key>description</key><string>Potential leak of an object allocated on line 53 and stored into 'value'</string> +// CHECK: <key>description</key><string>Potential leak of an object stored into 'value'</string> // CHECK: <key>category</key><string>Memory (Core Foundation/Objective-C)</string> // CHECK: <key>type</key><string>Leak</string> // CHECK: <key>location</key> 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)) { } |