[mlir][CAPI] Include anchor op in mlirParsePassPipeline
authorrkayaith <rkayaith@gmail.com>
Thu, 20 Oct 2022 02:37:12 +0000 (22:37 -0400)
committerrkayaith <rkayaith@gmail.com>
Thu, 3 Nov 2022 15:48:21 +0000 (11:48 -0400)
commit215eba4e1ea240dd9223c14b80da664f0bb930cc
tree62d0f38c3c0a0cee62dfca7ffc5bad706afe0ee3
parentd511a5d47166b024a4ce5e4202bf83400acef05c
[mlir][CAPI] Include anchor op in mlirParsePassPipeline

The pipeline string must now include the pass manager's anchor op. This
makes the parse API properly roundtrip the printed form of a pass
manager. Since this is already an API break, I also added an extra
callback argument which is used for reporting errors.

The old functionality of appending to an existing pass manager is
available through `mlirOpPassManagerAddPipeline`.

Reviewed By: mehdi_amini, ftynse

Differential Revision: https://reviews.llvm.org/D136403
mlir/include/mlir-c/Pass.h
mlir/lib/CAPI/IR/Pass.cpp
mlir/test/CAPI/pass.c