[Mlir-commits] [mlir] 1dac073 - Fix MLIR standalone example to properly handle namespace

Mehdi Amini llvmlistbot at llvm.org
Mon Sep 14 14:03:56 PDT 2020


Author: Mehdi Amini
Date: 2020-09-14T21:03:47Z
New Revision: 1dac073bdd95799ae2f3a40ba2073c34fd037f1b

URL: https://github.com/llvm/llvm-project/commit/1dac073bdd95799ae2f3a40ba2073c34fd037f1b
DIFF: https://github.com/llvm/llvm-project/commit/1dac073bdd95799ae2f3a40ba2073c34fd037f1b.diff

LOG: Fix MLIR standalone example to properly handle namespace

ODS TableGen backend now requires to spell out which namespace they have
to be nested in, in an absolute way.

Added: 
    

Modified: 
    mlir/examples/standalone/include/Standalone/StandaloneDialect.h
    mlir/examples/standalone/include/Standalone/StandaloneDialect.td
    mlir/examples/standalone/include/Standalone/StandaloneOps.h
    mlir/examples/standalone/lib/Standalone/StandaloneOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/examples/standalone/include/Standalone/StandaloneDialect.h b/mlir/examples/standalone/include/Standalone/StandaloneDialect.h
index ac1ac86a178e..d3eb24cc308d 100644
--- a/mlir/examples/standalone/include/Standalone/StandaloneDialect.h
+++ b/mlir/examples/standalone/include/Standalone/StandaloneDialect.h
@@ -11,12 +11,6 @@
 
 #include "mlir/IR/Dialect.h"
 
-namespace mlir {
-namespace standalone {
-
 #include "Standalone/StandaloneOpsDialect.h.inc"
 
-} // namespace standalone
-} // namespace mlir
-
 #endif // STANDALONE_STANDALONEDIALECT_H

diff  --git a/mlir/examples/standalone/include/Standalone/StandaloneDialect.td b/mlir/examples/standalone/include/Standalone/StandaloneDialect.td
index 403a83a712b1..a7fd789376e2 100644
--- a/mlir/examples/standalone/include/Standalone/StandaloneDialect.td
+++ b/mlir/examples/standalone/include/Standalone/StandaloneDialect.td
@@ -23,7 +23,7 @@ def Standalone_Dialect : Dialect {
         illustrate the basic setup required to develop MLIR-based tools without
         working inside of the LLVM source tree.
     }];
-    let cppNamespace = "standalone";
+    let cppNamespace = "::mlir::standalone";
 }
 
 //===----------------------------------------------------------------------===//

diff  --git a/mlir/examples/standalone/include/Standalone/StandaloneOps.h b/mlir/examples/standalone/include/Standalone/StandaloneOps.h
index 18b02aff856d..5a8c5d1040e6 100644
--- a/mlir/examples/standalone/include/Standalone/StandaloneOps.h
+++ b/mlir/examples/standalone/include/Standalone/StandaloneOps.h
@@ -13,13 +13,7 @@
 #include "mlir/IR/OpDefinition.h"
 #include "mlir/Interfaces/SideEffectInterfaces.h"
 
-namespace mlir {
-namespace standalone {
-
 #define GET_OP_CLASSES
 #include "Standalone/StandaloneOps.h.inc"
 
-} // namespace standalone
-} // namespace mlir
-
 #endif // STANDALONE_STANDALONEOPS_H

diff  --git a/mlir/examples/standalone/lib/Standalone/StandaloneOps.cpp b/mlir/examples/standalone/lib/Standalone/StandaloneOps.cpp
index f15bf02b36af..497eb98705d8 100644
--- a/mlir/examples/standalone/lib/Standalone/StandaloneOps.cpp
+++ b/mlir/examples/standalone/lib/Standalone/StandaloneOps.cpp
@@ -10,9 +10,5 @@
 #include "Standalone/StandaloneDialect.h"
 #include "mlir/IR/OpImplementation.h"
 
-namespace mlir {
-namespace standalone {
 #define GET_OP_CLASSES
 #include "Standalone/StandaloneOps.cpp.inc"
-} // namespace standalone
-} // namespace mlir


        


More information about the Mlir-commits mailing list