-
Notifications
You must be signed in to change notification settings - Fork 14.3k
MachineFunction: Remove null check on TargetRegisterInfo #128480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MachineFunction: Remove null check on TargetRegisterInfo #128480
Conversation
Targets are required to define this, it is not optional. Make the method pure virtual to enforce this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've not used pure functions here before - are we happy with setting this precedent, and are there any other TargetSubtargetInfo functions that should be made pure?
TargetInstrInfo / TargetRegisterInfo use an inconsistent mix of pure and cases with default implementations which are just llvm_unreachable. I don't think it matters, or why TargetSubtargetInfo would be any different. In this case, I don't know why these aren't just required fields in the base class the subclass constructor is required to set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - hopefully this will set a precedent to move to pure virtual functions where possible.
1. Fix build break caused by llvm#126772 by adding `writeDISubrangeType` stub to `DXILBitcodeWriter.cpp` 2. Fix build break caused by llvm#128480 by adding implementation of pure virtual method `TargetSubtargetInfo::getRegisterInfo`
1. Fix build break caused by llvm#126772 by adding `writeDISubrangeType` stub to `DXILBitcodeWriter.cpp` 2. Fix build break caused by llvm#128480 by adding implementation of pure virtual method `TargetSubtargetInfo::getRegisterInfo`
Targets are required to define this, it is not optional. Make the method
pure virtual to enforce this