CFG: Add CFGElement for automatic variables that leave the scope
Summary: This mimics the implementation for the implicit destructors. The generation of this scope leaving elements is hidden behind a flag to the CFGBuilder, thus it should not affect existing code. Currently, I'm missing a test (it's implicitly tested by the clang-tidy lifetime checker that I'm proposing). I though about a test using debug.DumpCFG, but then I would have to add an option to StaticAnalyzer/Core/AnalyzerOptions to enable the scope leaving CFGElement, which would only be useful to that particular test. Any other ideas how I could make a test for this feature? Reviewers: krememek, jordan_rose Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15031 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307759 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Analysis/AnalysisContext.h 1 addition, 0 deletionsinclude/clang/Analysis/AnalysisContext.h
- include/clang/Analysis/CFG.h 44 additions, 1 deletioninclude/clang/Analysis/CFG.h
- include/clang/StaticAnalyzer/Core/AnalyzerOptions.h 21 additions, 1 deletioninclude/clang/StaticAnalyzer/Core/AnalyzerOptions.h
- lib/Analysis/AnalysisDeclContext.cpp 2 additions, 0 deletionslib/Analysis/AnalysisDeclContext.cpp
- lib/Analysis/CFG.cpp 179 additions, 45 deletionslib/Analysis/CFG.cpp
- lib/StaticAnalyzer/Core/AnalysisManager.cpp 2 additions, 1 deletionlib/StaticAnalyzer/Core/AnalysisManager.cpp
- lib/StaticAnalyzer/Core/AnalyzerOptions.cpp 11 additions, 0 deletionslib/StaticAnalyzer/Core/AnalyzerOptions.cpp
- lib/StaticAnalyzer/Core/ExprEngine.cpp 2 additions, 0 deletionslib/StaticAnalyzer/Core/ExprEngine.cpp
- lib/StaticAnalyzer/Core/PathDiagnostic.cpp 1 addition, 0 deletionslib/StaticAnalyzer/Core/PathDiagnostic.cpp
- test/Analysis/analyzer-config.c 3 additions, 2 deletionstest/Analysis/analyzer-config.c
- test/Analysis/analyzer-config.cpp 3 additions, 1 deletiontest/Analysis/analyzer-config.cpp
- test/Analysis/lifetime-cfg-output.cpp 783 additions, 0 deletionstest/Analysis/lifetime-cfg-output.cpp
Loading
Please register or sign in to comment