diff options
author | Anna Zaks <ganna@apple.com> | 2012-03-13 22:15:55 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-03-13 22:15:55 +0000 |
commit | fc544e3d52c43746b1b273f38ec7d65461f0064a (patch) | |
tree | f6de71569287334abe7c8deef4b02bc0de9e92a9 | |
parent | 3054f097f813d19090bdb23645dcd48df71d1a89 (diff) |
[analyzer] Call enter/exit diagnostic should refer to caller/callee,
respectively.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152676 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/StaticAnalyzer/Core/PathDiagnostic.cpp | 14 | ||||
-rw-r--r-- | test/Analysis/inline-plist.c | 4 | ||||
-rw-r--r-- | test/Analysis/inline-unique-reports.c | 4 | ||||
-rw-r--r-- | test/Analysis/malloc-plist.c | 8 |
4 files changed, 14 insertions, 16 deletions
diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp index 01b40b43ba..d09bb3280b 100644 --- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp +++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp @@ -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()); diff --git a/test/Analysis/inline-plist.c b/test/Analysis/inline-plist.c index 08b2aedc67..15b2070f23 100644 --- a/test/Analysis/inline-plist.c +++ b/test/Analysis/inline-plist.c @@ -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 '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> diff --git a/test/Analysis/inline-unique-reports.c b/test/Analysis/inline-unique-reports.c index 83df2d84de..b4f032d74e 100644 --- a/test/Analysis/inline-unique-reports.c +++ b/test/Analysis/inline-unique-reports.c @@ -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 '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> diff --git a/test/Analysis/malloc-plist.c b/test/Analysis/malloc-plist.c index 9d71d714fb..154d756040 100644 --- a/test/Analysis/malloc-plist.c +++ b/test/Analysis/malloc-plist.c @@ -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 '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 @@ void test_wrapper() { // 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> |