diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-02-07 02:27:37 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-02-07 02:27:37 +0000 |
commit | a6215b93c45ee5931536b57d10b987747143313b (patch) | |
tree | 74f9b83afecb317a4a60532f7e74b001020e2712 /lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | |
parent | 5de4fdb8de700f95b0b863a9e5a4a508de17a034 (diff) |
Create PathDiagnosticCallEnter and PathDiagnosticCallExit, to remark calls in PathDiagnostics from other events. This will
have potential uses later.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporterVisitors.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 16 |
1 files changed, 7 insertions, 9 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; } |