]> granicus.if.org Git - clang/commit
Re-applying r214962.
authorManuel Klimek <klimek@google.com>
Thu, 7 Aug 2014 10:42:17 +0000 (10:42 +0000)
committerManuel Klimek <klimek@google.com>
Thu, 7 Aug 2014 10:42:17 +0000 (10:42 +0000)
commitcbcae73c5129adbfc35eefd9f13806533c875c3d
treebff052a17c67e6a8843862ba6ee939c2048bed8a
parentd00775bf39d0f607ff98182e0bd52c55bcf9db6f
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
include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h
lib/Analysis/CFG.cpp
lib/StaticAnalyzer/Core/CoreEngine.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
test/Analysis/temp-obj-dtors-cfg-output.cpp
test/Analysis/temporaries.cpp
test/SemaCXX/return-noreturn.cpp