[all-commits] [llvm/llvm-project] 989d2b: [mlir][tablegen] Generate default attr values in P...

Matthias Springer via All-commits all-commits at lists.llvm.org
Wed Jun 15 07:43:08 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 989d2b518638616e3777d2c7fd3cca1481940937
      https://github.com/llvm/llvm-project/commit/989d2b518638616e3777d2c7fd3cca1481940937
  Author: Matthias Springer <springerm at google.com>
  Date:   2022-06-15 (Wed, 15 Jun 2022)

  Changed paths:
    M mlir/test/mlir-tblgen/op-python-bindings.td
    M mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp

  Log Message:
  -----------
  [mlir][tablegen] Generate default attr values in Python bindings

When specifying an op attribute with a default value (via DefaultValuedAttr), the default value is a string of C++ code. In the general case, the default value of such an attribute cannot be translated to Python when generating the bindings. However, we can hard-code default Python values for frequently-used C++ default values.

This change adds a Python default value for empty ArrayAttrs.

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




More information about the All-commits mailing list