llvm-project/llvm/tools/llvm-ml
Peter Smith 5e71839f77 [MC] Add MCSubtargetInfo to MCAlignFragment
In preparation for passing the MCSubtargetInfo (STI) through to writeNops
so that it can use the STI in operation at the time, we need to record the
STI in operation when a MCAlignFragment may write nops as padding. The
STI is currently unused, a further patch will pass it through to
writeNops.

There are many places that can create an MCAlignFragment, in most cases
we can find out the STI in operation at the time. In a few places this
isn't possible as we are in initialisation or finalisation, or are
emitting constant pools. When possible I've tried to find the most
appropriate existing fragment to obtain the STI from, when none is
available use the per module STI.

For constant pools we don't actually need to use EmitCodeAlign as the
constant pools are data anyway so falling through into it via an
executable NOP is no better than falling through into data padding.

This is a prerequisite for D45962 which uses the STI to emit the
appropriate NOP for the STI. Which can differ per fragment.

Note that involves an interface change to InitSections. It is now
called initSections and requires a SubtargetInfo as a parameter.

Differential Revision: https://reviews.llvm.org/D45961
2021-09-07 15:46:19 +01:00
..
CMakeLists.txt [ms] [llvm-ml] Introduce command-line compatibility for ml.exe and ml64.exe 2020-12-01 17:43:44 -05:00
Disassembler.cpp [MC] Add MCSubtargetInfo to MCAlignFragment 2021-09-07 15:46:19 +01:00
Disassembler.h
Opts.td [ms] [llvm-ml] Support built-in text macros 2021-07-21 11:44:09 -04:00
llvm-ml.cpp [ms] [llvm-ml] Support built-in text macros 2021-07-21 11:44:09 -04:00