From a903661289da12a657bf186399fa0eab03541b8b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sun, 26 Jan 2014 22:29:50 +0000 Subject: ARM: improve diagnostics for .word directive If a complex expression was passed to the .word directive and the first part of the directive failed to parse, a secondary diagnostic would be produced that would clutter the error diagnostics. Improve the diagnostics by consuming the remainder of the statement. llvm-svn: 200160 --- llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp') diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 06f2b4ef2ef..4577fdee37e 100644 --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -8093,8 +8093,10 @@ bool ARMAsmParser::parseDirectiveWord(unsigned Size, SMLoc L) { if (getLexer().isNot(AsmToken::EndOfStatement)) { for (;;) { const MCExpr *Value; - if (getParser().parseExpression(Value)) + if (getParser().parseExpression(Value)) { + Parser.eatToEndOfStatement(); return false; + } getParser().getStreamer().EmitValue(Value, Size); -- cgit v1.2.3