[Mlir-commits] [mlir] 7bc15d8 - [mlir][Tosa] Include generated interface declarations outside of namespaces (#236103)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Oct 29 08:08:02 PDT 2026


Author: Markus Böck
Date: 2026-10-29T16:07:56+01:00
New Revision: 7bc15d836d752d40400905477796883279e8cf4b

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

LOG: [mlir][Tosa] Include generated interface declarations outside of namespaces (#236103)

`TosaInterfaces.h.inc` was included from within `namespace mlir::tosa`,
relying on the interfaces in `TosaInterfaces.td` having an empty
`cppNamespace`. The interfaces now specify `cppNamespace =
"::mlir::tosa"` and the generated header is included at global scope.

---------

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Tosa/IR/TosaInterfaces.td
    mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaInterfaces.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaInterfaces.td
index 5dfa1e681161d9..4078aae1f917a1 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaInterfaces.td
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaInterfaces.td
@@ -19,6 +19,7 @@ def TosaOpInterface : OpInterface<"TosaOp"> {
   let description = [{
     Implemented by ops that correspond to the Tosa specification.
   }];
+  let cppNamespace = "::mlir::tosa";
 }
 
 #endif

diff  --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h
index db16c74e659cc0..2bd15005c236a5 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.h
@@ -48,11 +48,12 @@ void printVariableOpTypeOrInitialValue(OpAsmPrinter &p, Operation *op,
                                        DenseElementsAttr varShapeAttr,
                                        TypeAttr typeAttr,
                                        Attribute initialValueAttr);
+} // namespace tosa
+} // namespace mlir
 
 #include "mlir/Dialect/Tosa/IR/TosaInterfaces.h.inc"
 
-} // namespace tosa
-
+namespace mlir {
 namespace OpTrait {
 namespace tosa {
 
@@ -100,9 +101,7 @@ bool isa_tosa_shape_type(mlir::Type t);
 /// operation, -1 can be used to indicate a size that is the remainder
 /// of the other dimensions.
 constexpr int64_t kInferableDimSize = -1;
-
 } // namespace tosa
-
 } // namespace mlir
 
 #define GET_ATTRDEF_CLASSES


        


More information about the Mlir-commits mailing list