HomePhabricator

[mlir][CAPI][Python] Plumb OpPrintingFlags to C and Python APIs.

Authored by stellaraccident on Oct 20 2020, 11:20 PM.

Description

[mlir][CAPI][Python] Plumb OpPrintingFlags to C and Python APIs.

  • Adds a new MlirOpPrintingFlags type and supporting accessors.
  • Adds a new mlirOperationPrintWithFlags function.
  • Adds a full featured python Operation.print method with all options and the ability to print directly to files/stdout in text or binary.
  • Adds an Operation.get_asm which delegates to print and returns a str or bytes.
  • Reworks Operation.str to be based on get_asm.

Differential Revision: https://reviews.llvm.org/D89848