Skip to content

Get arithmetic operation kind for compound assignments#388

Merged
wmdietl merged 4 commits intoopprop:masterfrom
d367wang:value-patch-1
Mar 7, 2022
Merged

Get arithmetic operation kind for compound assignments#388
wmdietl merged 4 commits intoopprop:masterfrom
d367wang:value-patch-1

Conversation

@d367wang
Copy link
Copy Markdown

@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 j.tt.xiang@gmail.com

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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