[AsmParser] Improve error recovery again.
authorChris Lattner <clattner@nondot.org>
Wed, 11 May 2022 07:24:50 +0000 (08:24 +0100)
committerChris Lattner <clattner@nondot.org>
Wed, 11 May 2022 07:25:36 +0000 (08:25 +0100)
commit34b6f206cbab8471abf29739dab981bd8b868a65
tree4e9cd83f004bd24b4a931fbfe0e1c5f800335ae4
parent764a7f48647210f4a360f74f82432ad276d92716
[AsmParser] Improve error recovery again.

Change the parsing logic to use StringRef instead of lower level
char* logic.  Also, if emitting a diagnostic on the first token
in the file, we make sure to use that position instead of the
very start of the file.

Differential Revision: https://reviews.llvm.org/D125353
mlir/lib/Parser/Parser.cpp
mlir/test/IR/invalid.mlir