llvm-project/clang/lib/Analysis
Artem Dergachev dda42164ec [analyzer] Fix some expressions staying live too long. Add a debug checker.
StaticAnalyzer uses the CFG-based RelaxedLiveVariables analysis in order to,
in particular, figure out values of which expressions are still needed.
When the expression becomes "dead", it is garbage-collected during
the dead binding scan.

Expressions that constitute branches/bodies of control flow statements,
eg. `E1' in `if (C1) E1;' but not `E2' in `if (C2) { E2; }', were kept alive
for too long. This caused false positives in MoveChecker because it relies
on cleaning up loop-local variables when they go out of scope, but some of those
live-for-too-long expressions were keeping a reference to those variables.

Fix liveness analysis to correctly mark these expressions as dead.

Add a debug checker, debug.DumpLiveStmts, in order to test expressions liveness.

Differential Revision: https://reviews.llvm.org/D55566

llvm-svn: 349320
2018-12-16 23:44:06 +00:00
..
AnalysisDeclContext.cpp [analyzer] Generate and use stable identifiers for LocationContext 2018-09-15 02:03:36 +00:00
BodyFarm.cpp [AST] Only store data for the NRVO candidate in ReturnStmt if needed 2018-10-30 14:40:49 +00:00
CFG.cpp Revert "Revert r347417 "Re-Reinstate 347294 with a fix for the failures."" 2018-11-30 23:41:18 +00:00
CFGReachabilityAnalysis.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
CFGStmtMap.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
CMakeLists.txt Reapply Logging: make os_log buffer size an integer constant expression. 2018-11-02 13:14:11 +00:00
CallGraph.cpp Change CallGraph print to show the fully qualified name 2018-12-12 18:11:36 +00:00
CloneDetection.cpp Misc typos fixes in ./lib folder 2018-12-10 12:37:46 +00:00
CocoaConventions.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
CodeInjector.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
ConstructionContext.cpp [CFG] [analyzer] NFC: Enumerate construction context layer kinds. 2018-07-31 21:12:42 +00:00
Consumed.cpp Port getLocEnd -> getEndLoc 2018-08-09 21:09:38 +00:00
Dominators.cpp [Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-13 21:32:01 +00:00
ExprMutationAnalyzer.cpp [analyzer] Fix nullptr access when processing instantiated function in ExprMutationAnalyzer. 2018-09-19 18:00:55 +00:00
LiveVariables.cpp [analyzer] Fix some expressions staying live too long. Add a debug checker. 2018-12-16 23:44:06 +00:00
ObjCNoReturn.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
PostOrderCFGView.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
ProgramPoint.cpp Fix linkage error on ProgramPoint's dump method. 2018-09-30 18:05:39 +00:00
ReachableCode.cpp Fix clang -Wimplicit-fallthrough warnings across llvm, NFC 2018-11-01 19:54:45 +00:00
ThreadSafety.cpp Thread safety analysis: Avoid intermediate copies [NFC] 2018-12-16 16:19:11 +00:00
ThreadSafetyCommon.cpp Create ConstantExpr class 2018-10-31 03:48:47 +00:00
ThreadSafetyLogical.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
ThreadSafetyTIL.cpp Eliminate some unneeded signed/unsigned conversions 2018-09-22 21:56:16 +00:00
UninitializedValues.cpp Remove trailing space 2018-07-30 19:24:48 +00:00