[mlir] expose standard attributes to C API
authorAlex Zinenko <zinenko@google.com>
Wed, 19 Aug 2020 16:38:56 +0000 (18:38 +0200)
committerAlex Zinenko <zinenko@google.com>
Wed, 19 Aug 2020 16:50:19 +0000 (18:50 +0200)
commitda562974628017ae92c451ca064fea5b59ad71a4
treee76a7d1cb499a2eb6d7de745fa6bd302133701ef
parent0f95e73190c9a555c2917a2963eab128c4ba5395
[mlir] expose standard attributes to C API

Provide C API for MLIR standard attributes. Since standard attributes live
under lib/IR in core MLIR, place the C APIs in the IR library as well (standard
ops will go in a separate library).

Affine map and integer set attributes are only exposed as placeholder types
with IsA support due to the lack of C APIs for the corresponding types.

Integer and floating point attribute APIs expecting APInt and APFloat are not
exposed pending decision on how to support APInt and APFloat.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D86143
mlir/docs/CAPI.md
mlir/include/mlir-c/IR.h
mlir/include/mlir-c/StandardAttributes.h [new file with mode: 0644]
mlir/lib/Bindings/Python/IRModules.cpp
mlir/lib/CAPI/IR/CMakeLists.txt
mlir/lib/CAPI/IR/IR.cpp
mlir/lib/CAPI/IR/StandardAttributes.cpp [new file with mode: 0644]
mlir/test/CAPI/ir.c