This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Improve debug flag management in Python bindings
ClosedPublic

Authored by ftynse on Apr 19 2021, 5:30 AM.

Details

Summary

Expose the debug flag as a readable and assignable property of a
dedicated class instead of a write-only function. Actually test the fact
of setting the flag. Move test to a dedicated file, it has zero relation
to context_managers.py where it was added.

Arguably, it should be promoted from mlir.ir to mlir module, but we are
not re-exporting the latter and this functionality is purposefully
hidden so can stay in IR for now. Drop unnecessary export code.

Refactor C API and put Debug into a separate library, fix it to actually
set the flag to the given value.

Diff Detail

Event Timeline

ftynse created this revision.Apr 19 2021, 5:30 AM
ftynse requested review of this revision.Apr 19 2021, 5:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2021, 5:30 AM
ftynse added inline comments.Apr 19 2021, 5:31 AM
mlir/lib/Bindings/Python/mlir/ir.py
11

@nicolasvasilache, nope it was not necessary.

nicolasvasilache accepted this revision.Apr 19 2021, 5:39 AM

Cool ,thanks!

This revision is now accepted and ready to land.Apr 19 2021, 5:39 AM
This revision was landed with ongoing or failed builds.Apr 19 2021, 5:45 AM
This revision was automatically updated to reflect the committed changes.