From ebe817f98cbf836fc5f0abf70b7b04356026ca70 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Tue, 27 Jul 2021 01:37:35 +0000 Subject: [PATCH] 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. --- mlir/include/mlir/Dialect/Affine/IR/AffineOps.h | 3 ++- mlir/include/mlir/Dialect/Affine/IR/AffineOps.td | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h index a7c399cb0fbe..d68e0aefc580 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 *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 b5f96b3b49ff..67754f1cc3eb 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; }