[mlir] Add support for regex within `expected-*` diagnostics
authorRiver Riddle <riddleriver@gmail.com>
Fri, 8 Jul 2022 02:58:51 +0000 (19:58 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 12 Jul 2022 04:01:30 +0000 (21:01 -0700)
commit7306dc91e091421779b5a28fde8dad6aa73aa56f
tree691c666b791eca7e2304cce60a76429e38e446a5
parent78cd95c0344e3598e926068648f556e3b3729023
[mlir] Add support for regex within `expected-*` diagnostics

This can be enabled by using a `-re` suffix when defining the expected line,
e.g. `expected-error-re`. This support is similar to what clang provides in its "expected"
diagnostic framework(e.g. the `-re` is also the same). The regex definitions themselves are
similar to  FileCheck in that regex blocks are specified within `{{` `}}` blocks.

Differential Revision: https://reviews.llvm.org/D129343
mlir/docs/Diagnostics.md
mlir/lib/IR/Diagnostics.cpp
mlir/test/Dialect/SPIRV/IR/memory-ops.mlir
mlir/test/IR/diagnostic-handler-verify-regex.mlir [new file with mode: 0644]