summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-03-13 22:15:55 +0000
committerAnna Zaks <ganna@apple.com>2012-03-13 22:15:55 +0000
commit6e5b48a6b4844b6ce62d4e7acca0469136f61693 (patch)
treee4316790deeab9422e278de729c82a9573253296 /clang
parent7bf83096dfb783ec80227009f5226e69b2071d20 (diff)
downloadbcm5719-llvm-6e5b48a6b4844b6ce62d4e7acca0469136f61693.tar.gz
bcm5719-llvm-6e5b48a6b4844b6ce62d4e7acca0469136f61693.zip
[analyzer] Call enter/exit diagnostic should refer to caller/callee,
respectively. llvm-svn: 152676
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp14
-rw-r--r--clang/test/Analysis/inline-plist.c4
-rw-r--r--clang/test/Analysis/inline-unique-reports.c4
-rw-r--r--clang/test/Analysis/malloc-plist.c8
4 files changed, 14 insertions, 16 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
index 01b40b43baf..d09bb3280bb 100644
--- a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ b/clang/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/clang/test/Analysis/inline-plist.c b/clang/test/Analysis/inline-plist.c
index 08b2aedc670..15b2070f239 100644
--- a/clang/test/Analysis/inline-plist.c
+++ b/clang/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 &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>
diff --git a/clang/test/Analysis/inline-unique-reports.c b/clang/test/Analysis/inline-unique-reports.c
index 83df2d84de0..b4f032d74e5 100644
--- a/clang/test/Analysis/inline-unique-reports.c
+++ b/clang/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 &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>
diff --git a/clang/test/Analysis/malloc-plist.c b/clang/test/Analysis/malloc-plist.c
index 9d71d714fb0..154d7560401 100644
--- a/clang/test/Analysis/malloc-plist.c
+++ b/clang/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 &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>
OpenPOWER on IntegriCloud