-
Notifications
You must be signed in to change notification settings - Fork 24
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
Require that generator params/args be a superset of typegen params #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks good.
Two fixes:
-
can you update the checkParams to a name that reflects the operation better?
-
Can you change this to pull request into the 'dev' branch? I need to do a lot more continuous integration work in order to update master (Because coreIR is a dependency on another larger Stanford project)
Retargeted onto dev. |
I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@THofstee Super sorry about this... There are a bunch of changes that are merged that probably are inconsistent with some of the things you did. Let me know if I could help fix anything.
Also I think I need two functions for the checkParams thing. One that checks if they are exactly equal and one if the params are a superset of the args.
Maybe the names areArgsParamsMatching, and areArgsParamsSubset. Or something along those lines. I am terrible at coming up with names. Ideally the name is some sort of question that describes the boolean operation explicitly.
Out of curiosity, what would be the reasoning for having another function test whether or not they are exactly equal? |
I do the matching check on the Args being passed into the generator. Is there a good situation where you would want to pass in more args to a generator instance than the generator needed? Perhaps? |
I'm not sure. Previously in the other branch I was working in I used it out of convenience because I didn't need a type to pass into runGenerator, but I would get a segfault if I passed in a nullptr so I just grabbed the TypeGen for the Generator and ran it with the arguments for the generator. I think it's probably better to only have the equality check instead of subset when you provide arguments to the parameters. I can't think of any programming languages that allow you to pass in more arguments to a function than the function has parameters, and I can imagine a lot of nasty bugs that might result from this. I'll need to double check to see if the nullptr passed to runGenerator still causes a segfault in the dev branch. I'll clean this up a bit tomorrow. |
Just as a warning, I did clean up the infrastructure for running the typegen and generator functions a bit. I made them into an actual method of the class rather than a random function (although I did keep that ability to pass in a random function). If the API is not clear, definitely let me know and add it to Issue #33. Also if you are getting segfaults, then definitely report an issue. Ideally you should not be able to segfault. |
Thanks again for looking into this stuff! I know it is annoying that things keeps changing, but that is the definition of Agile! |
Seeing as how there is only one function now to check that args exactly match params, I've just left it renamed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This is a fix for issue #27.