mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 22:02:51 +01:00
Previously we created allocas for temporaries at whatever point in the output LLVM function we'd reached. This would result in these being dynamic allocas (performing a dynamic stack allocation), which is inefficent and can lead to a stack overflow if it happens in a loop. Switch to putting the allocas in the entry block instead, and instead generate a lifetime start marker when we reach the point where the temporary is introduced. We already did this for local variables; this is just factoring out and reusing that code.