[llvm] 097035f - [LoongArch] Use getLoc() directly to construct error message

Weining Lu via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 20:04:51 PST 2022


Author: Weining Lu
Date: 2022-03-11T11:55:35+08:00
New Revision: 097035f308d1cdc00d71d3d216564fddffda0be7

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

LOG: [LoongArch] Use getLoc() directly to construct error message

Added: 
    

Modified: 
    llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp b/llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp
index 5f9eae2ff589e..66a949eda44cb 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,


        


More information about the llvm-commits mailing list