We have some 500 ish uses of the bool plus ref version
so changing them all at once isn't a great idea.
This adds an overload that doesn't take a RegisterInfo&
and returns an optional.
Once I'm done switching all the existing callers I'll
remove the original function.
Benefits of optional over bool plus ref:
- The intent of the function is clear from the prototype.
- It's harder to forget to check if the return is valid, and if you do you'll get an assert.
- You don't hide ununsed variables, which happens because passing by ref marks a variable used.
- You can't forget to reset the RegisterInfo in between calls.