[llvm] e55164a - [RISCV] Use AsmToken::getEndLoc(). NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 1 14:41:45 PDT 2025


Author: Craig Topper
Date: 2025-04-01T14:41:33-07:00
New Revision: e55164ae1098bbf8ceb87b83a4b282b08bb7bef9

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

LOG: [RISCV] Use AsmToken::getEndLoc(). 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 1e07ada1f9701..8f9a5ae75fca7 100644
--- a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+++ b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
@@ -1659,7 +1659,7 @@ ParseStatus RISCVAsmParser::parseRegister(OperandVector &Operands,
     if (HadParens)
       Operands.push_back(RISCVOperand::createToken("(", FirstS));
     SMLoc S = getLoc();
-    SMLoc E = SMLoc::getFromPointer(S.getPointer() + Name.size());
+    SMLoc E = getTok().getEndLoc();
     getLexer().Lex();
     Operands.push_back(RISCVOperand::createReg(Reg, S, E));
   }
@@ -2272,7 +2272,7 @@ ParseStatus RISCVAsmParser::parseMaskReg(OperandVector &Operands) {
   if (Reg != RISCV::V0)
     return ParseStatus::NoMatch;
   SMLoc S = getLoc();
-  SMLoc E = SMLoc::getFromPointer(S.getPointer() + Name.size());
+  SMLoc E = getTok().getEndLoc();
   getLexer().Lex();
   Operands.push_back(RISCVOperand::createReg(Reg, S, E));
   return ParseStatus::Success;
@@ -2295,7 +2295,7 @@ ParseStatus RISCVAsmParser::parseGPRAsFPR(OperandVector &Operands) {
   if (!Reg)
     return ParseStatus::NoMatch;
   SMLoc S = getLoc();
-  SMLoc E = SMLoc::getFromPointer(S.getPointer() + Name.size());
+  SMLoc E = getTok().getEndLoc();
   getLexer().Lex();
   Operands.push_back(RISCVOperand::createReg(
       Reg, S, E, !getSTI().hasFeature(RISCV::FeatureStdExtF)));
@@ -2328,7 +2328,7 @@ ParseStatus RISCVAsmParser::parseGPRPairAsFPR64(OperandVector &Operands) {
   }
 
   SMLoc S = getLoc();
-  SMLoc E = SMLoc::getFromPointer(S.getPointer() + Name.size());
+  SMLoc E = getTok().getEndLoc();
   getLexer().Lex();
 
   const MCRegisterInfo *RI = getContext().getRegisterInfo();
@@ -2370,7 +2370,7 @@ ParseStatus RISCVAsmParser::parseGPRPair(OperandVector &Operands,
     return TokError("register must be even");
 
   SMLoc S = getLoc();
-  SMLoc E = SMLoc::getFromPointer(S.getPointer() + Name.size());
+  SMLoc E = getTok().getEndLoc();
   getLexer().Lex();
 
   const MCRegisterInfo *RI = getContext().getRegisterInfo();


        


More information about the llvm-commits mailing list