This is an archive of the discontinued LLVM Phabricator instance.

[Temporary, Lifetime] Add lifetime marks for temporaries
ClosedPublic

Authored by timshen on May 20 2016, 3:37 PM.

Diff Detail

Event Timeline

timshen updated this revision to Diff 58011.May 20 2016, 3:37 PM
timshen retitled this revision from to [Temporary, Lifetime] Add lifetime marks for temporaries.
timshen updated this object.
timshen added a reviewer: rsmith.
timshen added a subscriber: cfe-commits.
rsmith added inline comments.May 26 2016, 12:18 PM
lib/CodeGen/CGExpr.cpp
446

This should use pushFullExprCleanup.

timshen updated this revision to Diff 58734.May 26 2016, 6:00 PM

Used pushFullExprCleanup.

microsoft-abi-eh-cleanups.cpp fails because each pushFullExprCleanup introduces a new cleanup.cond variable, even if that pushFullExprCleanup is just for lifetime marks. With LLVM optimizations turned on (e.g. -O1), these cleanup.conds get eliminated; -O0 doesn't generate lifetime marks. So there is no practical affect unless "-disable-llvm-optzns -O3" -- as the test does -- are passed together.

timshen updated this revision to Diff 58737.May 26 2016, 6:01 PM

Upload the rebased patch.

timshen updated this revision to Diff 58738.May 26 2016, 6:02 PM

Upload the rebased patch.

timshen marked an inline comment as done.May 26 2016, 6:02 PM

Is anything blocking us on this review?

I'm looking at some internal test failures caused by this patch.

rsmith added inline comments.Jun 30 2016, 1:43 PM
lib/CodeGen/CGExpr.cpp
438–453

Seems like you should push the cleanup before you emit the initializer; the cleanup should run if the initializer throws.

timshen updated this revision to Diff 62433.Jun 30 2016, 3:26 PM

Done. Added a new testcase to ensure the correct behavior with exceptions turned on.

rsmith accepted this revision.Jul 1 2016, 11:41 AM
rsmith edited edge metadata.
This revision is now accepted and ready to land.Jul 1 2016, 11:41 AM
This revision was automatically updated to reflect the committed changes.
timshen marked an inline comment as done.

Also committed r274387 to remove unnecessary CHECks. It seems to cause problems in certain platforms.

...and r274396 to remove all of the checks for symbolic labels, which are not generated by release builds, nor controlled by a runtime-flag.