[llvm] b026ce9 - [MC] Add Subtarget for MAsmParser call to emitCodeAlignment

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 05:28:55 PDT 2021


Author: Peter Smith
Date: 2021-09-08T13:28:24+01:00
New Revision: b026ce9c8a81a3be4cd2212a97e8b5d609631334

URL: https://github.com/llvm/llvm-project/commit/b026ce9c8a81a3be4cd2212a97e8b5d609631334
DIFF: https://github.com/llvm/llvm-project/commit/b026ce9c8a81a3be4cd2212a97e8b5d609631334.diff

LOG: [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

Added: 
    

Modified: 
    llvm/lib/MC/MCParser/MasmParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/MCParser/MasmParser.cpp b/llvm/lib/MC/MCParser/MasmParser.cpp
index f983bb335e328..f1704cef46ace 100644
--- a/llvm/lib/MC/MCParser/MasmParser.cpp
+++ b/llvm/lib/MC/MCParser/MasmParser.cpp
@@ -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,


        


More information about the llvm-commits mailing list