diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-03-06 01:25:01 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-03-06 01:25:01 +0000 |
commit | 04e860df2c0314adee9c7084d72556c7f26e6dd3 (patch) | |
tree | 04281a80755e9211e92b1286be47f69304ef5f35 /clang/lib/StaticAnalyzer/Core/BugReporter.cpp | |
parent | e781266905a6176c59dea7c55893871b50a8a647 (diff) | |
download | bcm5719-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.cpp | 8 |
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 |