[MC] Add Subtarget for MAsmParser call to emitCodeAlignment

The call to emitCodeAlignment was missing a STI which is required
after D45962.

emitCodeAlignment has a default parameter of 0 for MaxBytesToEmit.
Explicitly passing 0 here was interpreted as as nullptr for the STI.
This could possibly be avoided by taking STI as a const reference in
emitCodeAlignment.

Differential Revision: https://reviews.llvm.org/D109425
This commit is contained in:
Peter Smith 2021-09-08 10:33:52 +01:00
parent 35cc4ad354
commit b026ce9c8a
1 changed files with 2 additions and 1 deletions

View File

@ -4772,7 +4772,8 @@ bool MasmParser::emitAlignTo(int64_t Alignment) {
const MCSection *Section = getStreamer().getCurrentSectionOnly();
assert(Section && "must have section to emit alignment");
if (Section->UseCodeAlign()) {
getStreamer().emitCodeAlignment(Alignment, /*MaxBytesToEmit=*/0);
getStreamer().emitCodeAlignment(Alignment, &getTargetParser().getSTI(),
/*MaxBytesToEmit=*/0);
} else {
// FIXME: Target specific behavior about how the "extra" bytes are filled.
getStreamer().emitValueToAlignment(Alignment, /*Value=*/0,