mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 16:31:04 +01:00
Make function definitions allocate the body more lazily. (#2557)
Lazy allocation means that we can use a single node block for _all_ empty node blocks. The change in timing for when the definition node is emitted shouldn't affect semantic correctness; the signature is already present for recursive calls.
This commit is contained in:
@@ -27,10 +27,6 @@ class SemanticsNodeBlockStack {
|
||||
// order to support lazy allocation.
|
||||
auto Push() -> void;
|
||||
|
||||
// Pushes a new node block.
|
||||
// TODO: Try to remove this in favor of the lazy alloc in Push.
|
||||
auto PushWithUnconditionalAlloc() -> SemanticsNodeBlockId;
|
||||
|
||||
// Peeks at the top node block. This does not trigger lazy allocation, so the
|
||||
// returned node block may be invalid.
|
||||
auto Peek() -> SemanticsNodeBlockId { return stack_.back(); }
|
||||
|
||||
Reference in New Issue
Block a user