Skip to content

Conversation

d367wang
Copy link

@d367wang d367wang commented Feb 19, 2022

A split of #331

  1. Get arithmetic operation kind for compound assignments
  2. Small tweaks on parameters of SlotManager.createArithmeticVariableSlot

Co-authored-by: Jenny Xiang [email protected]

Copy link
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @d367wang !

*/
ArithmeticVariableSlot createArithmeticVariableSlot(
AnnotationLocation location, AnnotatedTypeMirror lhsAtm, AnnotatedTypeMirror rhsAtm);
AnnotationLocation location, TypeMirror lhs, TypeMirror rhs);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The names/comments in the javadoc above also need to be updated.

@Override
public ArithmeticVariableSlot createArithmeticVariableSlot(
AnnotationLocation location, AnnotatedTypeMirror lhsAtm, AnnotatedTypeMirror rhsAtm) {
AnnotationLocation location, TypeMirror lhs, TypeMirror rhs) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are there no calls to this method that need to be changed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because ArithmeticVariableSlots are only created in the value-inference downstream

* Determine the type kind of an arithmetic operation, based on Binary Numeric Promotion in JLS 5.6.2.
* @param lhsAtm atm of left operand
* @param rhsAtm atm of right operand
* @param lhsType type of left operand
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you break this PR into two, one for compound assignments and one for these parameter type changes?

@d367wang d367wang assigned wmdietl and unassigned d367wang and wmdietl Mar 5, 2022
@wmdietl wmdietl merged commit 659bf69 into opprop:master Mar 7, 2022
@wmdietl
Copy link
Member

wmdietl commented Mar 7, 2022

@d367wang Thanks! Is there a follow-up PR for the createArithmeticVariableSlot changes?

@d367wang d367wang deleted the value-patch-1 branch March 7, 2022 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants