@@ -467,6 +467,15 @@ InOutConversionScope::~InOutConversionScope() {
467
467
void PathComponent::_anchor () {}
468
468
void PhysicalPathComponent::_anchor () {}
469
469
470
+ void PhysicalPathComponent::set (SILGenFunction &SGF, SILLocation loc,
471
+ ArgumentSource &&value, ManagedValue base) && {
472
+ auto finalDestAddr = std::move (*this ).project (SGF, loc, base);
473
+ assert (finalDestAddr.getType ().isAddress ());
474
+
475
+ auto srcRValue = std::move (value).getAsRValue (SGF).ensurePlusOne (SGF, loc);
476
+ std::move (srcRValue).assignInto (SGF, loc, finalDestAddr.getValue ());
477
+ }
478
+
470
479
void PathComponent::dump () const {
471
480
dump (llvm::errs ());
472
481
}
@@ -4899,12 +4908,7 @@ void SILGenFunction::emitAssignToLValue(SILLocation loc,
4899
4908
4900
4909
// Write to the tail component.
4901
4910
if (component.isPhysical ()) {
4902
- auto finalDestAddr =
4903
- std::move (component).project (*this , loc, destAddr);
4904
- assert (finalDestAddr.getType ().isAddress ());
4905
-
4906
- auto value = std::move (src).getAsRValue (*this ).ensurePlusOne (*this , loc);
4907
- std::move (value).assignInto (*this , loc, finalDestAddr.getValue ());
4911
+ std::move (component.asPhysical ()).set (*this , loc, std::move (src), destAddr);
4908
4912
} else {
4909
4913
std::move (component.asLogical ()).set (*this , loc, std::move (src), destAddr);
4910
4914
}
0 commit comments