[Mlir-commits] [mlir] ebe817f - Define the namespace for the Affine dialect in ODS (NFC)

Mehdi Amini llvmlistbot at llvm.org
Mon Jul 26 19:20:49 PDT 2021


Author: Mehdi Amini
Date: 2021-07-27T02:20:38Z
New Revision: ebe817f98cbf836fc5f0abf70b7b04356026ca70

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

LOG: Define the namespace for the Affine dialect in ODS (NFC)

This aligns the structure of the Affine dialect on all the other dialects.
In particular this makes the ODS C++ generated code independent of the
enclosing namespace.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
    mlir/include/mlir/Dialect/Affine/IR/AffineOps.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
index a7c399cb0fbeb..d68e0aefc580d 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
@@ -372,12 +372,13 @@ AffineApplyOp makeComposedAffineApply(OpBuilder &b, Location loc, AffineExpr e,
 /// argument.
 void fullyComposeAffineMapAndOperands(AffineMap *map,
                                       SmallVectorImpl<Value> *operands);
-
+} // namespace mlir
 #include "mlir/Dialect/Affine/IR/AffineOpsDialect.h.inc"
 
 #define GET_OP_CLASSES
 #include "mlir/Dialect/Affine/IR/AffineOps.h.inc"
 
+namespace mlir {
 /// Returns true if the provided value is the induction variable of a
 /// AffineForOp.
 bool isForInductionVar(Value val);

diff  --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
index b5f96b3b49ff9..67754f1cc3eb9 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
@@ -21,7 +21,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
 
 def Affine_Dialect : Dialect {
   let name = "affine";
-  let cppNamespace = "";
+  let cppNamespace = "mlir";
   let hasConstantMaterializer = 1;
 }
 


        


More information about the Mlir-commits mailing list