[ARM][BPF][Lanai][MSP430] Use MCRegister::id() to avoid an implicit cast. NFC#167537
Merged
[ARM][BPF][Lanai][MSP430] Use MCRegister::id() to avoid an implicit cast. NFC#167537
Conversation
Member
|
@llvm/pr-subscribers-backend-arm @llvm/pr-subscribers-backend-msp430 Author: Craig Topper (topperc) ChangesFull diff: https://github.com/llvm/llvm-project/pull/167537.diff 3 Files Affected:
diff --git a/llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp b/llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp
index d96f403d2f814..9f86322a81b3e 100644
--- a/llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp
+++ b/llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp
@@ -172,7 +172,7 @@ struct BPFOperand : public MCParsedAsmOperand {
break;
case Register:
OS << "<register x";
- OS << getReg() << ">";
+ OS << getReg().id() << ">";
break;
case Token:
OS << "'" << getToken() << "'";
diff --git a/llvm/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp b/llvm/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp
index cef77f1c512f6..0444c865f6866 100644
--- a/llvm/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp
+++ b/llvm/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp
@@ -559,7 +559,7 @@ struct LanaiOperand : public MCParsedAsmOperand {
OS << "Token: " << getToken() << "\n";
break;
case REGISTER:
- OS << "Reg: %r" << getReg() << "\n";
+ OS << "Reg: %r" << getReg().id() << "\n";
break;
case MEMORY_IMM:
OS << "MemImm: ";
@@ -567,14 +567,14 @@ struct LanaiOperand : public MCParsedAsmOperand {
OS << '\n';
break;
case MEMORY_REG_IMM:
- OS << "MemRegImm: " << getMemBaseReg() << "+";
+ OS << "MemRegImm: " << getMemBaseReg().id() << "+";
MAI.printExpr(OS, *getMemOffset());
OS << '\n';
break;
case MEMORY_REG_REG:
assert(getMemOffset() == nullptr);
- OS << "MemRegReg: " << getMemBaseReg() << "+"
- << "%r" << getMemOffsetReg() << "\n";
+ OS << "MemRegReg: " << getMemBaseReg().id() << "+"
+ << "%r" << getMemOffsetReg().id() << "\n";
break;
}
}
diff --git a/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp b/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
index a31c8ec1b2bb5..a8891d686abe8 100644
--- a/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
+++ b/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
@@ -230,7 +230,7 @@ class MSP430Operand : public MCParsedAsmOperand {
O << "Token " << Tok;
break;
case k_Reg:
- O << "Register " << Reg;
+ O << "Register " << Reg.id();
break;
case k_Imm:
O << "Immediate ";
@@ -241,10 +241,10 @@ class MSP430Operand : public MCParsedAsmOperand {
MAI.printExpr(O, *Mem.Offset);
break;
case k_IndReg:
- O << "RegInd " << Reg;
+ O << "RegInd " << Reg.id();
break;
case k_PostIndReg:
- O << "PostInc " << Reg;
+ O << "PostInc " << Reg.id();
break;
}
}
|
arsenm
approved these changes
Nov 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.