From ae69f703d59410fc96f04be3c1afeaa1c17a45ce Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Thu, 19 Jan 2012 02:47:30 +0000 Subject: ARM assembly diagnostic caret in better position for FPImm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148459 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 29a02f6..c8e733d 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -4277,6 +4277,7 @@ parseFPImm(SmallVectorImpl &Operands) { Parser.Lex(); } const AsmToken &Tok = Parser.getTok(); + SMLoc Loc = Tok.getLoc(); if (Tok.is(AsmToken::Real)) { APFloat RealVal(APFloat::IEEEdouble, Tok.getString()); uint64_t IntVal = RealVal.bitcastToAPInt().getZExtValue(); @@ -4285,7 +4286,7 @@ parseFPImm(SmallVectorImpl &Operands) { int Val = ARM_AM::getFP64Imm(APInt(64, IntVal)); Parser.Lex(); // Eat the token. if (Val == -1) { - TokError("floating point value out of range"); + Error(Loc, "floating point value out of range"); return MatchOperand_ParseFail; } Operands.push_back(ARMOperand::CreateFPImm(Val, S, getContext())); @@ -4295,14 +4296,14 @@ parseFPImm(SmallVectorImpl &Operands) { int64_t Val = Tok.getIntVal(); Parser.Lex(); // Eat the token. if (Val > 255 || Val < 0) { - TokError("encoded floating point value out of range"); + Error(Loc, "encoded floating point value out of range"); return MatchOperand_ParseFail; } Operands.push_back(ARMOperand::CreateFPImm(Val, S, getContext())); return MatchOperand_Success; } - TokError("invalid floating point immediate"); + Error(Loc, "invalid floating point immediate"); return MatchOperand_ParseFail; } /// Parse a arm instruction operand. For now this parses the operand regardless -- cgit v1.1