[mlir] Add support for defining Traits and Interfaces on Attributes/Types.
authorRiver Riddle <riddleriver@gmail.com>
Tue, 30 Jun 2020 22:42:39 +0000 (15:42 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 30 Jun 2020 22:52:32 +0000 (15:52 -0700)
commit9fbb2de8e475cbb4ffa71280eb2ddc4922af05f6
tree40bacc7b9260f1cf87d4fa6a5a1259acae937651
parentffa63dde8e97a34b8914a151556551f74d4227e7
[mlir] Add support for defining Traits and Interfaces on Attributes/Types.

This revisions add mechanisms to Attribute/Type for attaching traits and interfaces. The mechanisms are modeled 1-1 after those for operations to keep the system consistent. AttrBase and TypeBase now accepts a trailing list of `Trait` types that will be attached to the object. These traits should inherit from AttributeTrait::TraitBase and TypeTrait::TraitBase respectively as necessary. A followup commit will refactor the interface gen mechanisms in ODS to support Attribute/Type interface generation and add tests for the mechanisms.

Differential Revision: https://reviews.llvm.org/D81883
mlir/include/mlir/IR/AttributeSupport.h
mlir/include/mlir/IR/Attributes.h
mlir/include/mlir/IR/Dialect.h
mlir/include/mlir/IR/StorageUniquerSupport.h
mlir/include/mlir/IR/TypeSupport.h
mlir/include/mlir/IR/Types.h
mlir/lib/IR/Attributes.cpp
mlir/lib/IR/MLIRContext.cpp
mlir/lib/IR/Types.cpp