A few methods in RegisterContext classes accept const objects which are
cast to a non-const thread_state_t. Drop const-ness more explicitly
where we mean to do so. This fixes a slew of warnings.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Seems wrong to remove the const on structs that don't need to change in order to make the write happen. Can't we just quiet the warnings with a const_cast inside the function call?
Comment Actions
Absolutely. I opted for dropping const to make the DoRead* and DoWrite* methods feel consistent. At first glance, it looked like there may be methods in RegisterContext which expect non-const GPR/FPU/etc objects, so it seemed reasonable to drop const.
I'm open to just adding in the const_cast<X>(static_cast<const X>(...)) pattern as needed to suppress warnings, and to constifying the rest of RegisterContext as a follow-up. Let me know what you'd prefer.