1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Improve ARM assembly parser diagnostic for unexpected tokens.

Consider:
  mov r8, r11 fred

Previously, we issued the not very informative:
x.s:6:1: error: unexpected token in argument list

^

Now we generate:
x.s:5:14: error: unexpected token in argument list
  mov r8, r11 fred
              ^

llvm-svn: 141380
This commit is contained in:
Jim Grosbach 2011-10-07 18:27:04 +00:00
parent ecbddb2b9e
commit d3c2b772ee

View File

@ -3617,8 +3617,9 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc,
}
if (getLexer().isNot(AsmToken::EndOfStatement)) {
SMLoc Loc = getLexer().getLoc();
Parser.EatToEndOfStatement();
return TokError("unexpected token in argument list");
return Error(Loc, "unexpected token in argument list");
}
Parser.Lex(); // Consume the EndOfStatement