[analyzer] Mark symbol values as dead in the environment.
authorJordan Rose <jordan_rose@apple.com>
Thu, 15 Nov 2012 19:11:27 +0000 (19:11 +0000)
committerJordan Rose <jordan_rose@apple.com>
Thu, 15 Nov 2012 19:11:27 +0000 (19:11 +0000)
commitb5b0fc196e8768076c3c9155cd79b248623861de
treef712d0d90710a553f0463760c530052266204c51
parent38990beed80119f7ee5f7da6a69efa6207f886ab
[analyzer] Mark symbol values as dead in the environment.

This allows us to properly remove dead bindings at the end of the top-level
stack frame, using the ReturnStmt, if there is one, to keep the return value
live. This in turn removes the need for a check::EndPath callback in leak
checkers.

This does cause some changes in the path notes for leak checkers. Previously,
a leak would be reported at the location of the closing brace in a function.
Now, it gets reported at the last statement. This matches the way leaks are
currently reported for inlined functions, but is less than ideal for both.

llvm-svn: 168066
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
clang/lib/StaticAnalyzer/Core/Environment.cpp
clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
clang/test/Analysis/malloc-plist.c
clang/test/Analysis/malloc.c
clang/test/Analysis/plist-output-alternate.m