This adds virtual function GetInstSizeInBytes to TargetInstrInfo that a lot of subclasses already implement.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/llvm/Target/TargetInstrInfo.h | ||
---|---|---|
255 ↗ | (On Diff #65795) | This should start with a lowercase letter. It should also have a default implementation of llvm_unreachable since I don't think guessing 4 is a reasonable default |
This needs to have a conservatively correct return value or an 'unimplemented' sentinel value. 4 is not a correct assumption to make.
Cheers,
James
Thanks for reviewing.
I have added llvm_unreachable as the default implementation instead of 4.
Can we keep the function name that starts with a capital letter because that's the function that 6 targets already implement?
You have to touch all of them anyway to add the overrides, so might as well fix the name while you're at it
Ok, thanks, will do. And I actually need to double check if the "unreachable" solves my problem, or if I need to come up with a better default int value.
I have 1) changed the default value to ~0U, 2) renamed the function name to use a lowercase letter, and 3) added "override" to the different subclasses
include/llvm/Target/TargetInstrInfo.h | ||
---|---|---|
253 ↗ | (On Diff #65892) | You must document the ~0U sentinel and what it means. Also mention that the unit is "bytes". |
The renaming is in a separate commit: https://reviews.llvm.org/D22925.
When that is accepted/committed, I will continue here with the functional change.
This now only implements the functional change to add getInstSizeInBytes to TargetInstrInfo.