Skip to content

[CIR][CodeGen] Fix catch-all dispatch and multiple destructor calls #1740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 15, 2025

Conversation

bruteforceboy
Copy link
Contributor

@bruteforceboy bruteforceboy commented Jul 11, 2025

This PR has two parts:

  1. Mimicking the OG special case for a single catch-all when getting dispatch blocks. The huge testcase I added, gotten by using creduce on a c++ file, crashed at this point in our version.
  2. Fixing multiple destructor calls for the same object. For example, there were tests like #1 and #2, having a second destructor call to an already destroyed object. This PR fixes these and I have updated the tests. Also, I added "CIR-NEXT" at some points, to confirm the destructors are indeed called once.

As usual, please let me know if you have any concerns.

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great, thanks! One clarifying question

@bcardosolopes bcardosolopes merged commit aa1692a into llvm:main Jul 15, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants