[Mlir-commits] [mlir] [MLIR] correct return type of parse() functions (PR #120180)

Timothy Hoffman llvmlistbot at llvm.org
Tue Dec 17 08:03:50 PST 2024


tim-hoffman wrote:

Here is an example of code generated by tablegen that will cause a compiler error if the `parseX()` function returns `LogicalResult`:
```
    auto odsResult = parseInferredArrayType(parser, elementsTypes, elementsOperands, resultRawTypes[0]);
    if (odsResult) return ::mlir::failure();
```
See also `parsePrettyLLVMType()` in LLVMTypes.h, `parseSingleBlockRegion()` in IRDL.cpp, `parseDynamicIndexList()` in ViewLikeInterface.cpp, etc.

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


More information about the Mlir-commits mailing list