]> granicus.if.org Git - clang/commit
[analyzer] Run remove dead bindings right before leaving a function.
authorAnna Zaks <ganna@apple.com>
Fri, 20 Apr 2012 21:59:08 +0000 (21:59 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 20 Apr 2012 21:59:08 +0000 (21:59 +0000)
commit0b3ade86a1c60cf0c7b56aa238aff458eb7f5974
tree870a9b3597eaabc3fd9a6a3c18b91b0f450b5a17
parent39b73411313b1204601755e8c4813853f30b9a33
[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.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155244 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/clang/Analysis/ProgramPoint.h
include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
include/clang/StaticAnalyzer/Core/CheckerManager.h
include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
lib/Analysis/ProgramPoint.cpp
lib/StaticAnalyzer/Core/BugReporter.cpp
lib/StaticAnalyzer/Core/CheckerManager.cpp
lib/StaticAnalyzer/Core/CoreEngine.cpp
lib/StaticAnalyzer/Core/ExplodedGraph.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
lib/StaticAnalyzer/Core/PathDiagnostic.cpp
lib/StaticAnalyzer/Core/SymbolManager.cpp
test/Analysis/malloc-plist.c