-
Notifications
You must be signed in to change notification settings - Fork 62
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
Final tweak to the work on unused variables #385
Conversation
For the record, I could decorate variable declarations with
but that's a gcc-ism and I couldn't convince myself that there's something equivalent for MSVC |
In EverParse, when doing:
the test fails when compiling the generated code from
By contrast, with Karamel
|
Also, this PR still produces some outstanding
Is this intended? |
Thanks Tahina for testing, this is super helpful! I've refined the criterion that ignores the return value of a function call to only apply to function calls, not the application of a builtin operator. In other words,
whereas now the question remains as to why these IGNORE nodes remain in the AST and why they haven't been eliminated earlier when the argument to IGNORE was very clearly a value that can be eliminated -- how much do you care? I could take a look, or merge now (provided your example compiles) and investigate later for your use-case. let me know |
Thanks Jonathan for your fix! Example12 now seems to work better.
Sorry, I meant that there are some leftover mentions of |
No I would leave that as KRML_HOST_IGNORE -- my intent is that KRML_MAYBE_UNUSED_VAR only applies to variables (as the name implies), and that KRML_HOST_IGNORE applies to the rest -- the stuff that we do want to ignore. Even though both macros are identical, I think this signals the intent better. |
FYI I just pushed a commit that gets rid of the extra KRML_IGNORE on your specific example. (It was triggered by a situation of the form Now the syntactic analysis determines that the entire match is a pure subexpression and can be eliminated altogether, rather than pushing ignore at the leaves. I suspect this might improve things for you a bunch -- for HACL*, the impact of that most recent commit was completely minor. Let me know what you think. |
Thanks for your attempt. Now I have the following error, this time on merkle-tree:
|
Thanks, I pushed a fix for that particular issue. I tried a full everest build but everparse returns errors about a diff that has changed. Do you have instructions for me to test locally? |
Did you use EverParse branch I have Everest branch |
Thanks, I have a locally successful build using your everest branch and hopefully CI will agree and come back green soon. Thanks! |
Everest green now. Thank you again! |
This is the final tweak on that series of PRs I just merged. Best explained via an excerpt of the diff this generates in HACL*:
IGNORE
would placed in statement position, it is automatically skipped, since C automatically discards the return value by default without warning@tahina-pro I believe this impacts Everparse (slightly), since you may have to rename the macro... so I'll you comment and/or approve, then merge whenever is right... thanks!