[PATCH] D44928: [MC] Pass MCSubtargetInfo through to fixupNeedsRelaxation

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 10:32:37 PDT 2018


peter.smith added a comment.

I've done a bit of thinking about how best to get the necessary information to ARMAsmBackend::writeNopData and ARMAsmBackend::applyFixup. I made an attempt at passing MCSubtargetInfo through the necessary layers so that STI could be removed. I think that this is impractical for writeNopData, although possible for applyFixup. What I propose to do:

- The writeNopData() currently checks to see if the Architectural NOP instruction is supported, based on the MCSubtargetInfo in ARMAsmBackend. I think that an EmitAssemblerFlag that is used in the same way as the flag to switch from Thumb to Arm can toggle the support for the Architectural NOP without having to do large amounts of source code changes, most of them outside the ARM backend.
- All the fixups that test the MCSubTargetInfo for target features are for instruction fixups, these are covered by the  MCRelaxableFragment type that already has STI embedded in it. Rather than adding STI to the Data Fragments with relaxations I propose to pass a pointer to STI that will be null for Data Fragments.


https://reviews.llvm.org/D44928





More information about the llvm-commits mailing list