-
-
Notifications
You must be signed in to change notification settings - Fork 74
♻️ Simplify OpenQASM gate and entry-point naming #2414
Copy link
Copy link
Open
Labels
MLIRAnything related to MLIRAnything related to MLIROpenQASMAnything related to OpenQASMAnything related to OpenQASMcode qualityCode quality improvementsCode quality improvementsrefactorAnything related to code refactoringAnything related to code refactoring
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
MLIRAnything related to MLIRAnything related to MLIROpenQASMAnything related to OpenQASMAnything related to OpenQASMcode qualityCode quality improvementsCode quality improvementsrefactorAnything related to code refactoringAnything related to code refactoring
🤖 AI text below 🤖
Problem Statement
OpenQASM import normally names the generated entry function
main. A custom gate may also be namedmain, so the importer renames the entry function to_mqt_entryand probes numbered suffixes against all custom gate names. This works, but spreads a source-name collision into the internal symbol policy and adds special-case code.This follows up on the final review of #2338.
Proposed Solution
Define a simple internal naming contract that keeps the generated entry point distinct from source-level custom gate symbols. Preserve legal custom gate names, including
main, across import and export while maintaining symbol-table uniqueness.Remove the collision scan if the new invariant provides the same guarantee. Keep regression coverage for a custom gate named
mainand for collisions with reserved internal names.