[Mlir-commits] [mlir] [MLIR][Python] Remove partial LLVM APIs in python bindings (3/n) (PR #178984)

Jakub Kuderski llvmlistbot at llvm.org
Mon Feb 2 08:33:35 PST 2026


================
@@ -190,15 +192,16 @@ PyGlobals::lookupDialectClass(const std::string &dialectNamespace) {
 }
 
 std::optional<nb::object>
-PyGlobals::lookupOperationClass(llvm::StringRef operationName) {
+PyGlobals::lookupOperationClass(std::string_view operationName) {
   // Make sure dialect module is loaded.
-  auto split = operationName.split('.');
-  llvm::StringRef dialectNamespace = split.first;
+  size_t splitPos = operationName.find('.');
+  std::string_view dialectNamespace = operationName.substr(0, splitPos);
----------------
kuhar wrote:

`dialectNamespace = operationName.remove_prefix(operationName.find_first_of('.'))`?

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


More information about the Mlir-commits mailing list