[all-commits] [llvm/llvm-project] bb6732: [MC] Add parseEOL() overload and migrate some pars...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Mar 6 17:45:38 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bb6732cf622522f17dad948279ba4f68e3bd55e1
      https://github.com/llvm/llvm-project/commit/bb6732cf622522f17dad948279ba4f68e3bd55e1
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M llvm/include/llvm/MC/MCParser/MCAsmParser.h
    M llvm/lib/MC/MCParser/AsmParser.cpp
    M llvm/lib/MC/MCParser/MCAsmParser.cpp
    M llvm/test/MC/ARM/directive_parsing.s
    M llvm/test/MC/ARM/thumb_set-diagnostics.s
    M llvm/test/MC/AsmParser/AArch64/directive-parse-err.s
    M llvm/test/MC/AsmParser/directive_incbin.s
    M llvm/test/MC/AsmParser/if-diagnostics.s
    M llvm/test/MC/ELF/cfi.s

  Log Message:
  -----------
  [MC] Add parseEOL() overload and migrate some parseToken(AsmToken::EndOfStatement) to parseEOL()

For many directives, the following diagnostics

* `error: unexpected token`
* `error: unexpected token in '.abort' directive"`

are replaced with `error: expected newline`.

`unexpected token` may make the user think a different token is needed.
`expected newline` is clearer about the expected token.

For `in '...' directive`, the directive name is not useful because the next line
replicates the error line which includes the directive.




More information about the All-commits mailing list