This is an archive of the discontinued LLVM Phabricator instance.

[CFG] [analyzer] Remove unnecessary CXXBindTemporaryExpr from lifetime-extended temporary construction contexts.
ClosedPublic

Authored by NoQ on Jun 1 2018, 5:16 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM