[Mlir-commits] [flang] [mlir] [mlir][AsmParser] Fix parseOptionalAttribute consuming loc() as an attribute (PR #180668)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Mar 16 22:56:50 PDT 2026


XiaoleiShi-NV wrote:

@matthias-springer @joker-eph

Implemented the syntax-disambiguation approach discussed above.

The current fix makes `LocationAttr` use `#loc(...)` in attribute position, while trailing op/block-argument locations remain `loc(...)`. That removes the built-in ambiguity between optional attribute parsing and trailing locations without making `LocationAttr` unusable as an attribute value.

I also rewrote the regression coverage using the test dialect and moved it under `mlir/test/IR`:
- `mlir/test/IR/loc-attr-disambiguation.mlir`

In addition, I updated the fallout tests affected by the syntax change, including LLVM import/bytecode tests, LSP tests, Python bindings tests, parser unit tests, and Flang debug-info tests.


https://github.com/llvm/llvm-project/pull/180668


More information about the Mlir-commits mailing list