This is an archive of the discontinued LLVM Phabricator instance.

[demangler][NFC] Rename SwapAndRestore to ScopedOverride
ClosedPublic

Authored by urnathan on Mar 28 2022, 11:49 AM.

Details

Summary

The demangler has a utility class 'SwapAndRestore'. That name is confusing. It's not swapping anything, and the restore part happens at the object's destruction. What it's actually doing is allowing a override of some value that is dynamically accessible within the lifetime of a lexical scope. A better name, IMHO, is ScopedOverride, and a rename of its member variables.

Diff Detail

Event Timeline

urnathan created this revision.Mar 28 2022, 11:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2022, 11:49 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
urnathan requested review of this revision.Mar 28 2022, 11:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2022, 11:49 AM
urnathan edited reviewers, added: Restricted Project; removed: erichkeane.Mar 31 2022, 9:47 AM

Maybe ScopedOverride?

urnathan updated this revision to Diff 420514.Apr 5 2022, 8:18 AM
urnathan retitled this revision from [demangler][NFC] Rename SwapAndRestore to DynamicOverride to [demangler][NFC] Rename SwapAndRestore to ScopedOverride.
urnathan edited the summary of this revision. (Show Details)

let's try with ScopedOverride

dblaikie accepted this revision.Apr 6 2022, 11:49 AM

Looks good, thanks

This revision is now accepted and ready to land.Apr 6 2022, 11:49 AM
This revision was landed with ongoing or failed builds.Apr 6 2022, 12:55 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 12:55 PM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript