[flang-commits] [flang] [mlir] [MLIR][ODS] Add support for overloading interface methods (PR #161828)

Mehdi Amini via flang-commits flang-commits at lists.llvm.org
Mon Oct 6 08:03:52 PDT 2025


================
@@ -83,8 +87,15 @@ Interface::Interface(const Record *def) : def(def) {
 
   // Initialize the interface methods.
   auto *listInit = dyn_cast<ListInit>(def->getValueInit("methods"));
-  for (const Init *init : listInit->getElements())
-    methods.emplace_back(cast<DefInit>(init)->getDef());
+  StringSet<> dedupNames;
+  for (const Init *init : listInit->getElements()) {
+    std::string name =
+        cast<DefInit>(init)->getDef()->getValueAsString("name").str();
+    while (!dedupNames.insert(name).second) {
+      name = name + "_" + std::to_string(dedupNames.size());
----------------
joker-eph wrote:

I added some comments about this, PTAL.

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


More information about the flang-commits mailing list