aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/StaticAnalyzer/Core/BugReporterVisitors.cpp16
-rw-r--r--lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/PathDiagnostic.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/PlistDiagnostics.cpp4
4 files changed, 14 insertions, 10 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index c0804e7340..3ea08cde00 100644
--- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -758,6 +758,10 @@ CallEnterExitBRVisitor::VisitNode(const ExplodedNode *N,
Out << "Entering call to block";
else if (const NamedDecl *ND = dyn_cast<NamedDecl>(callee))
Out << "Entering call to '" << ND->getNameAsString() << "'";
+ StringRef msg = Out.str();
+ if (msg.empty())
+ return 0;
+ return new PathDiagnosticCallEnterPiece(pos, msg);
}
else if (const CallExit *CExit = dyn_cast<CallExit>(&PP)) {
const Decl *caller = CExit->getLocationContext()->getParent()->getDecl();
@@ -765,15 +769,9 @@ CallEnterExitBRVisitor::VisitNode(const ExplodedNode *N,
if (const NamedDecl *ND = dyn_cast<NamedDecl>(caller))
Out << "Returning to '" << ND->getNameAsString() << "'";
else
- Out << "Returning to caller";
+ Out << "Returning to caller";
+ return new PathDiagnosticCallExitPiece(pos, Out.str());
}
-
- if (!pos.isValid())
- return 0;
-
- StringRef msg = Out.str();
- if (msg.empty())
- return 0;
- return new PathDiagnosticEventPiece(pos, msg);
+ return 0;
}
diff --git a/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp b/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
index 933e15c0de..2b3dcdc5c8 100644
--- a/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ b/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -334,6 +334,8 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID,
const char *Kind = 0;
switch (P.getKind()) {
+ case PathDiagnosticPiece::CallEnter:
+ case PathDiagnosticPiece::CallExit:
case PathDiagnosticPiece::Event: Kind = "Event"; break;
case PathDiagnosticPiece::ControlFlow: Kind = "Control"; break;
// Setting Kind to "Control" is intentional.
diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
index c0bb180c82..0d2c2e82d9 100644
--- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -52,6 +52,8 @@ PathDiagnosticPiece::PathDiagnosticPiece(Kind k, DisplayHint hint)
PathDiagnosticPiece::~PathDiagnosticPiece() {}
PathDiagnosticEventPiece::~PathDiagnosticEventPiece() {}
+PathDiagnosticCallEnterPiece::~PathDiagnosticCallEnterPiece() {}
+PathDiagnosticCallExitPiece::~PathDiagnosticCallExitPiece() {}
PathDiagnosticControlFlowPiece::~PathDiagnosticControlFlowPiece() {}
PathDiagnosticMacroPiece::~PathDiagnosticMacroPiece() {
diff --git a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
index cc8c315c4e..89b44c1ca0 100644
--- a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
+++ b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
@@ -275,8 +275,10 @@ static void ReportDiag(raw_ostream &o, const PathDiagnosticPiece& P,
ReportControlFlow(o, cast<PathDiagnosticControlFlowPiece>(P), FM, SM,
LangOpts, indent);
break;
+ case PathDiagnosticPiece::CallEnter:
+ case PathDiagnosticPiece::CallExit:
case PathDiagnosticPiece::Event:
- ReportEvent(o, cast<PathDiagnosticEventPiece>(P), FM, SM, LangOpts,
+ ReportEvent(o, cast<PathDiagnosticSpotPiece>(P), FM, SM, LangOpts,
indent);
break;
case PathDiagnosticPiece::Macro: