-
-
Notifications
You must be signed in to change notification settings - Fork 22
Code generator: allow for variables to be tracked/untracked #1256
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
Conversation
Indeed, we want to be able to tell the generator to track/untrack some model variables. So, to have those `model()` and `setModel()` methods make the generator model-specific when we want it to be usable for any model, hence now the `interfaceCode()` and `implementationCode()` methods taking a model as a parameter.
2867e43 to
ceb1d55
Compare
…m a Variable object.
Someone might have a version of llvm-cov and llvm-profdata that they use and which is not located in /Library/Developer/CommandLineTools/usr/bin. This means that they will need to provide LLVM_BIN_DIR which is not ideal, not least since there are PREFERRED_LLVM_COV_NAMES and PREFERRED_LLVM_PROFDATA_NAMES to play with, if needed.
hsorby
left a comment
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.
What is the thinking behind always passing an analyser model to the generator class, as opposed to setting the analyser model for the generator to work on?
|
Other than this question: What is the thinking behind always passing an analyser model to the generator class, as opposed to setting the analyser model for the generator to work on? I am happy with this work. |
Oops, I went through the inline comments completely overlooking this one. Anyway, are you talking about methods like |
|
You are asking the Generator to hold a map of analysermodels and their map of tracked and untracked variables. The Generator should really be stateless. I have three problems with this approach:
For me the tracked varaibles belong with the AnalyserModel itself. Alternatively, you could create a generation context that holds the tracked variable information, and generator profile and you pass the AnalyserModel and GenerationContext when asking the generator to generate. This also means that the Generator doesn’t hold a reference to a generator profile this is passed in when the generation happens. For me this would be a massive archetictural improvement for the library. |
|
The un/tracking of variables is only relevant in the context of code generation, which is why
Correct, although we could always a method to reset
True, but then again the generator is not thread-safe to start with.
I agree, a better approach would be to have a new class ( However, I would do that as part of a different GitHub issue. Time is pressing. |
|
This PR also: |
Fixes #1244.