LLVM: llvm::sandboxir::GenericSetter< GetterFn, SetterFn > Class Template Reference (original) (raw)
template<auto GetterFn, auto SetterFn>
class llvm::sandboxir::GenericSetter< GetterFn, SetterFn >
This class can be used for tracking most instruction setters.
The two template arguments are:
- GetterFn: The getter member function pointer (e.g., &Foo::get)
- SetterFn: The setter member function pointer (e.g., &Foo::set) Upon construction, it saves a copy of the original value by calling the getter function. Revert sets the value back to the one saved, using the setter function provided.
Example: Tracker.track(std::make_unique< GenericSetter<&FooInst::get, &FooInst::set>>(I, Tracker));