This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Expose printing functions in C API
ClosedPublic

Authored by ftynse on Aug 11 2020, 9:26 AM.

Details

Summary

Provide printing functions for most IR objects in C API (except Region that
does not have a print function, and Module that is expected to be printed as
Operation instead). The printing is based on a callback that is called with
chunks of the string representation and forwarded user-defined data.

Diff Detail

Event Timeline

ftynse created this revision.Aug 11 2020, 9:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2020, 9:26 AM
ftynse requested review of this revision.Aug 11 2020, 9:26 AM
mehdi_amini accepted this revision.Aug 11 2020, 1:47 PM
mehdi_amini added inline comments.
mlir/include/mlir-c/IR.h
79

forwarded

This revision is now accepted and ready to land.Aug 11 2020, 1:47 PM
mehdi_amini added inline comments.Aug 11 2020, 1:49 PM
mlir/include/mlir-c/IR.h
224

Actually the description could be more explicit on the fact that the callback may be called multiple times.

Jing accepted this revision.Aug 11 2020, 2:55 PM
stellaraccident accepted this revision.Aug 11 2020, 6:52 PM
ftynse updated this revision to Diff 285016.Aug 12 2020, 2:15 AM
ftynse marked an inline comment as done.

Address review.

ftynse updated this revision to Diff 285017.Aug 12 2020, 2:16 AM

Drop mis-merged include.

ftynse marked an inline comment as done.Aug 12 2020, 2:17 AM
This revision was automatically updated to reflect the committed changes.