[mlir] expose affine map to C API
authorzhanghb97 <zhanghb97@126.com>
Mon, 14 Sep 2020 14:52:22 +0000 (22:52 +0800)
committerzhanghb97 <zhanghb97@126.com>
Thu, 17 Sep 2020 01:50:45 +0000 (09:50 +0800)
commitb76f523be6ea606d9cf494e247546cec1cd7f209
tree1a2ed160d1574fc5ac29cdae91d43f9fbe5fc891
parentb04c1a9d3127730c05e8a22a0e931a12a39528df
[mlir] expose affine map to C API

This patch provides C API for MLIR affine map.
- Implement C API for AffineMap class.
- Add Utils.h to include/mlir/CAPI/, and move the definition of the CallbackOstream to Utils.h to make sure mlirAffineMapPrint work correct.
- Add TODO for exposing the C API related to AffineExpr and mutable affine map.

Differential Revision: https://reviews.llvm.org/D87617
mlir/include/mlir-c/AffineMap.h
mlir/include/mlir/CAPI/Utils.h [new file with mode: 0644]
mlir/lib/CAPI/IR/AffineMap.cpp
mlir/lib/CAPI/IR/IR.cpp
mlir/test/CAPI/ir.c