[all-commits] [llvm/llvm-project] 1079fc: [mlir][pass] Add `errorHandler` param to `Pass::in...

Ivan Butygin via All-commits all-commits at lists.llvm.org
Mon Apr 1 16:43:27 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1079fc4f543c42bb09a33d2d79d90edd9c0bac91
      https://github.com/llvm/llvm-project/commit/1079fc4f543c42bb09a33d2d79d90edd9c0bac91
  Author: Ivan Butygin <ivan.butygin at gmail.com>
  Date:   2024-04-02 (Tue, 02 Apr 2024)

  Changed paths:
    M mlir/include/mlir/Pass/Pass.h
    M mlir/include/mlir/Pass/PassOptions.h
    M mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp
    M mlir/lib/Pass/Pass.cpp
    M mlir/lib/Pass/PassRegistry.cpp
    M mlir/lib/Transforms/InlinerPass.cpp
    M mlir/test/Dialect/Transform/test-pass-application.mlir

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list