This is an archive of the discontinued LLVM Phabricator instance.

[SaveAndRestore] Upgrade this to support non-copyable types.
ClosedPublic

Authored by lattner on Oct 13 2022, 10:01 PM.

Details

Summary

This adds a constructor and upgrades the dtor to work with
move-only types.

Diff Detail

Event Timeline

lattner created this revision.Oct 13 2022, 10:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2022, 10:01 PM
lattner requested review of this revision.Oct 13 2022, 10:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2022, 10:01 PM

This is an obvious patch and tested with out of tree clients. There isn't an obvious owner for this file at this time besides me :-/, anyone object to landing this?

bzcheeseman accepted this revision.Oct 13 2022, 10:43 PM

LGTM - I might clarify get to be getOldValue or something to make it easier on the reader at the callsite, but I don't have strong feelings about it.

This revision is now accepted and ready to land.Oct 13 2022, 10:43 PM
nkreeger accepted this revision.Oct 14 2022, 4:58 AM

agreed, I'm not in love with the existing API, but I don't want to break everyone for no reason. Thanks for the review!