[llvm] [RISCV][MC] Pass MCSubtargetInfo down to shouldForceRelocation and evaluateTargetFixup. (PR #73721)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 23:29:36 PST 2023


MaskRay wrote:

https://reviews.llvm.org/D44928 passes MCSubtargetInfo from MCFragment to `applyFixup`.
It's reasonable for the similar `evaluateFixup` to get MCSubtargetInfo.
Another call site of `evaluateFixup` in MCAssembler::fixupNeedsRelaxation can use the MCSubtargetInfo from the parameter MCRelaxableFragment.

Changing `shouldForceRelocation` is too heavy. I wish that we could avoid the changes but I haven't found a way.
The parameter `const MCSubtargetInfo *STI` is unfortunately nullable because some MCFragment kinds with fixups do not provide a `MCSubtargetInfo`.


https://github.com/llvm/llvm-project/pull/73721


More information about the llvm-commits mailing list