Skip to content
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

[silgenlvalue] NFC refactorings. #23438

Conversation

gottesmm
Copy link
Contributor

I am preparing this code for eliminating the NominalType peephole in RValue emission for member_ref_expr. The key way I am planning on doing this is by teaching LValue emission to use LValue components for project operations instead of evaluating each of the member_ref_expr as individual RValues.

These two commits take us on the way to that world by:

  1. Adding a small helper for generating a tuple child LValueData.
  2. Moving the creation of the creation of the ValueComponent into visitRecInOutBase instead of doing it upon returning to visitRec from said function. This will enable me to add additional components to whatever LValue is returned from visitRec from within visitRecInOutBase. For instance, I could add a StructElementComponent.

…alue instead of a ManagedValue.

In its caller, we are just wrapping the return ManagedValue in an LValue
ValueComponent. By returning the lvalue with the value component applied
already, we gain extra flexibility in visitRecNonInOutBase to add the
ValueComponent to a recursive lvalue that we compute within said function.
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@slavapestov
Copy link
Contributor

Should Sema emit all property accesses as lvalues inside LoadExprs?

@gottesmm
Copy link
Contributor Author

@slavapestov Elaborate?

My main concern here in general is that we need to draw a sharper line when we go in between the "normal cleanup world" (RValue emission + others) and "formal evaluation cleanup world" (SILGenLValue).

@gottesmm gottesmm closed this Apr 6, 2019
@gottesmm gottesmm deleted the pr-4cd8c13fbee699dc5d060e0fde86a216ea620a19 branch April 6, 2019 07:03
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