-
Notifications
You must be signed in to change notification settings - Fork 758
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
[NFC] Make fuzzing params mutable #7257
Conversation
src/tools/fuzzing/fuzzing.cpp
Outdated
@@ -2420,7 +2419,7 @@ Expression* TranslateToFuzzReader::makeCallRef(Type type) { | |||
// look for a call target with the right type | |||
Function* target; | |||
bool isReturn; | |||
size_t i = 0; | |||
decltype(TRIES) i = 0; |
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 avoids a compiler warning on "comparing signed and unsigned"
I would strongly prefer not using mutable global state like this. If we want the parameters to be mutable, can we pass them as a configuration object to |
Sure, I can do that. But note that that object wouldn't be constant, or at least we'd want to make copies of it with changes (e.g. so that not all functions have the same depth and other params). Does that change your mind? |
Ok, then can we associate different copies of the configuration with the different functions? |
Yes. But then it seems odd to pass the configuration in, so I am thinking we'd define a global config in the generator, and create a new one per function and set it active while generating it? |
Why does it seem odd to pass the configuration down to where it will be used? Would that just be too invasive? |
If you mean passing constantly in every If you mean passing it in from the outside to the fuzzer (that is what I meant before), then it seems odd for the outside to request params but the fuzzer modify them (and the goal is for it to modify them in a dynamic manner). |
Got it, I wasn't sure what you had in mind with "it seems odd to pass the configuration in."
This sounds good to me. |
Ok, rewritten as a context with RAII functionality. The RAII part is not yet used as the global context is never replaced, to keep this initial PR NFC. |
This only makes them mutable, but does not actually mutate them in any
way. The new file
parameters.cpp
is the same as the oldparameters.h
,with the exact same values, but without
constexpr
etc. on them.The goal in a later PR is to adjust these to get even more variety in
codegen. E.g. in a huge module we might want many heap type
declarations.