[MLIR] Fix block label parsing bug
authorUday Bondhugula <uday@polymagelabs.com>
Sat, 12 Mar 2022 02:08:10 +0000 (07:38 +0530)
committerUday Bondhugula <uday@polymagelabs.com>
Sat, 12 Mar 2022 15:02:41 +0000 (20:32 +0530)
commitaea31f62d44adf9d6e51d2ee323692b6efadcede
treed5d87d39f3da0e938a947c0b7b1821d17b0bab88
parent5ac257da3559f6bd716330da512735ac07364802
[MLIR] Fix block label parsing bug

Fix bug in `Block` label parsing:
https://github.com/llvm/llvm-project/issues/54343

The `parseOptionalBlockArgList` method was doing the wrong thing
(contrary to its doc comment) and its calling context was also
incorrect. This led to a parse failure for something like "^bb0()".

Fixes #54343

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