[analyzer] Run remove dead bindings right before leaving a function.
This is needed to ensure that we always report issues in the correct function. For example, leaks are identified when we call remove dead bindings. In order to make sure we report a callee's leak in the callee, we have to run the operation in the callee's context. This change required quite a bit of infrastructure work since: - We used to only run remove dead bindings before a given statement; here we need to run it after the last statement in the function. For this, we added additional Program Point and special mode in the SymbolReaper to remove all symbols in context lower than the current one. - The call exit operation turned into a sequence of nodes, which are now guarded by CallExitBegin and CallExitEnd nodes for clarity and convenience. (Sorry for the long diff.) llvm-svn: 155244
This commit is contained in:
@@ -57,7 +57,7 @@ ExplodedGraph::~ExplodedGraph() {}
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
bool ExplodedGraph::shouldCollect(const ExplodedNode *node) {
|
||||
// Reclaimn all nodes that match *all* the following criteria:
|
||||
// Reclaim all nodes that match *all* the following criteria:
|
||||
//
|
||||
// (1) 1 predecessor (that has one successor)
|
||||
// (2) 1 successor (that has one predecessor)
|
||||
@@ -83,7 +83,8 @@ bool ExplodedGraph::shouldCollect(const ExplodedNode *node) {
|
||||
// Condition 3.
|
||||
ProgramPoint progPoint = node->getLocation();
|
||||
if (!isa<PostStmt>(progPoint) ||
|
||||
(isa<CallEnter>(progPoint) || isa<CallExit>(progPoint)))
|
||||
(isa<CallEnter>(progPoint) ||
|
||||
isa<CallExitBegin>(progPoint) || isa<CallExitEnd>(progPoint)))
|
||||
return false;
|
||||
|
||||
// Condition 4.
|
||||
|
||||
Reference in New Issue
Block a user