summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-03-06 01:25:01 +0000
committerTed Kremenek <kremenek@apple.com>2012-03-06 01:25:01 +0000
commit04e860df2c0314adee9c7084d72556c7f26e6dd3 (patch)
tree04281a80755e9211e92b1286be47f69304ef5f35 /clang/lib/StaticAnalyzer/Core/BugReporter.cpp
parente781266905a6176c59dea7c55893871b50a8a647 (diff)
downloadbcm5719-llvm-04e860df2c0314adee9c7084d72556c7f26e6dd3.tar.gz
bcm5719-llvm-04e860df2c0314adee9c7084d72556c7f26e6dd3.zip
[analyzer] add a diagnostic event when entering a call via inlining, within the callee, and add an edge.
llvm-svn: 152086
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
index 73e00e44167..53fedaf2a12 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -1233,10 +1233,18 @@ static void GenerateExtensivePathDiagnostic(PathDiagnostic& PD,
// Pop the call hierarchy if we are done walking the contents
// of a function call.
if (const CallEnter *CE = dyn_cast<CallEnter>(&P)) {
+ // Add an edge to the start of the function.
+ const Decl *D = CE->getCalleeContext()->getDecl();
+ PathDiagnosticLocation pos =
+ PathDiagnosticLocation::createBegin(D, SM);
+ EB.addEdge(pos);
+
+ // Flush all locations, and pop the active path.
EB.flushLocations();
PD.popActivePath();
assert(!PD.getActivePath().empty());
PDB.LC = N->getLocationContext();
+
// The current active path should never be empty. Either we
// just added a bunch of stuff to the top-level path, or
// we have a previous CallExit. If the front of the active
OpenPOWER on IntegriCloud