forked from facebook/infer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang] create C++ temporaries on CXXBindTemporaryExpr when appropriate
Summary: Like `MaterializeTemporaryExpr`, `CXXBindTemporaryExpr` is used by clang to signal that a temporary variable is needed to hold the result of a (sub-)expression. But, unlike the former, the latter only requires a C++ temporary to be created in *some* of the cases, namely when the sub-expression is not performing initialisation for a known variable already (in particular one already created by `MaterializeTemporaryExpr`! Or an actual program variable being assigned). Previously, we were missing creating (and thus destroying) these C++ temporaries when needed. This diff fixes that by registering `CXXBindTemporaryExpr` as a source of C++ temporaries in CScope.ml, and adding logic to destroy only the C++ temporaries that ended up being actually used. Reviewed By: skcho Differential Revision: D30455859 fbshipit-source-id: baf7029eb
- Loading branch information
1 parent
fa4bbd2
commit 2ad9459
Showing
9 changed files
with
105 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.