Author: zaks
Date: Tue Feb 28 15:49:08 2012
New Revision: 151657
URL: http://llvm.org/viewvc/llvm-project?rev=151657&view=rev
Log:
[analyzer] Retain release: drop the line number info from the leak
message.
Modified:
cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
cfe/trunk/test/Analysis/plist-output-alternate.m
cfe/trunk/test/Analysis/retain-release-gc-only.m
cfe/trunk/test/Analysis/retain-release.m
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=151657&r1=151656&r2=151657&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Tue Feb 28
15:49:08 2012
@@ -2257,15 +2257,14 @@
// 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));
}
Modified: cfe/trunk/test/Analysis/plist-output-alternate.m
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plist-output-alternate.m?rev=151657&r1=151656&r2=151657&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/plist-output-alternate.m (original)
+++ cfe/trunk/test/Analysis/plist-output-alternate.m Tue Feb 28 15:49:08 2012
@@ -990,7 +990,7 @@
// 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>
Modified: cfe/trunk/test/Analysis/retain-release-gc-only.m
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release-gc-only.m?rev=151657&r1=151656&r2=151657&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release-gc-only.m (original)
+++ cfe/trunk/test/Analysis/retain-release-gc-only.m Tue Feb 28 15:49:08 2012
@@ -279,7 +279,7 @@
@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;
}
Modified: cfe/trunk/test/Analysis/retain-release.m
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release.m?rev=151657&r1=151656&r2=151657&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release.m (original)
+++ cfe/trunk/test/Analysis/retain-release.m Tue Feb 28 15:49:08 2012
@@ -1468,7 +1468,7 @@
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)) {
}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits