This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Re-enable lifetime extension for temporaries without destructors and bring back static temporaries.
ClosedPublic

Authored by NoQ on Jun 1 2018, 2:53 PM.

Details

Summary

I don't remember why lifetime extension for temporaries without destructors was disabled. It's clearly less important and is a different syntax to support, so i guess i simply didn't want to pretend that it works before i tested it, but it generally seems to be pretty much the same.

Added a simple test to test this.

One thing i noticed when i re-enabled such lifetime extension was that we had tests for "static temporaries" (i.e. temporaries lifetime-extended by static or global variables) which started to fail, so i had to fix them as well, which wasn't hard.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ created this revision.Jun 1 2018, 2:53 PM
NoQ updated this revision to Diff 149567.Jun 1 2018, 3:06 PM

Fix comments in the callback test. The test itself is pretty pointless now, because the behavior that it was supposed to test was a workaround for lack of lifetime extension support.

NoQ updated this revision to Diff 149586.Jun 1 2018, 4:59 PM

Remove the outdated FIXME comment.

MTC added a subscriber: MTC.Jun 4 2018, 12:07 AM
MTC added inline comments.
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
234 ↗(On Diff #149586)

An unrelated question. I want to know, what considerations are you based on not continue to use short circuit style : )?

NoQ updated this revision to Diff 151276.Jun 13 2018, 5:39 PM
NoQ marked an inline comment as done.

Fxd.

NoQ added inline comments.Jun 13 2018, 5:39 PM
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
234 ↗(On Diff #149586)

Whoops accidental^^

NoQ retitled this revision from [analyzer] Re-enable lifetime extension for temporaries with destructors and bring back static temporaries. to [analyzer] Re-enable lifetime extension for temporaries without destructors and bring back static temporaries..Jun 26 2018, 10:01 AM
george.karpenkov accepted this revision.Jun 26 2018, 6:19 PM
This revision is now accepted and ready to land.Jun 26 2018, 6:19 PM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.