[Mlir-commits] [flang] [mlir] [MLIR][ODS] Add support for overloading interface methods (PR #161828)
Matthias Springer
llvmlistbot at llvm.org
Mon Oct 6 07:48:57 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());
----------------
matthias-springer wrote:
How come a single counter is sufficient here? I expected name mangling scheme that makes the argument types part of the function name. When the interface method is called, how do you know which dedup method to call?
https://github.com/llvm/llvm-project/pull/161828
More information about the Mlir-commits
mailing list