Skip to content
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

Opeq fix #44

Merged
merged 4 commits into from
May 9, 2016
Merged

Opeq fix #44

merged 4 commits into from
May 9, 2016

Conversation

ChrisDodd
Copy link
Contributor

This is really two change, but the second is dependent on the first.

This reorganizes the way methods are managed in the ir-generator -- they now know about their arguments and return type so we can have overloaded methods, and the generation of methods is split off into a separate file. There's now a table of methods to generate, using flags to control a bunch of special cases, so all methods can be handled somewhat uniformly and adding new methods is easier.

For operator==, this overloads it for all types declared in the gen-table-macro.h file we generate, so double dispatch works properly for all cases involving any of those types. It requires adding static_cast on the argument when calling the base operator== from a derived class so you get the right overload, which feels a bit fragile -- easy to get wrong for hand-written versions, of which there are only a couple.

new Pass2(*this),
new Pass3(*this),
})
}))->setRepeats(100) // avoid infinite loop if there's a bug
Copy link
Contributor

Choose a reason for hiding this comment

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

I could argue that you are more likely to catch the bug if it is an infinite loop.

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