-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[Mips] Remove implicit conversions of MCRegister to unsigned. NFC #167645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+184
−183
Conversation
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
Member
|
@llvm/pr-subscribers-backend-mips Author: Craig Topper (topperc) ChangesPatch is 46.57 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/167645.diff 6 Files Affected:
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index f588e56f2ea18..6b28531764db9 100644
--- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -151,7 +151,7 @@ class MipsAsmParser : public MCTargetAsmParser {
bool IsCpRestoreSet;
bool CurForbiddenSlotAttr;
int CpRestoreOffset;
- unsigned GPReg;
+ MCRegister GPReg;
unsigned CpSaveLocation;
/// If true, then CpSaveLocation is a register, otherwise it's an offset.
bool CpSaveLocationIsRegister;
@@ -823,7 +823,7 @@ class MipsOperand : public MCParsedAsmOperand {
};
struct RegListOp {
- SmallVector<unsigned, 10> *List;
+ SmallVector<MCRegister, 10> *List;
};
union {
@@ -1377,15 +1377,15 @@ class MipsOperand : public MCParsedAsmOperand {
if (Size < 2 || Size > 5)
return false;
- unsigned R0 = RegList.List->front();
- unsigned R1 = RegList.List->back();
+ MCRegister R0 = RegList.List->front();
+ MCRegister R1 = RegList.List->back();
if (!((R0 == Mips::S0 && R1 == Mips::RA) ||
(R0 == Mips::S0_64 && R1 == Mips::RA_64)))
return false;
- int PrevReg = *RegList.List->begin();
+ MCRegister PrevReg = RegList.List->front();
for (int i = 1; i < Size - 1; i++) {
- int Reg = (*(RegList.List))[i];
+ MCRegister Reg = (*(RegList.List))[i];
if ( Reg != PrevReg + 1)
return false;
PrevReg = Reg;
@@ -1447,7 +1447,7 @@ class MipsOperand : public MCParsedAsmOperand {
return static_cast<const MCConstantExpr *>(getMemOff())->getValue();
}
- const SmallVectorImpl<unsigned> &getRegList() const {
+ const SmallVectorImpl<MCRegister> &getRegList() const {
assert((Kind == k_RegList) && "Invalid access!");
return *(RegList.List);
}
@@ -1548,12 +1548,13 @@ class MipsOperand : public MCParsedAsmOperand {
}
static std::unique_ptr<MipsOperand>
- CreateRegList(SmallVectorImpl<unsigned> &Regs, SMLoc StartLoc, SMLoc EndLoc,
+ CreateRegList(SmallVectorImpl<MCRegister> &Regs, SMLoc StartLoc, SMLoc EndLoc,
MipsAsmParser &Parser) {
- assert(Regs.size() > 0 && "Empty list not allowed");
+ assert(!Regs.empty() && "Empty list not allowed");
auto Op = std::make_unique<MipsOperand>(k_RegList, Parser);
- Op->RegList.List = new SmallVector<unsigned, 10>(Regs.begin(), Regs.end());
+ Op->RegList.List =
+ new SmallVector<MCRegister, 10>(Regs.begin(), Regs.end());
Op->StartLoc = StartLoc;
Op->EndLoc = EndLoc;
return Op;
@@ -1684,7 +1685,7 @@ class MipsOperand : public MCParsedAsmOperand {
case k_RegList:
OS << "RegList< ";
for (auto Reg : (*RegList.List))
- OS << Reg << " ";
+ OS << Reg.id() << " ";
OS << ">";
break;
}
@@ -6848,9 +6849,9 @@ ParseStatus MipsAsmParser::parseInvNum(OperandVector &Operands) {
ParseStatus MipsAsmParser::parseRegisterList(OperandVector &Operands) {
MCAsmParser &Parser = getParser();
- SmallVector<unsigned, 10> Regs;
- unsigned RegNo;
- unsigned PrevReg = Mips::NoRegister;
+ SmallVector<MCRegister, 10> Regs;
+ MCRegister Reg;
+ MCRegister PrevReg;
bool RegRange = false;
SmallVector<std::unique_ptr<MCParsedAsmOperand>, 8> TmpOperands;
@@ -6860,46 +6861,47 @@ ParseStatus MipsAsmParser::parseRegisterList(OperandVector &Operands) {
SMLoc S = Parser.getTok().getLoc();
while (parseAnyRegister(TmpOperands).isSuccess()) {
SMLoc E = getLexer().getLoc();
- MipsOperand &Reg = static_cast<MipsOperand &>(*TmpOperands.back());
- RegNo = isGP64bit() ? Reg.getGPR64Reg() : Reg.getGPR32Reg();
+ MipsOperand &RegOpnd = static_cast<MipsOperand &>(*TmpOperands.back());
+ Reg = isGP64bit() ? RegOpnd.getGPR64Reg() : RegOpnd.getGPR32Reg();
if (RegRange) {
// Remove last register operand because registers from register range
// should be inserted first.
- if ((isGP64bit() && RegNo == Mips::RA_64) ||
- (!isGP64bit() && RegNo == Mips::RA)) {
- Regs.push_back(RegNo);
+ if ((isGP64bit() && Reg == Mips::RA_64) ||
+ (!isGP64bit() && Reg == Mips::RA)) {
+ Regs.push_back(Reg);
} else {
- unsigned TmpReg = PrevReg + 1;
- while (TmpReg <= RegNo) {
+ MCRegister TmpReg = PrevReg + 1;
+ while (TmpReg <= Reg) {
if ((((TmpReg < Mips::S0) || (TmpReg > Mips::S7)) && !isGP64bit()) ||
(((TmpReg < Mips::S0_64) || (TmpReg > Mips::S7_64)) &&
isGP64bit()))
return Error(E, "invalid register operand");
PrevReg = TmpReg;
- Regs.push_back(TmpReg++);
+ Regs.push_back(TmpReg);
+ TmpReg = TmpReg.id() + 1;
}
}
RegRange = false;
} else {
- if ((PrevReg == Mips::NoRegister) &&
- ((isGP64bit() && (RegNo != Mips::S0_64) && (RegNo != Mips::RA_64)) ||
- (!isGP64bit() && (RegNo != Mips::S0) && (RegNo != Mips::RA))))
+ if (!PrevReg.isValid() &&
+ ((isGP64bit() && (Reg != Mips::S0_64) && (Reg != Mips::RA_64)) ||
+ (!isGP64bit() && (Reg != Mips::S0) && (Reg != Mips::RA))))
return Error(E, "$16 or $31 expected");
- if (!(((RegNo == Mips::FP || RegNo == Mips::RA ||
- (RegNo >= Mips::S0 && RegNo <= Mips::S7)) &&
+ if (!(((Reg == Mips::FP || Reg == Mips::RA ||
+ (Reg >= Mips::S0 && Reg <= Mips::S7)) &&
!isGP64bit()) ||
- ((RegNo == Mips::FP_64 || RegNo == Mips::RA_64 ||
- (RegNo >= Mips::S0_64 && RegNo <= Mips::S7_64)) &&
+ ((Reg == Mips::FP_64 || Reg == Mips::RA_64 ||
+ (Reg >= Mips::S0_64 && Reg <= Mips::S7_64)) &&
isGP64bit())))
return Error(E, "invalid register operand");
- if ((PrevReg != Mips::NoRegister) && (RegNo != PrevReg + 1) &&
- ((RegNo != Mips::FP && RegNo != Mips::RA && !isGP64bit()) ||
- (RegNo != Mips::FP_64 && RegNo != Mips::RA_64 && isGP64bit())))
+ if (PrevReg.isValid() && (Reg != PrevReg + 1) &&
+ ((Reg != Mips::FP && Reg != Mips::RA && !isGP64bit()) ||
+ (Reg != Mips::FP_64 && Reg != Mips::RA_64 && isGP64bit())))
return Error(E, "consecutive register numbers expected");
- Regs.push_back(RegNo);
+ Regs.push_back(Reg);
}
if (Parser.getTok().is(AsmToken::Minus))
@@ -6913,7 +6915,7 @@ ParseStatus MipsAsmParser::parseRegisterList(OperandVector &Operands) {
if (Parser.getTok().isNot(AsmToken::Dollar))
break;
- PrevReg = RegNo;
+ PrevReg = Reg;
}
SMLoc E = Parser.getTok().getLoc();
@@ -7780,7 +7782,7 @@ bool MipsAsmParser::parseDirectiveCpLocal(SMLoc Loc) {
}
getParser().Lex(); // Consume the EndOfStatement.
- unsigned NewReg = RegOpnd.getGPR32Reg();
+ MCRegister NewReg = RegOpnd.getGPR32Reg();
if (IsPicEnabled)
GPReg = NewReg;
@@ -7835,7 +7837,6 @@ bool MipsAsmParser::parseDirectiveCpRestore(SMLoc Loc) {
bool MipsAsmParser::parseDirectiveCPSetup() {
MCAsmParser &Parser = getParser();
- unsigned FuncReg;
unsigned Save;
bool SaveIsReg = true;
@@ -7852,7 +7853,7 @@ bool MipsAsmParser::parseDirectiveCPSetup() {
return false;
}
- FuncReg = FuncRegOpnd.getGPR32Reg();
+ MCRegister FuncReg = FuncRegOpnd.getGPR32Reg();
TmpReg.clear();
if (!eatComma("unexpected token, expected comma"))
@@ -7878,7 +7879,7 @@ bool MipsAsmParser::parseDirectiveCPSetup() {
reportParseError(SaveOpnd.getStartLoc(), "invalid register");
return false;
}
- Save = SaveOpnd.getGPR32Reg();
+ Save = SaveOpnd.getGPR32Reg().id();
}
if (!eatComma("unexpected token, expected comma"))
@@ -8696,7 +8697,7 @@ bool MipsAsmParser::ParseDirective(AsmToken DirectiveID) {
"expected general purpose register");
return false;
}
- unsigned StackReg = StackRegOpnd.getGPR32Reg();
+ MCRegister StackReg = StackRegOpnd.getGPR32Reg();
if (Parser.getTok().is(AsmToken::Comma))
Parser.Lex();
diff --git a/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp b/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
index 12e31c07aa15a..fd9eb9b8fe9a3 100644
--- a/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
+++ b/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
@@ -103,7 +103,7 @@ LLVMInitializeMipsDisassembler() {
createMipselDisassembler);
}
-static unsigned getReg(const MCDisassembler *D, unsigned RC, unsigned RegNo) {
+static MCRegister getReg(const MCDisassembler *D, unsigned RC, unsigned RegNo) {
const MCRegisterInfo *RegInfo = D->getContext().getRegisterInfo();
return RegInfo->getRegClass(RC).getRegister(RegNo);
}
@@ -123,7 +123,7 @@ static DecodeStatus DecodeAFGR64RegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 30 || RegNo % 2)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::AFGR64RegClassID, RegNo / 2);
+ MCRegister Reg = getReg(Decoder, Mips::AFGR64RegClassID, RegNo / 2);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -134,7 +134,7 @@ static DecodeStatus DecodeACC64DSPRegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo >= 4)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::ACC64DSPRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::ACC64DSPRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -145,7 +145,7 @@ static DecodeStatus DecodeHI32DSPRegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo >= 4)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::HI32DSPRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::HI32DSPRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -156,7 +156,7 @@ static DecodeStatus DecodeLO32DSPRegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo >= 4)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::LO32DSPRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::LO32DSPRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -167,7 +167,7 @@ static DecodeStatus DecodeMSA128BRegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::MSA128BRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::MSA128BRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -178,7 +178,7 @@ static DecodeStatus DecodeMSA128HRegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::MSA128HRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::MSA128HRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -189,7 +189,7 @@ static DecodeStatus DecodeMSA128WRegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::MSA128WRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::MSA128WRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -200,7 +200,7 @@ static DecodeStatus DecodeMSA128DRegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::MSA128DRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::MSA128DRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -211,7 +211,7 @@ static DecodeStatus DecodeMSACtrlRegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 7)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::MSACtrlRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::MSACtrlRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -222,7 +222,7 @@ static DecodeStatus DecodeCOP0RegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::COP0RegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::COP0RegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -233,7 +233,7 @@ static DecodeStatus DecodeCOP2RegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::COP2RegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::COP2RegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -881,7 +881,7 @@ static DecodeStatus DecodeGPR64RegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::GPR64RegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::GPR64RegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -891,7 +891,7 @@ static DecodeStatus DecodeGPRMM16RegisterClass(MCInst &Inst, unsigned RegNo,
const MCDisassembler *Decoder) {
if (RegNo > 7)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::GPRMM16RegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::GPRMM16RegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -901,7 +901,7 @@ DecodeGPRMM16ZeroRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address,
const MCDisassembler *Decoder) {
if (RegNo > 7)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::GPRMM16ZeroRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::GPRMM16ZeroRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -911,7 +911,7 @@ DecodeGPRMM16MovePRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address,
const MCDisassembler *Decoder) {
if (RegNo > 7)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::GPRMM16MovePRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::GPRMM16MovePRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -948,7 +948,7 @@ static DecodeStatus DecodeGPR32RegisterClass(MCInst &Inst, unsigned RegNo,
const MCDisassembler *Decoder) {
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::GPR32RegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::GPR32RegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -974,7 +974,7 @@ static DecodeStatus DecodeFGR64RegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::FGR64RegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::FGR64RegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -985,7 +985,7 @@ static DecodeStatus DecodeFGR32RegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::FGR32RegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::FGR32RegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -995,7 +995,7 @@ static DecodeStatus DecodeCCRRegisterClass(MCInst &Inst, unsigned RegNo,
const MCDisassembler *Decoder) {
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::CCRRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::CCRRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -1005,7 +1005,7 @@ static DecodeStatus DecodeFCCRegisterClass(MCInst &Inst, unsigned RegNo,
const MCDisassembler *Decoder) {
if (RegNo > 7)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::FCCRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::FCCRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -1016,7 +1016,7 @@ static DecodeStatus DecodeFGRCCRegisterClass(MCInst &Inst, unsigned RegNo,
if (RegNo > 31)
return MCDisassembler::Fail;
- unsigned Reg = getReg(Decoder, Mips::FGRCCRegClassID, RegNo);
+ MCRegister Reg = getReg(Decoder, Mips::FGRCCRegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
return MCDisassembler::Success;
}
@@ -1024,11 +1024,11 @@ static DecodeStatus DecodeFGRCCRegisterClass(MCInst &Inst, unsigned RegNo,
static DecodeStatus DecodeMem(MCInst &Inst, unsigned Insn, uint64_t Address,
const MCDisassembler *Decoder) {
int Offset = SignExtend32<16>(Insn & 0xffff);
- unsigned Reg = fieldFromInstruction(Insn, 16, 5);
- unsigned Base = fieldFromInstruction(Insn, 21, 5);
+ unsigned RegNo = fieldFromInstruction(Insn, 16, 5);
+ unsigned BaseNo = fieldFromInstruction(Insn, 21, 5);
- Reg = getReg(Decoder, Mips::GPR32RegClassID, Reg);
- Base = getReg(Decoder, Mips::GPR32RegClassID, Base);
+ MCRegister Reg = getReg(Decoder, Mips::GPR32RegClassID, RegNo);
+ MCRegister Base = getReg(Decoder, Mips::GPR32RegClassID, BaseNo);
if (Inst.getOpcode() == Mips::SC || Inst.getOpcode() == Mips::SC64 ||
Inst.getOpcode() == Mips::SCD)
@@ -1044,14 +1044,14 @@ static DecodeStatus DecodeMem(MCInst &Inst, unsigned Insn, uint64_t Address,
static DecodeStatus DecodeMemEVA(MCInst &Inst, unsigned Insn, uint64_t Address,
const MCDisassembler *Decoder) {
int Offset = SignExtend32<9>(Insn >> 7);
- unsigned Reg = fieldFromInstruction(Insn, 16, 5);
- unsigned Base = fieldFromInstruction(Insn, 21, 5);
+ unsigned RegNo = fieldFromInstruction(Insn, 16, 5);
+ unsigned BaseNo = fieldFromInstruction(Insn, 21, 5);
- Reg = getReg(Decoder, Mips::GPR32RegClassID, Reg);
- Base = getReg(Decoder, Mips::GPR32RegClassID, Base);
+ MCRegister Reg = getReg(Decoder, Mips::GPR32RegClassID, RegNo);
+ MCRegister Base = getReg(Decoder, Mips::GPR32RegClassID, BaseNo);
- if (Inst.getOpcode() == Mips::SCE)
- Inst.addOperand(MCOperand::createReg(Reg));
+ if (Inst.getOpcode() == Mips::SCE)
+ Inst.addOperand(MCOperand::createReg(Reg));
Inst.addOperand(MCOperand::createReg(Reg));
Inst.addOperand(MCOperand::createReg(Base));
@@ -1064,11 +1064,11 @@ static DecodeStatus DecodeLoadByte15(MCInst &Inst, unsigned Insn,
uint64_t Address,
const MCDisassembler *Decoder) {
int Offset = SignExtend32<16>(Insn & 0xffff);
- unsigned Base = fieldFromInstruction(Insn, 16, 5);
- unsigned Reg = fieldFromInstruction(Insn, 21, 5);
+ unsigned BaseNo = fieldFromInstruction(Insn, 16, 5);
+ unsigned RegNo = fieldFromInstruction(Insn, 21, 5);
- Base = getReg(Decoder, Mips::GPR32RegClassID, Base);
- Reg = getReg(Decoder, Mips::GPR32RegClassID, Reg);
+ MCRegister Base = getReg(Decoder, Mips::GPR32RegClassID, BaseNo);
+ MCRegister Reg = getReg(Decoder, Mips::GPR32RegClassID, RegNo);
Inst.addOperand(MCOperand::createReg(Reg));
Inst.addOperand(MCOperand::createReg(Base));
@@ -1081,9 +1081,9 @@ static DecodeStatus DecodeCacheOp(MCInst &Inst, unsigned Insn, uint64_t Address,
const MCDisassembler *Decoder) {
int Offset = SignExtend32<16>(Insn & 0xffff);
unsigned Hint = fieldFromInstruction(Insn, 16, 5);
- unsigned Base = fieldFromInstruction(Insn, 21, 5);
+ unsigned BaseNo = fieldFromInstruction(Insn, 21, 5);
- Base = getReg(Decoder, Mips::GPR32RegClassID, Base);
+ MCRegister Base = getReg(Decoder, Mips::GPR32RegClassID, BaseNo);
Inst.addOperand(MCOperand::createReg(Base));
Inst.addOperand(MCOperand::createImm(Offset));
@@ -1096,10 +1096,10 @@ static DecodeStatus DecodeCacheOpMM...
[truncated]
|
s-barannikov
approved these changes
Nov 12, 2025
Contributor
s-barannikov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
git-crd
pushed a commit
to git-crd/crd-llvm-project
that referenced
this pull request
Nov 13, 2025
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.