]> granicus.if.org Git - clang/commitdiff
[analyzer] Retain release: drop the line number info from the leak
authorAnna Zaks <ganna@apple.com>
Tue, 28 Feb 2012 21:49:08 +0000 (21:49 +0000)
committerAnna Zaks <ganna@apple.com>
Tue, 28 Feb 2012 21:49:08 +0000 (21:49 +0000)
message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151657 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
test/Analysis/plist-output-alternate.m
test/Analysis/retain-release-gc-only.m
test/Analysis/retain-release.m

index 3ae76e02030f74bbc3fef48a54ce9beed0d07eda..2350298b638da4db8884d92ad1d62942e5fe079d 100644 (file)
@@ -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));
 }
index 23a260a129c7affd8effd8470f251f6f7222095a..d619a7aa3894cf1565d44a767f17970e4b71d312 100644 (file)
@@ -990,7 +990,7 @@ void rdar8331641(int x) {
 // CHECK: <string>Object leaked: object allocated and stored into &apos;value&apos; 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 &apos;value&apos;</string>
+// CHECK:    <key>description</key><string>Potential leak of an object stored into &apos;value&apos;</string>
 // CHECK:    <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
 // CHECK:    <key>type</key><string>Leak</string>
 // CHECK:   <key>location</key>
index 4e1b8466c322b2fe8bd07512b4ddd4fe0168f9aa..b12e1e04b9a1c5fdce3b3307ba2113e96e6bced8 100644 (file)
@@ -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;
 }
index bb32635b4b8b13ab62155b181d24f76454ed4956..1ca4876d5ff79694bc26c775d6b2f0669af46dcf 100644 (file)
@@ -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)) {
         }