[all-commits] [llvm/llvm-project] 802bf0: [mlir] Allows to query traits from types and attri...

Fehr Mathieu via All-commits all-commits at lists.llvm.org
Sun Sep 12 23:29:53 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 802bf02a738e091d5bf22c03e83204a38d2c7950
      https://github.com/llvm/llvm-project/commit/802bf02a738e091d5bf22c03e83204a38d2c7950
  Author: Mathieu Fehr <mathieu.fehr at gmail.com>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M mlir/include/mlir/IR/AttributeSupport.h
    M mlir/include/mlir/IR/Attributes.h
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/IR/StorageUniquerSupport.h
    M mlir/include/mlir/IR/TypeSupport.h
    M mlir/include/mlir/IR/Types.h
    M mlir/test/IR/traits.mlir
    M mlir/test/lib/Dialect/Test/TestAttrDefs.td
    M mlir/test/lib/Dialect/Test/TestAttributes.h
    M mlir/test/lib/Dialect/Test/TestOps.td
    A mlir/test/lib/Dialect/Test/TestTraits.h
    M mlir/test/lib/Dialect/Test/TestTypeDefs.td
    M mlir/test/lib/Dialect/Test/TestTypes.h

  Log Message:
  -----------
  [mlir] Allows to query traits from types and attributes

Types and attributes now have a `hasTrait` function that allow users to check
if a type defines a trait.
Also, AbstractType and AbstractAttribute has now a `hasTraitFn` field to carry
the implementation of the `hasTrait` function of the concrete type or attribute.
This patch also adds the remaining functions to access type and attribute traits
in TableGen.

Reviewed By: rriddle

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




More information about the All-commits mailing list