DavidSpickett wrote:

> In this change I've expanded the existing RegisterSetType enum to be used as 
> part of a singular cache tracking object which replaces all the separate 
> booleans. These booleans were hard to track and set/reset in the right places.

An alternative to this would be to use `std::optional<whatever>` for all of the 
storage. This changes the order of operations to:
* storage.emplace() to make the thing valid
* ptrace(read whatever ....)
* if failure, reset the optional

I still think you would have some MakeValid type function that knows what to 
emplace, and some things (SME's ZA) would need an explicit validity bool, but 
it might work and if we could get free asserts from optional, that'd be nice.

I'm going to give that a go as an alternative approach.

https://github.com/llvm/llvm-project/pull/197113
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to