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
DSPAnalyzer: Migrate off file-scope state #9377
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds the non-functional skeleton for the to-be Analyzer interface with deglobalized components.
Attempts to simply make use of the interface. Cleanup will follow in subsequent commits to make for nicer review.
BhaaLseN
approved these changes
Dec 28, 2020
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.
Code LGTM, untested; and that one remark is ignorable if we want to keep it.
Makes it harder to accidentally misuse and increases readability.
Now that we have the convenience functions around the flag bit manipulations, there's no external usages of the flags, so we can make these private to the analyzer implementation. Now the Analyzer namespace is largely unnecessary and can be merged with the DSP namespace in the next commit.
Now that the Analyzer class fully encapsulates all analyzer state, the namespace is no longer necessary.
Allows the analyzer to exist independently of the DSP structure. This allows for unit-tests to be created in a nicer manner. SDSP is only necessary during the analysis phase, so we only need to keep a reference around to it then as opposed to the entire lifecycle of the analyzer. This also allows the copy/move assignment operators to be defaulted, as a reference member variable prevents that.
Places them into their own function to keep their functionality isolated and self-documenting.
leoetlino
reviewed
Dec 29, 2020
leoetlino
approved these changes
Dec 29, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Turns the DSP analyzer into a class and situates it within the SDSP struct. With this, I believe all relevant state within the DSP code has been made non-global.
These changes were significantly easier to chunk out into parts for review, as opposed to the deglobalization efforts in DSPCore, as the file-scope state itself was already hidden behind an interface. This more-or-less allowed for "sliding" the class into place in an easier manner.
Each commit should explain what it does and any rationale for it if necessary.