[PATCH] D47667: [CFG] [analyzer] Remove unnecessary CXXBindTemporaryExpr from lifetime-extended temporary construction contexts.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 1 17:16:41 PDT 2018


NoQ created this revision.
NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet, rnkovacs.
Herald added subscribers: cfe-commits, baloghadamsoftware.

`CXXBindTemporaryExpr ` is used for attaching the destructor of the temporary object to it.

If the object is lifetime-extended (which is indicated by the surrounding `MaterializeTemporaryExpr`'s storage duration property), then it doesn't require a temporary object destructor; it'll instead be destroyed automatically.

Remove `CXXBindTemporaryExpr` completely from the `ConstructionContext` in this case, instead of making clients take care of it.


Repository:
  rC Clang

https://reviews.llvm.org/D47667

Files:
  lib/Analysis/ConstructionContext.cpp
  lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
  test/Analysis/auto-obj-dtors-cfg-output.cpp
  test/Analysis/cfg-rich-constructors.cpp
  test/Analysis/temp-obj-dtors-cfg-output.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47667.149587.patch
Type: text/x-patch
Size: 10645 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180602/7bd41834/attachment.bin>


More information about the cfe-commits mailing list