llvm-project/clang/tools/driver
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 [CMake][llvm] avoid conflict w/ (and use when available) new builtin check_linker_flag 2021-04-27 16:41:28 -07:00
Info.plist.in
cc1_main.cpp [clang][cli] Command line round-trip for HeaderSearch options 2021-02-04 10:18:34 +01:00
cc1as_main.cpp [MC] Add MCSubtargetInfo to MCAlignFragment 2021-09-07 15:46:19 +01:00
cc1gen_reproducer_main.cpp [SystemZ][z/OS] Set more text files as text 2021-04-19 09:31:46 -04:00
driver.cpp [clang] NFC: Extract DiagnosticOptions parsing 2021-09-02 14:37:14 +02:00