[all-commits] [llvm/llvm-project] 44610c: [MLIR][ODS] default-valued strings should be in qu...

Jeff Niu via All-commits all-commits at lists.llvm.org
Thu Oct 14 20:00:54 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 44610c01aeed8402da982ab59c47f45e7b3bc93b
      https://github.com/llvm/llvm-project/commit/44610c01aeed8402da982ab59c47f45e7b3bc93b
  Author: Mogball <jeffniu22 at gmail.com>
  Date:   2021-10-15 (Fri, 15 Oct 2021)

  Changed paths:
    M mlir/include/mlir/IR/OpBase.td
    M mlir/test/lib/Dialect/Test/TestOps.td
    A mlir/test/mlir-tblgen/constant-str-attr-invalid.mlir
    M mlir/test/mlir-tblgen/op-attribute.td
    M mlir/test/mlir-tblgen/op-format.mlir
    M mlir/test/mlir-tblgen/pattern.mlir
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
    M mlir/tools/mlir-tblgen/RewriterGen.cpp

  Log Message:
  -----------
  [MLIR][ODS] default-valued strings should be in quotes

`DefaultValuedAttr<StrAttr, "">` and `ConstantAttr<StrAttr, "">`
result in bugs in which TableGen will not recognize that the attribute
has a default value, because `""` is an empty TableGen string.

Strings no longer have special treatment. Instead, string values must be
wrapped in quotes: "\"foo\"". Two helpers, `DefaultValuedStrAttr` and
`ConstantStrAttr` have been added to keep code clean.

Reviewed By: rriddle

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




More information about the All-commits mailing list