Skip to content

Conversation

s-barannikov
Copy link
Contributor

@s-barannikov s-barannikov commented Sep 19, 2025

This already exists in the base class.
Fixes #159862.

@llvmbot
Copy link
Member

llvmbot commented Sep 19, 2025

@llvm/pr-subscribers-backend-m68k

Author: Sergei Barannikov (s-barannikov)

Changes

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 --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;
 }

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.
```
Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I fixed this one already

@s-barannikov
Copy link
Contributor Author

I thought I fixed this one already

Must be #156443.

@s-barannikov s-barannikov merged commit 07def27 into llvm:main Sep 20, 2025
9 checks passed
@s-barannikov s-barannikov deleted the m68k-asm-parser-sti branch September 20, 2025 00:08
@mshockwave
Copy link
Member

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

M68k/M68kGenAsmMatcher.inc:2633:60: error: no match for 'operator*' (operand type is 'const llvm::MCSubtargetInfo')
4 participants