[all-commits] [llvm/llvm-project] d14cfe: [mlir][OpFormatGen] Update "custom" directives for...

mikeurbach via All-commits all-commits at lists.llvm.org
Wed Sep 23 11:34:00 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d14cfe10341681d18edf05ac98da2c5241b0864e
      https://github.com/llvm/llvm-project/commit/d14cfe10341681d18edf05ac98da2c5241b0864e
  Author: Mike Urbach <mikeurbach at gmail.com>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/mlir-tblgen/op-format.mlir
    M mlir/tools/mlir-tblgen/OpFormatGen.cpp

  Log Message:
  -----------
  [mlir][OpFormatGen] Update "custom" directives for attributes.

This tweaks the generated code for parsing attributes with a custom
directive to call `addAttribute` on the `OperationState` directly,
and adds a newline after this call. Previously, the generated code
would call `addAttribute` on the `OperationState` field `attributes`,
which has no such method and fails to compile. Furthermore, the lack
of newline would generate code with incorrectly formatted single line
`if` statements. Added tests for parsing and printing attributes with
a custom directive.

Reviewed By: mehdi_amini

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




More information about the All-commits mailing list