[llvm] [M68k] Remove STI from M68kAsmParser (PR #159827)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 11:22:30 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-m68k

Author: Sergei Barannikov (s-barannikov)

<details>
<summary>Changes</summary>

This already exists in the base class.
This resolves a build error:

```
lib/Target/M68k/M68kGenAsmMatcher.inc:2633:60: error: indirection requires pointer operand ('const MCSubtargetInfo' invalid)
 2633 |       unsigned Diag = validateOperandClass(Actual, Formal, *STI);
      |                                                            ^~~~
1 error generated.
```

---
Full diff: https://github.com/llvm/llvm-project/pull/159827.diff


1 Files Affected:

- (modified) llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp (+2-3) 


``````````diff
diff --git a/llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp b/llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
index 16f97d971840b..3e9666f586e0f 100644
--- a/llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
+++ b/llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
@@ -32,7 +32,6 @@ static cl::opt<bool> RegisterPrefixOptional(
 namespace {
 /// Parses M68k assembly from a stream.
 class M68kAsmParser : public MCTargetAsmParser {
-  const MCSubtargetInfo &STI;
   MCAsmParser &Parser;
   const MCRegisterInfo *MRI;
 
@@ -58,7 +57,7 @@ class M68kAsmParser : public MCTargetAsmParser {
 public:
   M68kAsmParser(const MCSubtargetInfo &STI, MCAsmParser &Parser,
                 const MCInstrInfo &MII, const MCTargetOptions &Options)
-      : MCTargetAsmParser(Options, STI, MII), STI(STI), Parser(Parser) {
+      : MCTargetAsmParser(Options, STI, MII), Parser(Parser) {
     MCAsmParserExtension::Initialize(Parser);
     MRI = getContext().getRegisterInfo();
 
@@ -1024,7 +1023,7 @@ bool M68kAsmParser::missingFeature(llvm::SMLoc const &Loc,
 bool M68kAsmParser::emit(MCInst &Inst, SMLoc const &Loc,
                          MCStreamer &Out) const {
   Inst.setLoc(Loc);
-  Out.emitInstruction(Inst, STI);
+  Out.emitInstruction(Inst, *STI);
 
   return false;
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/159827


More information about the llvm-commits mailing list