summaryrefslogtreecommitdiffstats
path: root/clang/lib
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/lib
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/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp14
1 files changed, 6 insertions, 8 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());
OpenPOWER on IntegriCloud