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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/docs/Diagnostics.md | ||
---|---|---|
306 | Any reason to not follow filecheck? E.g., re is default and these are special tokens and you have literal matches with special tags. Is this due to outer delimiters being {{? |
mlir/docs/Diagnostics.md | ||
---|---|---|
306 | My thoughts there were: a) This follows the same precedent as clang/other tools Seemed better to follow the standard set by clang/other tools in llvm for the expected-* things, and also avoid unnecessary churn. |
Agreed, following clang SGTM
mlir/lib/IR/Diagnostics.cpp | ||
---|---|---|
612 | Nit: prefer positive conditional | |
625 | Do you want to allow escaping too? E.g., if string has literal {{ and actual regex's ? (I see clang's VerifyDiagnosticConsumer doesn't either, and can be worked around with same trick as we do FileCheck side) |
mlir/lib/IR/Diagnostics.cpp | ||
---|---|---|
625 | We could, but I can't find any places right now where we would use it. I think if it becomes common enough, we could add something. It just doesn't look like it pays for itself right now (given that it has a workaround). |
Any reason to not follow filecheck? E.g., re is default and these are special tokens and you have literal matches with special tags. Is this due to outer delimiters being {{?