aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-03-16 23:44:28 +0000
committerAnna Zaks <ganna@apple.com>2012-03-16 23:44:28 +0000
commitfbd58743fa6c793b84ed60a0e2325335a53da6c4 (patch)
tree3edd620f9bd3cf2775d99f9dd187a11beb22afa2 /lib/StaticAnalyzer/Core/PathDiagnostic.cpp
parent2eb272931070b4294eb623611ed892ba3d828284 (diff)
[analyzer] Shorten the stack hint diagnostic.
Do not display the standard "Returning from 'foo'", when a stack hint is available. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152964 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/PathDiagnostic.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/PathDiagnostic.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
index 2a2b9c615e..989553e375 100644
--- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -568,12 +568,12 @@ PathDiagnosticCallPiece::getCallExitEvent() const {
return 0;
SmallString<256> buf;
llvm::raw_svector_ostream Out(buf);
- if (const NamedDecl *ND = dyn_cast_or_null<NamedDecl>(Callee))
+ if (!CallStackMessage.empty())
+ Out << CallStackMessage;
+ else if (const NamedDecl *ND = dyn_cast_or_null<NamedDecl>(Callee))
Out << "Returning from '" << *ND << "'";
else
Out << "Returning to caller";
- if (!CallStackMessage.empty())
- Out << CallStackMessage;
return new PathDiagnosticEventPiece(callReturn, Out.str());
}