[PATCH] D79088: [MLIR] Add isa<> support for Dialects.

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 02:25:46 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG70619fa82ddb: [MLIR] Add isa<> support for Dialects. (authored by Tres Popp <tpopp at google.com>).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79088/new/

https://reviews.llvm.org/D79088

Files:
  mlir/include/mlir/IR/Dialect.h


Index: mlir/include/mlir/IR/Dialect.h
===================================================================
--- mlir/include/mlir/IR/Dialect.h
+++ mlir/include/mlir/IR/Dialect.h
@@ -281,4 +281,14 @@
 
 } // namespace mlir
 
+namespace llvm {
+/// Provide isa functionality for Dialects.
+template <typename T>
+struct isa_impl<T, ::mlir::Dialect> {
+  static inline bool doit(const ::mlir::Dialect &dialect) {
+    return T::getDialectNamespace() == dialect.getNamespace();
+  }
+};
+} // namespace llvm
+
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79088.261158.patch
Type: text/x-patch
Size: 512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200430/edb0597f/attachment.bin>


More information about the llvm-commits mailing list