SILGen: Emit an addressable representation for immutable bindings on demand.

To ensure that dependent values have a persistent-enough memory representation
to point into, when an immutable binding is referenced as an addressable
argument to a call, have SILGen retroactively emit a stack allocation and
materialization that covers the binding's scope.
This commit is contained in:
Joe Groff
2025-03-10 20:18:49 -07:00
parent ecaa041344
commit 19a99ea42b
14 changed files with 625 additions and 72 deletions

View File

@@ -740,7 +740,7 @@ void SILGenFunction::emitCaptures(SILLocation loc,
}
};
auto Entry = found->second;
auto &Entry = found->second;
auto val = Entry.value;
switch (SGM.Types.getDeclCaptureKind(capture, expansion)) {