[mlir] Relax restriction on name location parsing
authorJacques Pienaar <jpienaar@google.com>
Sun, 12 Dec 2021 16:06:59 +0000 (08:06 -0800)
committerJacques Pienaar <jpienaar@google.com>
Sun, 12 Dec 2021 16:06:59 +0000 (08:06 -0800)
commitb743ff161b8296f4f85d095582579e290117d823
treedf76fc8fa8f219e8503336140e21fa6b09d16cb4
parentefb7727a96ca8c02cc44ad83eea7c126db191d2b
[mlir] Relax restriction on name location parsing

We currently restrict parsing of location to not allow nameloc being
nested inside nameloc. This restriction may be historical as there
doesn't seem to be a reason for it anymore (locations like this can be
constructed in C++ and they print fine). Relax this restriction in the
parser to allow this nesting.

Differential Revision: https://reviews.llvm.org/D115581
mlir/lib/Parser/LocationParser.cpp
mlir/test/IR/invalid-locations.mlir
mlir/test/IR/locations.mlir