]> granicus.if.org Git - clang/commit
Fix modelling of non-lifetime-extended temporary destructors in the analyzer.
authorManuel Klimek <klimek@google.com>
Wed, 6 Aug 2014 12:45:51 +0000 (12:45 +0000)
committerManuel Klimek <klimek@google.com>
Wed, 6 Aug 2014 12:45:51 +0000 (12:45 +0000)
commit2282b76a957aaaf72f38a81975b6dffd8633eac8
tree63c8ee8d1c5c1dc0a2625be75882c14f18fbbf97
parent564fcf1cfb0de9812e852f1414c78dfe5a2fba87
Fix modelling of non-lifetime-extended temporary destructors in the analyzer.

1. 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@214962 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