Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.