mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:14:42 +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:
@@ -26,7 +26,7 @@
|
||||
// CHECK:STDOUT: {kind: BindName, arg0: str1, arg1: node6, type: node2},
|
||||
// CHECK:STDOUT: {kind: FunctionDeclaration, arg0: callable0},
|
||||
// CHECK:STDOUT: {kind: BindName, arg0: str2, arg1: node8},
|
||||
// CHECK:STDOUT: {kind: FunctionDefinition, arg0: node8, arg1: block4},
|
||||
// CHECK:STDOUT: {kind: FunctionDefinition, arg0: node8, arg1: block0},
|
||||
// CHECK:STDOUT: ]
|
||||
// CHECK:STDOUT: node_blocks: [
|
||||
// CHECK:STDOUT: [
|
||||
@@ -46,8 +46,6 @@
|
||||
// CHECK:STDOUT: node9,
|
||||
// CHECK:STDOUT: node10,
|
||||
// CHECK:STDOUT: ],
|
||||
// CHECK:STDOUT: [
|
||||
// CHECK:STDOUT: ],
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
fn Foo(a: i32, b: i32,) {}
|
||||
|
||||
Reference in New Issue
Block a user