Files
clang-p2996/mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp
Ivan Butygin 1079fc4f54 [mlir][pass] Add errorHandler param to Pass::initializeOptions (#87289)
There is no good way to report detailed errors from inside
`Pass::initializeOptions` function as context may not be available at
this point and writing directly to `llvm::errs()` is not composable.

See
https://github.com/llvm/llvm-project/pull/87166#discussion_r1546426763

* Add error handler callback to `Pass::initializeOptions`
* Update `PassOptions::parseFromString` to support custom error stream
instead of using `llvm::errs()` directly.
* Update default `Pass::initializeOptions` implementation to propagate
error string from `parseFromString` to new error handler.
* Update `MapMemRefStorageClassPass` to report error details using new
API.
2024-04-02 02:43:04 +03:00

12 KiB