Add the getDialectNamespace static utility method to the Linalg dialect.
authorMLIR Team <no-reply@google.com>
Thu, 6 Jun 2019 23:42:36 +0000 (16:42 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Sun, 9 Jun 2019 23:22:16 +0000 (16:22 -0700)
PiperOrigin-RevId: 251953766

mlir/include/mlir/Linalg/IR/LinalgTypes.h
mlir/lib/Linalg/IR/LinalgTypes.cpp

index eaf391c..30930f3 100644 (file)
@@ -35,6 +35,7 @@ enum LinalgTypes {
 class LinalgDialect : public Dialect {
 public:
   explicit LinalgDialect(MLIRContext *context);
+  static StringRef getDialectNamespace() { return "linalg"; }
 
   /// Parse a type registered to this dialect.
   Type parseType(llvm::StringRef spec, Location loc) const override;
index 453463b..4c8d87b 100644 (file)
@@ -29,7 +29,7 @@ using namespace mlir;
 using namespace mlir::linalg;
 
 mlir::linalg::LinalgDialect::LinalgDialect(MLIRContext *context)
-    : Dialect("linalg", context) {
+    : Dialect(getDialectNamespace(), context) {
   addTypes<BufferType, RangeType, ViewType>();
   addOperations<BufferAllocOp, BufferDeallocOp, ForOp, LoadOp, RangeOp, StoreOp,
                 SliceOp, ViewOp>();