Re-applying r214962.
Changes to the original patch: - model the CFG for temporary destructors in conditional operators so that the destructors of the true and false branch are always exclusive. This is necessary because we must not have impossible paths for the path based analysis to work. - add multiple regression tests with ternary operators Original description: Fix modelling of non-lifetime-extended temporary destructors in the analyzer. Changes to the CFG: When creating the CFG for temporary destructors, we create a structure that mirrors the branch structure of the conditionally executed temporary constructors in a full expression. The branches we create use a CXXBindTemporaryExpr as terminator which corresponds to the temporary constructor which must have been executed to enter the destruction branch. 2. Changes to the Analyzer: When we visit a CXXBindTemporaryExpr we mark the CXXBindTemporaryExpr as executed in the state; when we reach a branch that contains the corresponding CXXBindTemporaryExpr as terminator, we branch out depending on whether the corresponding CXXBindTemporaryExpr was marked as executed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215096 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h 2 additions, 0 deletionsinclude/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
- include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h 14 additions, 1 deletioninclude/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
- include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h 10 additions, 0 deletionsinclude/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h
- lib/Analysis/CFG.cpp 160 additions, 137 deletionslib/Analysis/CFG.cpp
- lib/StaticAnalyzer/Core/CoreEngine.cpp 17 additions, 0 deletionslib/StaticAnalyzer/Core/CoreEngine.cpp
- lib/StaticAnalyzer/Core/ExprEngine.cpp 93 additions, 10 deletionslib/StaticAnalyzer/Core/ExprEngine.cpp
- test/Analysis/temp-obj-dtors-cfg-output.cpp 45 additions, 58 deletionstest/Analysis/temp-obj-dtors-cfg-output.cpp
- test/Analysis/temporaries.cpp 170 additions, 11 deletionstest/Analysis/temporaries.cpp
- test/SemaCXX/return-noreturn.cpp 22 additions, 0 deletionstest/SemaCXX/return-noreturn.cpp
Loading
Please register or sign in to comment