llvm::SaveAndRestore

A utility class that uses RAII to save and restore the value of a variable.

Synopsis

Declared in <llvm/Support/SaveAndRestore.h>

template<typename T>
struct SaveAndRestore;

Member Functions

NameDescription
SaveAndRestore [constructor]Constructors
~SaveAndRestore [destructor]Restore the saved value to the referenced variable.
get Return the saved original value.

Deduction Guides

NameDescription
SaveAndRestore<T> Deduce SaveAndRestore from a reference to the saved variable.
SaveAndRestore<T> Deduce SaveAndRestore from a reference and a const new value.
SaveAndRestore<T> Deduce SaveAndRestore from a reference and a movable new value.