Skip to content

Commit e55164a

Browse files
committed
[RISCV] Use AsmToken::getEndLoc(). NFC
1 parent 86e66d2 commit e55164a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ ParseStatus RISCVAsmParser::parseRegister(OperandVector &Operands,
16591659
if (HadParens)
16601660
Operands.push_back(RISCVOperand::createToken("(", FirstS));
16611661
SMLoc S = getLoc();
1662-
SMLoc E = SMLoc::getFromPointer(S.getPointer() + Name.size());
1662+
SMLoc E = getTok().getEndLoc();
16631663
getLexer().Lex();
16641664
Operands.push_back(RISCVOperand::createReg(Reg, S, E));
16651665
}
@@ -2272,7 +2272,7 @@ ParseStatus RISCVAsmParser::parseMaskReg(OperandVector &Operands) {
22722272
if (Reg != RISCV::V0)
22732273
return ParseStatus::NoMatch;
22742274
SMLoc S = getLoc();
2275-
SMLoc E = SMLoc::getFromPointer(S.getPointer() + Name.size());
2275+
SMLoc E = getTok().getEndLoc();
22762276
getLexer().Lex();
22772277
Operands.push_back(RISCVOperand::createReg(Reg, S, E));
22782278
return ParseStatus::Success;
@@ -2295,7 +2295,7 @@ ParseStatus RISCVAsmParser::parseGPRAsFPR(OperandVector &Operands) {
22952295
if (!Reg)
22962296
return ParseStatus::NoMatch;
22972297
SMLoc S = getLoc();
2298-
SMLoc E = SMLoc::getFromPointer(S.getPointer() + Name.size());
2298+
SMLoc E = getTok().getEndLoc();
22992299
getLexer().Lex();
23002300
Operands.push_back(RISCVOperand::createReg(
23012301
Reg, S, E, !getSTI().hasFeature(RISCV::FeatureStdExtF)));
@@ -2328,7 +2328,7 @@ ParseStatus RISCVAsmParser::parseGPRPairAsFPR64(OperandVector &Operands) {
23282328
}
23292329

23302330
SMLoc S = getLoc();
2331-
SMLoc E = SMLoc::getFromPointer(S.getPointer() + Name.size());
2331+
SMLoc E = getTok().getEndLoc();
23322332
getLexer().Lex();
23332333

23342334
const MCRegisterInfo *RI = getContext().getRegisterInfo();
@@ -2370,7 +2370,7 @@ ParseStatus RISCVAsmParser::parseGPRPair(OperandVector &Operands,
23702370
return TokError("register must be even");
23712371

23722372
SMLoc S = getLoc();
2373-
SMLoc E = SMLoc::getFromPointer(S.getPointer() + Name.size());
2373+
SMLoc E = getTok().getEndLoc();
23742374
getLexer().Lex();
23752375

23762376
const MCRegisterInfo *RI = getContext().getRegisterInfo();

0 commit comments

Comments
 (0)