[Mlir-commits] [mlir] [mlir] Method to iterate over registered operations for a given dialect class. (PR #112344)

Mehdi Amini llvmlistbot at llvm.org
Wed Oct 16 13:31:13 PDT 2024


================
@@ -190,6 +190,9 @@ class MLIRContextImpl {
   /// and efficient `getRegisteredOperations` implementation.
   SmallVector<RegisteredOperationName, 0> sortedRegisteredOperations;
 
+  /// This returns the number of registered operations for the given dialect.
+  size_t operationCount = 0;
+
----------------
joker-eph wrote:

The comment says that this count is "for the given dialect", but we're in the context class, so it seems to me that you implemented a global count that isn't dialect specific.

The suggestion was to put this counter in `class Dialect {...}` instead I believe

https://github.com/llvm/llvm-project/pull/112344


More information about the Mlir-commits mailing list