]> granicus.if.org Git - clang/commitdiff
[analyzer] Call enter/exit diagnostic should refer to caller/callee,
authorAnna Zaks <ganna@apple.com>
Tue, 13 Mar 2012 22:15:55 +0000 (22:15 +0000)
committerAnna Zaks <ganna@apple.com>
Tue, 13 Mar 2012 22:15:55 +0000 (22:15 +0000)
respectively.

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

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

index 01b40b43baf4141c4e2efbc7e9eb0c0eaddffa04..d09bb3280bbc71c6bbd1ff32ebe39277e6a8b031 100644 (file)
@@ -549,14 +549,12 @@ PathDiagnosticCallPiece::getCallEnterEvent() const {
 
 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 @@ PathDiagnosticCallPiece::getCallExitEvent() const {
     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());
index 08b2aedc6703e8f08984b5c7421e10215eeff62b..15b2070f239086fb887f0677ad5c63a6a1e338a5 100644 (file)
@@ -281,9 +281,9 @@ void test_has_bug() {
 // CHECK:      </dict>
 // CHECK:      <key>depth</key><integer>1</integer>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Entered call to &apos;has_bug&apos;</string>
+// CHECK:      <string>Entered call
 // CHECK:      <key>message</key>
-// CHECK: <string>Entered call to &apos;has_bug&apos;</string>
+// CHECK: <string>Entered call
 // CHECK:     </dict>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>
index 83df2d84de057d7acb036b9d20ea438fb056989b..b4f032d74e59b1fbd4901e643c202e2ade1d575e 100644 (file)
@@ -97,9 +97,9 @@ void test_bug_2() {
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Entered call to &apos;bug&apos;</string>
+// CHECK:      <string>Entered call
 // CHECK:      <key>message</key>
-// CHECK: <string>Entered call to &apos;bug&apos;</string>
+// CHECK: <string>Entered call
 // CHECK:     </dict>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>
index 9d71d714fb0ae041ddaefce316a1040037168299..154d75604015287f1fd117c54be47a3256394e8f 100644 (file)
@@ -821,9 +821,9 @@ void test_wrapper() {
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Entered call to &apos;wrapper&apos;</string>
+// CHECK:      <string>Entered call from &apos;test_wrapper&apos;</string>
 // CHECK:      <key>message</key>
-// CHECK: <string>Entered call to &apos;wrapper&apos;</string>
+// CHECK: <string>Entered call from &apos;test_wrapper&apos;</string>
 // CHECK:     </dict>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>
@@ -1075,9 +1075,9 @@ void test_wrapper() {
 // CHECK:        </array>
 // CHECK:      </array>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Returning to &apos;test_wrapper&apos;</string>
+// CHECK:      <string>Returning from &apos;wrapper&apos;</string>
 // CHECK:      <key>message</key>
-// CHECK: <string>Returning to &apos;test_wrapper&apos;</string>
+// CHECK: <string>Returning from &apos;wrapper&apos;</string>
 // CHECK:     </dict>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>