[Mlir-commits] [mlir] 485cf19 - Define SDBM key methods in its own cpp file.

Stella Laurenzo llvmlistbot at llvm.org
Fri Apr 24 19:09:56 PDT 2020


Author: Stella Laurenzo
Date: 2020-04-24T19:05:55-07:00
New Revision: 485cf19651a5710159493e678835ba02a3fc21cb

URL: https://github.com/llvm/llvm-project/commit/485cf19651a5710159493e678835ba02a3fc21cb
DIFF: https://github.com/llvm/llvm-project/commit/485cf19651a5710159493e678835ba02a3fc21cb.diff

LOG: Define SDBM key methods in its own cpp file.

Summary:
* Follows the convention of the tablegen-generated dialects.
* Ensures that vague linkage rules place the definitions in the dialect's object files.
* Allows code that uses RTTI to include MLIR headers (compiled without RTTI) without
  type_info link errors.

Reviewers: rriddle

Reviewed By: rriddle

Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits

Tags: #llvm

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

Added: 
    mlir/lib/Dialect/SDBM/SDBMDialect.cpp

Modified: 
    mlir/include/mlir/Dialect/SDBM/SDBMDialect.h
    mlir/lib/Dialect/SDBM/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/SDBM/SDBMDialect.h b/mlir/include/mlir/Dialect/SDBM/SDBMDialect.h
index 60f26929d11c..0993b438a967 100644
--- a/mlir/include/mlir/Dialect/SDBM/SDBMDialect.h
+++ b/mlir/include/mlir/Dialect/SDBM/SDBMDialect.h
@@ -19,6 +19,11 @@ class SDBMDialect : public Dialect {
 public:
   SDBMDialect(MLIRContext *context) : Dialect(getDialectNamespace(), context) {}
 
+  /// Since there are no other virtual methods in this derived class, override
+  /// the destructor so that key methods get defined in the corresponding
+  /// module.
+  ~SDBMDialect() override;
+
   static StringRef getDialectNamespace() { return "sdbm"; }
 
   /// Get the uniquer for SDBM expressions. This should not be used directly.

diff  --git a/mlir/lib/Dialect/SDBM/CMakeLists.txt b/mlir/lib/Dialect/SDBM/CMakeLists.txt
index 64d58c666e63..6f5a119408cf 100644
--- a/mlir/lib/Dialect/SDBM/CMakeLists.txt
+++ b/mlir/lib/Dialect/SDBM/CMakeLists.txt
@@ -1,5 +1,6 @@
 add_mlir_dialect_library(MLIRSDBM
   SDBM.cpp
+  SDBMDialect.cpp
   SDBMExpr.cpp
 
   ADDITIONAL_HEADER_DIRS

diff  --git a/mlir/lib/Dialect/SDBM/SDBMDialect.cpp b/mlir/lib/Dialect/SDBM/SDBMDialect.cpp
new file mode 100644
index 000000000000..6306063181b3
--- /dev/null
+++ b/mlir/lib/Dialect/SDBM/SDBMDialect.cpp
@@ -0,0 +1,13 @@
+//===- SDBMDialect.cpp - MLIR SDBM Dialect --------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/SDBM/SDBMDialect.h"
+
+using namespace mlir;
+
+SDBMDialect::~SDBMDialect() = default;


        


More information about the Mlir-commits mailing list