From 097035f308d1cdc00d71d3d216564fddffda0be7 Mon Sep 17 00:00:00 2001 From: Weining Lu Date: Fri, 11 Mar 2022 11:51:26 +0800 Subject: [PATCH] [LoongArch] Use getLoc() directly to construct error message --- llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp b/llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp index 5f9eae2..66a949e 100644 --- a/llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp +++ b/llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp @@ -259,7 +259,7 @@ static bool matchRegisterNameHelper(MCRegister &RegNo, StringRef Name) { bool LoongArchAsmParser::ParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc) { - return Error(getParser().getTok().getLoc(), "invalid register number"); + return Error(getLoc(), "invalid register number"); } OperandMatchResultTy LoongArchAsmParser::tryParseRegister(unsigned &RegNo, -- 2.7.4