[all-commits] [llvm/llvm-project] 58e7bf: [mlir] Add isa/dyn_cast support for dialect interf...

River Riddle via All-commits all-commits at lists.llvm.org
Mon Jan 31 19:25:02 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 58e7bf78a3ef724b70304912fb3bb66af8c4a10c
      https://github.com/llvm/llvm-project/commit/58e7bf78a3ef724b70304912fb3bb66af8c4a10c
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-01-31 (Mon, 31 Jan 2022)

  Changed paths:
    M mlir/docs/Interfaces.md
    M mlir/include/mlir/IR/Dialect.h
    M mlir/lib/Dialect/DLTI/DLTI.cpp
    M mlir/lib/IR/BuiltinAttributes.cpp
    M mlir/lib/IR/Operation.cpp
    M mlir/lib/Interfaces/DataLayoutInterfaces.cpp
    M mlir/unittests/IR/DialectTest.cpp

  Log Message:
  -----------
  [mlir] Add isa/dyn_cast support for dialect interfaces

This matches the same API usage as attributes/ops/types. For example:

```c++
Dialect *dialect = ...;

// Instead of this:
if (auto *interface = dialect->getRegisteredInterface<DialectInlinerInterface>())

// You can do this:
if (auto *interface = dyn_cast<DialectInlinerInterface>(dialect))
```

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




More information about the All-commits mailing list