[all-commits] [llvm/llvm-project] 4acd84: [mlir] Improve debug flag management in Python bin...

ftynse via All-commits all-commits at lists.llvm.org
Mon Apr 19 05:46:03 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4acd8457d8737e47db022076c6f8bd48171f4f49
      https://github.com/llvm/llvm-project/commit/4acd8457d8737e47db022076c6f8bd48171f4f49
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    A mlir/include/mlir-c/Debug.h
    M mlir/include/mlir-c/IR.h
    M mlir/lib/Bindings/Python/IRCore.cpp
    M mlir/lib/Bindings/Python/mlir/ir.py
    M mlir/lib/CAPI/CMakeLists.txt
    A mlir/lib/CAPI/Debug/CMakeLists.txt
    A mlir/lib/CAPI/Debug/Debug.cpp
    M mlir/lib/CAPI/IR/IR.cpp
    M mlir/test/Bindings/Python/context_managers.py
    A mlir/test/Bindings/Python/debug.py

  Log Message:
  -----------
  [mlir] Improve debug flag management in Python bindings

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.

Reviewed By: nicolasvasilache

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




More information about the All-commits mailing list