swift
2d5276d8 - Clean up l-value emission in SILGen.

Commit
7 years ago
Clean up l-value emission in SILGen. There were several bits of code which were unnecessarily repeating the core logic of breaking down an access strategy and either setting up an LValue or directly emitting it. These places have now been unified to just create and then load or othrwise use an LValue. Introduce a visitor which handles the common parts of breaking down an access strategy and computing information like the LValueTypeData. In addition to its direct benefits (which are somewhat lost in the boilerplate of capturing local state into the visitor subclass), this eliminates some of the ad-hocness of how the various emission paths use AccessStrategy. Finally, implement the MaterializeToTemporary strategy in its full generality by using the actual read and write sub-strategies instead of always falling back on calling the getter and setter. This part is not NFC because it causes us to perform the read part of a read/write to a stored-with-observers property by directly accessing the storage instead of calling the getter.
Author
Committer
Parents
Loading