-
Notifications
You must be signed in to change notification settings - Fork 89
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
Refactor OperatorMsg
#3764
Closed
jeremiah-corrado
wants to merge
11
commits into
Bears-R-Us:master
from
jeremiah-corrado:refactor-binops
Closed
Refactor OperatorMsg
#3764
jeremiah-corrado
wants to merge
11
commits into
Bears-R-Us:master
from
jeremiah-corrado:refactor-binops
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
…arate procedures for different kinds of binary operations (to avoid unused code paths) Signed-off-by: Jeremiah Corrado <jeremiah.corrado@hpe.com>
Signed-off-by: Jeremiah Corrado <jeremiah.corrado@hpe.com>
Signed-off-by: Jeremiah Corrado <jeremiah.corrado@hpe.com>
Signed-off-by: Jeremiah Corrado <jeremiah.corrado@hpe.com>
Signed-off-by: Jeremiah Corrado <jeremiah.corrado@hpe.com>
Signed-off-by: Jeremiah Corrado <jeremiah.corrado@hpe.com>
Signed-off-by: Jeremiah Corrado <jeremiah.corrado@hpe.com>
Signed-off-by: Jeremiah Corrado <jeremiah.corrado@hpe.com>
Signed-off-by: Jeremiah Corrado <jeremiah.corrado@hpe.com>
Note: |
closing for now in favor of a simpler refactor: #3773 |
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.
Suggestion cannot be applied right now. Please check back later.
Refactors OperatorMsg to use
instantiateAndRegister
with the goal of making the code clearer and more readable. Closes #3719Previously, this module had a few monolithic message handlers that selected over all pairs of
dytpes
. Within eachwhen
-clause, the implementation would figure out the result type based on the kind of operator, and then call out to helper procedures inbinOps.chpl
that had various conditionals over the array types and/or the result array type to select the correct implementation of the operator (or return a not supported message) based on the types involved.I found this scheme somewhat difficult to follow when reading/modifying the operatorMsg code. As such, the refactored implementation, has one message-handler for each kind of operator — where the goal is to have a consistently defined result type within that procedure. In some cases the procedures are overloaded for array element types like
bool
orbigint
that require special implementations.I'm hoping that the simplified layout leads to faster compilation and/or reduced memory consumption when compiling the module. I have yet to test this.