[demangler][NFC] Rename SwapAndRestore to ScopedOverride
authorNathan Sidwell <nathan@acm.org>
Mon, 28 Feb 2022 18:18:14 +0000 (10:18 -0800)
committerNathan Sidwell <nathan@acm.org>
Wed, 6 Apr 2022 19:55:35 +0000 (12:55 -0700)
commit51f6caf2fbb5118569f2de33a85ffcc52568e0a7
tree0c9e97ab607b66cd24fadc13c418d82ad34cf04a
parent7594e236795f695c7cf9336ee24ef76c275d8703
[demangler][NFC] Rename SwapAndRestore to ScopedOverride

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. Thus rename it to ScopedOverride, and
tweak it's member variable names.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D122606
libcxxabi/src/demangle/ItaniumDemangle.h
libcxxabi/src/demangle/Utility.h
llvm/include/llvm/Demangle/ItaniumDemangle.h
llvm/include/llvm/Demangle/Utility.h
llvm/lib/Demangle/RustDemangle.cpp