[llvm] 86690ce - [RISCV] Remove unnecessary calls MCRegister::id(). NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 26 12:21:46 PDT 2025


Author: Craig Topper
Date: 2025-03-26T12:21:41-07:00
New Revision: 86690ce3b79e7f54a6e617a162de6ff5a350e717

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

LOG: [RISCV] Remove unnecessary calls MCRegister::id(). NFC

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
index 0d40fb5614009..b43e323834044 100644
--- a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+++ b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
@@ -1286,7 +1286,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
   static std::unique_ptr<RISCVOperand>
   createReg(MCRegister Reg, SMLoc S, SMLoc E, bool IsGPRAsFPR = false) {
     auto Op = std::make_unique<RISCVOperand>(KindTy::Register);
-    Op->Reg.RegNum = Reg.id();
+    Op->Reg.RegNum = Reg;
     Op->Reg.IsGPRAsFPR = IsGPRAsFPR;
     Op->StartLoc = S;
     Op->EndLoc = E;
@@ -1358,8 +1358,8 @@ struct RISCVOperand final : public MCParsedAsmOperand {
   static std::unique_ptr<RISCVOperand> createRegReg(MCRegister Reg1,
                                                     MCRegister Reg2, SMLoc S) {
     auto Op = std::make_unique<RISCVOperand>(KindTy::RegReg);
-    Op->RegReg.Reg1 = Reg1.id();
-    Op->RegReg.Reg2 = Reg2.id();
+    Op->RegReg.Reg1 = Reg1;
+    Op->RegReg.Reg2 = Reg2;
     Op->StartLoc = S;
     Op->EndLoc = S;
     return Op;


        


More information about the llvm-commits mailing list