[cfe-commits] r152676 - in /cfe/trunk: lib/StaticAnalyzer/Core/PathDiagnostic.cpp test/Analysis/inline-plist.c test/Analysis/inline-unique-reports.c test/Analysis/malloc-plist.c

Anna Zaks ganna at apple.com
Tue Mar 13 15:15:55 PDT 2012


Author: zaks
Date: Tue Mar 13 17:15:55 2012
New Revision: 152676

URL: http://llvm.org/viewvc/llvm-project?rev=152676&view=rev
Log:
[analyzer] Call enter/exit diagnostic should refer to caller/callee,
respectively.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
    cfe/trunk/test/Analysis/inline-plist.c
    cfe/trunk/test/Analysis/inline-unique-reports.c
    cfe/trunk/test/Analysis/malloc-plist.c

Modified: cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp?rev=152676&r1=152675&r2=152676&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp Tue Mar 13 17:15:55 2012
@@ -549,14 +549,12 @@
 
 IntrusiveRefCntPtr<PathDiagnosticEventPiece>
 PathDiagnosticCallPiece::getCallEnterWithinCallerEvent() const {
-  if (!Callee)
-    return 0;
   SmallString<256> buf;
   llvm::raw_svector_ostream Out(buf);
-  if (isa<BlockDecl>(Callee))
-    Out << "Entered call to block";
-  else if (const NamedDecl *ND = dyn_cast<NamedDecl>(Callee))
-    Out << "Entered call to '" << *ND << "'";
+  if (const NamedDecl *ND = dyn_cast_or_null<NamedDecl>(Caller))
+    Out << "Entered call from '" << *ND << "'";
+  else
+    Out << "Entered call";
   StringRef msg = Out.str();
   if (msg.empty())
     return 0;
@@ -569,8 +567,8 @@
     return 0;
   SmallString<256> buf;
   llvm::raw_svector_ostream Out(buf);
-  if (const NamedDecl *ND = dyn_cast_or_null<NamedDecl>(Caller))
-    Out << "Returning to '" << *ND << "'";
+  if (const NamedDecl *ND = dyn_cast_or_null<NamedDecl>(Callee))
+    Out << "Returning from '" << *ND << "'";
   else
     Out << "Returning to caller";
   return new PathDiagnosticEventPiece(callReturn, Out.str());

Modified: cfe/trunk/test/Analysis/inline-plist.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inline-plist.c?rev=152676&r1=152675&r2=152676&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inline-plist.c (original)
+++ cfe/trunk/test/Analysis/inline-plist.c Tue Mar 13 17:15:55 2012
@@ -281,9 +281,9 @@
 // CHECK:      </dict>
 // CHECK:      <key>depth</key><integer>1</integer>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Entered call to 'has_bug'</string>
+// CHECK:      <string>Entered call
 // CHECK:      <key>message</key>
-// CHECK: <string>Entered call to 'has_bug'</string>
+// CHECK: <string>Entered call
 // CHECK:     </dict>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>

Modified: cfe/trunk/test/Analysis/inline-unique-reports.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inline-unique-reports.c?rev=152676&r1=152675&r2=152676&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inline-unique-reports.c (original)
+++ cfe/trunk/test/Analysis/inline-unique-reports.c Tue Mar 13 17:15:55 2012
@@ -97,9 +97,9 @@
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Entered call to 'bug'</string>
+// CHECK:      <string>Entered call
 // CHECK:      <key>message</key>
-// CHECK: <string>Entered call to 'bug'</string>
+// CHECK: <string>Entered call
 // CHECK:     </dict>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>

Modified: cfe/trunk/test/Analysis/malloc-plist.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/malloc-plist.c?rev=152676&r1=152675&r2=152676&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/malloc-plist.c (original)
+++ cfe/trunk/test/Analysis/malloc-plist.c Tue Mar 13 17:15:55 2012
@@ -821,9 +821,9 @@
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Entered call to 'wrapper'</string>
+// CHECK:      <string>Entered call from 'test_wrapper'</string>
 // CHECK:      <key>message</key>
-// CHECK: <string>Entered call to 'wrapper'</string>
+// CHECK: <string>Entered call from 'test_wrapper'</string>
 // CHECK:     </dict>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>
@@ -1075,9 +1075,9 @@
 // CHECK:        </array>
 // CHECK:      </array>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Returning to 'test_wrapper'</string>
+// CHECK:      <string>Returning from 'wrapper'</string>
 // CHECK:      <key>message</key>
-// CHECK: <string>Returning to 'test_wrapper'</string>
+// CHECK: <string>Returning from 'wrapper'</string>
 // CHECK:     </dict>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>





More information about the cfe-commits mailing list