Commit Graph

2 Commits

Author SHA1 Message Date
Erik Eckstein
29541fa8f1 SILGen: use builtin prepareInitialization instead of zeroInitializer when generating SIL for Builtin.emplace
`zeroInitializer` is blocking optimizations, but it is not needed because the closure of `Builtin.emplace` will initialize the memory anyway.
We only need to tell mandatory passes that this memory should be treated as initialized.
2025-05-20 20:46:33 +02:00
Joe Groff
66780eef4b SILGen: Correct ownership forwarding of Builtin.emplace.
Forward the owning cleanup for the temporary buffer (if needed) instead of
creating a new cleanup, to avoid a double-free when both the initialization
cleanup and the value cleanup execute. Fixes rdar://147961840.
2025-04-03 13:18:57 -07:00