diff --git a/compiler/passes/src/code_generation/visit_expressions.rs b/compiler/passes/src/code_generation/visit_expressions.rs index 049ff2eca0..455034104d 100644 --- a/compiler/passes/src/code_generation/visit_expressions.rs +++ b/compiler/passes/src/code_generation/visit_expressions.rs @@ -540,6 +540,9 @@ impl<'a> CodeGenerator<'a> { } } + // Construct the output operands. These are the destination registers **without** the future. + let output_operands = destinations.join(" "); + // If `has_finalize`, create another destination register for the future. if has_finalize { // Construct the future register. @@ -553,7 +556,7 @@ impl<'a> CodeGenerator<'a> { }; // Add the futures register to the list of futures. - self.futures.push((future_register.clone(), format!("{program_id}/{function_name}"))); + self.futures.push((future_register.clone(), format!("{program_id}.aleo/{function_name}"))); // Add the future register to the list of destinations. destinations.push(future_register); @@ -573,8 +576,8 @@ impl<'a> CodeGenerator<'a> { // Push the call instruction to the list of instructions. instructions.push_str(&call_instruction); - // Return the destination registers as a string and the instructions. - (destinations.join(" "), instructions) + // Return the output operands and the instructions. + (output_operands, instructions) } fn visit_tuple(&mut self, input: &'a TupleExpression) -> (String, String) { diff --git a/compiler/passes/src/code_generation/visit_program.rs b/compiler/passes/src/code_generation/visit_program.rs index f698f06caf..9c92ec6cb6 100644 --- a/compiler/passes/src/code_generation/visit_program.rs +++ b/compiler/passes/src/code_generation/visit_program.rs @@ -209,7 +209,7 @@ impl<'a> CodeGenerator<'a> { function_string.push_str(&block_string); // If the finalize block exists, generate the appropriate bytecode. - if let Some(finalize) = &function.finalize { + if !self.futures.is_empty() || function.finalize.is_some() { // Clear the register count. self.next_register = 0; self.in_finalize = true; @@ -220,43 +220,45 @@ impl<'a> CodeGenerator<'a> { self.variable_mapping.insert(&sym::SelfLower, "self".to_string()); self.variable_mapping.insert(&sym::block, "block".to_string()); - function_string.push_str(&format!("\nfinalize {}:\n", finalize.identifier)); + function_string.push_str(&format!("\nfinalize {}:\n", function.identifier)); // If the function contained calls that produced futures, then we need to add the futures to the finalize block as input. // Store the new future registers. let mut future_registers = Vec::new(); for (_, future_type) in &self.futures { let register_string = format!("r{}", self.next_register); - writeln!(function_string, " input {register_string} as {future_type};") + writeln!(function_string, " input {register_string} as {future_type}.future;") .expect("failed to write to string"); future_registers.push(register_string); self.next_register += 1; } - // Construct and append the input declarations of the finalize block. - for input in finalize.input.iter() { - let register_string = format!("r{}", self.next_register); - self.next_register += 1; - - // TODO: Dedup code. - let type_string = match input { - functions::Input::Internal(input) => { - self.variable_mapping.insert(&input.identifier.name, register_string.clone()); - - let visibility = match (self.is_transition_function, input.mode) { - (true, Mode::None) => Mode::Public, - _ => input.mode, - }; - self.visit_type_with_visibility(&input.type_, visibility) - } - functions::Input::External(input) => { - self.variable_mapping.insert(&input.program_name.name, register_string.clone()); - format!("{}.aleo/{}.record", input.program_name, input.record) - } - }; + // Construct and append the input declarations of the finalize block, if it exists. + if let Some(finalize) = &function.finalize { + for input in finalize.input.iter() { + let register_string = format!("r{}", self.next_register); + self.next_register += 1; + + // TODO: Dedup code. + let type_string = match input { + functions::Input::Internal(input) => { + self.variable_mapping.insert(&input.identifier.name, register_string.clone()); + + let visibility = match (self.is_transition_function, input.mode) { + (true, Mode::None) => Mode::Public, + _ => input.mode, + }; + self.visit_type_with_visibility(&input.type_, visibility) + } + functions::Input::External(input) => { + self.variable_mapping.insert(&input.program_name.name, register_string.clone()); + format!("{}.aleo/{}.record", input.program_name, input.record) + } + }; - writeln!(function_string, " input {register_string} as {type_string};",) - .expect("failed to write to string"); + writeln!(function_string, " input {register_string} as {type_string};",) + .expect("failed to write to string"); + } } // Invoke `await` on each future. @@ -264,8 +266,10 @@ impl<'a> CodeGenerator<'a> { writeln!(function_string, " await {register};").expect("failed to write to string"); } - // Construct and append the finalize block body. - function_string.push_str(&self.visit_block(&finalize.block)); + // Construct and append the finalize block body, if it exists. + if let Some(finalize) = &function.finalize { + function_string.push_str(&self.visit_block(&finalize.block)); + } self.in_finalize = false; } diff --git a/compiler/passes/src/flattening/flattener.rs b/compiler/passes/src/flattening/flattener.rs index d18ee4ccf4..07447390f5 100644 --- a/compiler/passes/src/flattening/flattener.rs +++ b/compiler/passes/src/flattening/flattener.rs @@ -31,6 +31,7 @@ use leo_ast::{ TernaryExpression, TupleExpression, Type, + UnitExpression, }; use leo_span::Symbol; @@ -213,6 +214,7 @@ impl<'a> Flattener<'a> { /// Folds a list of return statements into a single return statement and adds the produced statements to the block. pub(crate) fn fold_returns(&mut self, block: &mut Block, returns: Vec<(Option, ReturnStatement)>) { + // If the list of returns is not empty, then fold them into a single return statement. if !returns.is_empty() { let mut return_expressions = Vec::with_capacity(returns.len()); @@ -266,5 +268,17 @@ impl<'a> Flattener<'a> { id: self.node_builder.next_id(), })); } + // Otherwise, push a dummy return statement to the end of the block. + else { + block.statements.push(Statement::Return(ReturnStatement { + expression: { + let id = self.node_builder.next_id(); + Expression::Unit(UnitExpression { span: Default::default(), id }) + }, + finalize_arguments: None, + span: Default::default(), + id: self.node_builder.next_id(), + })); + } } } diff --git a/tests/expectations/compiler/constants/constant_finalize.out b/tests/expectations/compiler/constants/constant_finalize.out index d80e18b2a6..e22395b7de 100644 --- a/tests/expectations/compiler/constants/constant_finalize.out +++ b/tests/expectations/compiler/constants/constant_finalize.out @@ -8,8 +8,8 @@ outputs: initial_ast: 61959475b7132f57e7ed12c3906ab0d6c988903c76df6c8691b260b0ac673723 unrolled_ast: a205b6d649ec0453b0ca23d527ce1348b7863f163d0c467bd7e6a4dd17d466ca ssa_ast: db913a2f2cd0383a4baec3b8ea6b4e8281d7f6d32e047c125908ceddadbc4f64 - flattened_ast: 665cf74b0b3ec393665a4190f0deb5cc27b729144d29d631f4220caa72e028b8 - inlined_ast: 665cf74b0b3ec393665a4190f0deb5cc27b729144d29d631f4220caa72e028b8 - dce_ast: 665cf74b0b3ec393665a4190f0deb5cc27b729144d29d631f4220caa72e028b8 + flattened_ast: e4909e04089bc18db565c5febcd6470d20b59a52ceee5124c75a37527278c880 + inlined_ast: e4909e04089bc18db565c5febcd6470d20b59a52ceee5124c75a37527278c880 + dce_ast: e4909e04089bc18db565c5febcd6470d20b59a52ceee5124c75a37527278c880 bytecode: 34335e40c3ca26e00044d055cc0cb8d262fce1ac49a4940b36b1136e0772d305 warnings: "" diff --git a/tests/expectations/compiler/examples/basic_bank.out b/tests/expectations/compiler/examples/basic_bank.out index 82c67d4d56..25602c8757 100644 --- a/tests/expectations/compiler/examples/basic_bank.out +++ b/tests/expectations/compiler/examples/basic_bank.out @@ -8,8 +8,8 @@ outputs: initial_ast: a06f6f8927304627273280f932ba15dc3f7d8e904242493f61717b128a6e72ce unrolled_ast: 20d1d302f66a1cb85e9bf3dc7a5d012bec247d3551b0c10a49a70e2fc796efff ssa_ast: d8d53d403c73a714642f0ee35c903fcc638f4c793b73f2b35e644d947b1076e4 - flattened_ast: 9c215a0e0395e4806cdc910fbd241b67dc8d8f285b7ae0978dbea576d3fd8d8f - inlined_ast: 5a38955159fffa89fe7526402a42ecd95a2e3be2f77a02316695d2e1b9af8bd7 - dce_ast: 5a38955159fffa89fe7526402a42ecd95a2e3be2f77a02316695d2e1b9af8bd7 + flattened_ast: 5c15ed355c98713e2a7d5572b417fbbd4a69f8f8bf7eae8df1b4c9c6b48d2f58 + inlined_ast: 8d4a721d1f302ce8f9c27536676f934b1fe483e4e8ed474e10e212c77b5c77bc + dce_ast: 8d4a721d1f302ce8f9c27536676f934b1fe483e4e8ed474e10e212c77b5c77bc bytecode: 799c84f9a28bcdd1cb72269b56baae0905a136fc2d041745fb7ae52c9958b24e warnings: "" diff --git a/tests/expectations/compiler/examples/lottery.out b/tests/expectations/compiler/examples/lottery.out index e073ff694d..2f75260b2a 100644 --- a/tests/expectations/compiler/examples/lottery.out +++ b/tests/expectations/compiler/examples/lottery.out @@ -8,8 +8,8 @@ outputs: initial_ast: 1302520bb45d2fa0aab61b9bd44f14ba0fd693cbe38eb53f07409da99005966d unrolled_ast: 1302520bb45d2fa0aab61b9bd44f14ba0fd693cbe38eb53f07409da99005966d ssa_ast: 8b96d4cc8b07b936f4fa9115a20ccb7b8769fe14949ad0d1b1b8ae487d2796c7 - flattened_ast: 9be983f41578bbf73a13dd63cc320b18bdd8a942a47349fd7cd5d46651bbf998 - inlined_ast: 9be983f41578bbf73a13dd63cc320b18bdd8a942a47349fd7cd5d46651bbf998 - dce_ast: 9be983f41578bbf73a13dd63cc320b18bdd8a942a47349fd7cd5d46651bbf998 + flattened_ast: d75c2f006febf5806c4b725c2b116cdd06bee753b79dec9ba1412932a7679e4b + inlined_ast: d75c2f006febf5806c4b725c2b116cdd06bee753b79dec9ba1412932a7679e4b + dce_ast: d75c2f006febf5806c4b725c2b116cdd06bee753b79dec9ba1412932a7679e4b bytecode: ec9d10d78356538cf9f94bc46c20c33001a05100906259e217eeea2cfd0c4a66 warnings: "" diff --git a/tests/expectations/compiler/examples/token.out b/tests/expectations/compiler/examples/token.out index 1d7e4406ff..e1ae483455 100644 --- a/tests/expectations/compiler/examples/token.out +++ b/tests/expectations/compiler/examples/token.out @@ -8,8 +8,8 @@ outputs: initial_ast: 0b121e536cfdc9c7a48cc2b0937b7a0013a9ebd828c236c52350aaa4b5ac40dc unrolled_ast: 0b121e536cfdc9c7a48cc2b0937b7a0013a9ebd828c236c52350aaa4b5ac40dc ssa_ast: 8ace2aff7a1c6ccc8a1b3947db80c60b38387fb9da4686a0b3b77c3cf542c92d - flattened_ast: 9c2e79c3607b50ba675d24d4acb46f3ec80c146a66d91f94476bbed50798e3be - inlined_ast: 9c2e79c3607b50ba675d24d4acb46f3ec80c146a66d91f94476bbed50798e3be - dce_ast: 9c2e79c3607b50ba675d24d4acb46f3ec80c146a66d91f94476bbed50798e3be + flattened_ast: 651aba0915701ac8895c616806c27129524a4d21d6bbbea6b8c9e25166fe2115 + inlined_ast: 651aba0915701ac8895c616806c27129524a4d21d6bbbea6b8c9e25166fe2115 + dce_ast: 651aba0915701ac8895c616806c27129524a4d21d6bbbea6b8c9e25166fe2115 bytecode: 379643d6f93f6040c0bb64ea96345269a23d6fb23fa3eae46ceb8e9ea9c73f9a warnings: "" diff --git a/tests/expectations/compiler/examples/vote.out b/tests/expectations/compiler/examples/vote.out index 0005080eaa..5b53efa1f0 100644 --- a/tests/expectations/compiler/examples/vote.out +++ b/tests/expectations/compiler/examples/vote.out @@ -8,8 +8,8 @@ outputs: initial_ast: 138da847ee27c757abc8cac45d9794e9829b8a7328a78544d6799d05676ba7e3 unrolled_ast: ad8b0114b13e2c37074e0e5c1ea1a8388b2d68566e7d630fe97bdbb428962bf1 ssa_ast: f009ad0b0108aa940832434858c710fdeba501cb56a64b874aa7523f6ecb773a - flattened_ast: 6f70b04c03328c079ecc07783e9cecb3ea35ec31390c99fc10a176c006233f8b - inlined_ast: 6f70b04c03328c079ecc07783e9cecb3ea35ec31390c99fc10a176c006233f8b - dce_ast: 6f70b04c03328c079ecc07783e9cecb3ea35ec31390c99fc10a176c006233f8b + flattened_ast: ede7fa712e7335d5cf6cf2245cfaaa8b7b625e0682c2d42450b32d032a72e6eb + inlined_ast: ede7fa712e7335d5cf6cf2245cfaaa8b7b625e0682c2d42450b32d032a72e6eb + dce_ast: ede7fa712e7335d5cf6cf2245cfaaa8b7b625e0682c2d42450b32d032a72e6eb bytecode: 0c73fbf3a08f7b89b82fc3189771704f58740f37c41f9c5aa7aef2a808badf9b warnings: "" diff --git a/tests/expectations/compiler/finalize/block_height.out b/tests/expectations/compiler/finalize/block_height.out index 7dddc8ea6e..a534a6b1e3 100644 --- a/tests/expectations/compiler/finalize/block_height.out +++ b/tests/expectations/compiler/finalize/block_height.out @@ -8,8 +8,8 @@ outputs: initial_ast: 3fa1bf3d9465f691bfebc6b79d8d2220aa4bd1ddde949d4e74ce4104ca7194a0 unrolled_ast: 3fa1bf3d9465f691bfebc6b79d8d2220aa4bd1ddde949d4e74ce4104ca7194a0 ssa_ast: 57cdec6f22c8b14655c4b4ffe32f668e450583c10e92de71e0c4d385b4937b5b - flattened_ast: d544ffc75f1144ce6a483231c6ed891fe5fcc681ce7764971f3d32f8054b270a - inlined_ast: d544ffc75f1144ce6a483231c6ed891fe5fcc681ce7764971f3d32f8054b270a - dce_ast: d544ffc75f1144ce6a483231c6ed891fe5fcc681ce7764971f3d32f8054b270a + flattened_ast: ed62fc0374e52aa639b0cb6361c543c56a063989b15b2443da6e6c472176cd52 + inlined_ast: ed62fc0374e52aa639b0cb6361c543c56a063989b15b2443da6e6c472176cd52 + dce_ast: ed62fc0374e52aa639b0cb6361c543c56a063989b15b2443da6e6c472176cd52 bytecode: 6e4a8aeaf3eabc361bf427126c0a7f35c64030fb9c8f66e178c7c05bbede1c48 warnings: "" diff --git a/tests/expectations/compiler/finalize/contains.out b/tests/expectations/compiler/finalize/contains.out index 577bf66283..caa266a2b7 100644 --- a/tests/expectations/compiler/finalize/contains.out +++ b/tests/expectations/compiler/finalize/contains.out @@ -8,8 +8,8 @@ outputs: initial_ast: 3b663ccebe585a1ef278820096bbe17ae95f7a8009c2165ef27aac4aa94e1bb4 unrolled_ast: 3b663ccebe585a1ef278820096bbe17ae95f7a8009c2165ef27aac4aa94e1bb4 ssa_ast: 54e68eab74623306518f553f7a3d95967b8b200adac33d2ff2b5c489aa2c11dd - flattened_ast: 504c9959fbd249c0df40f717ebe03af2ae2d0180e5e8047262e57d2e7fdec050 - inlined_ast: 504c9959fbd249c0df40f717ebe03af2ae2d0180e5e8047262e57d2e7fdec050 - dce_ast: 504c9959fbd249c0df40f717ebe03af2ae2d0180e5e8047262e57d2e7fdec050 + flattened_ast: 75108b91ff5077303f6be482bc39f2ecb4dfd995209e9e78e53fe4f602f3c65f + inlined_ast: 75108b91ff5077303f6be482bc39f2ecb4dfd995209e9e78e53fe4f602f3c65f + dce_ast: 75108b91ff5077303f6be482bc39f2ecb4dfd995209e9e78e53fe4f602f3c65f bytecode: 2560848929684abb429a7de8a2ff0368fa2ea939f25ae84851be67374b652e8e warnings: "" diff --git a/tests/expectations/compiler/finalize/decrement_via_get_set.out b/tests/expectations/compiler/finalize/decrement_via_get_set.out index b44cce8653..90fbb4d41d 100644 --- a/tests/expectations/compiler/finalize/decrement_via_get_set.out +++ b/tests/expectations/compiler/finalize/decrement_via_get_set.out @@ -8,8 +8,8 @@ outputs: initial_ast: 008463f5deff1742786124c320a217a9d9408c88985627a62c95d3cd40ce279c unrolled_ast: 008463f5deff1742786124c320a217a9d9408c88985627a62c95d3cd40ce279c ssa_ast: e8b63fd0ce0f18bfe615d17e7fb25d7193fb98c7bc2c02198f0b92367a1aea24 - flattened_ast: f98cb577bb880e87b7f285a666bdefac42e93dbcca7b207a176266871cf35449 - inlined_ast: f98cb577bb880e87b7f285a666bdefac42e93dbcca7b207a176266871cf35449 - dce_ast: f98cb577bb880e87b7f285a666bdefac42e93dbcca7b207a176266871cf35449 + flattened_ast: 5ff783fdcea1f69d4c9f800d5c8dd0c498382b1b9f27e76738a645d6f4085ec8 + inlined_ast: 5ff783fdcea1f69d4c9f800d5c8dd0c498382b1b9f27e76738a645d6f4085ec8 + dce_ast: 5ff783fdcea1f69d4c9f800d5c8dd0c498382b1b9f27e76738a645d6f4085ec8 bytecode: bbef5ec539b8616fe91e41c03c8ea6a71dfd3cb9731e634919bc8356e6664594 warnings: "" diff --git a/tests/expectations/compiler/finalize/finalize.out b/tests/expectations/compiler/finalize/finalize.out index 0730a7e39e..44d6c1bf62 100644 --- a/tests/expectations/compiler/finalize/finalize.out +++ b/tests/expectations/compiler/finalize/finalize.out @@ -8,8 +8,8 @@ outputs: initial_ast: 164226236b60053405e4b19b3f4adb616a6fcd0aefb8f16821695779b2019cab unrolled_ast: 164226236b60053405e4b19b3f4adb616a6fcd0aefb8f16821695779b2019cab ssa_ast: 26afd14df884307f3ca9e436b8fe68dad496221b5fbecb780146e4a1928b5ec2 - flattened_ast: ba6097eb72f1a9139967b8cc7658300ef6391bd1b9fb05242f40f05737cff82b - inlined_ast: ba6097eb72f1a9139967b8cc7658300ef6391bd1b9fb05242f40f05737cff82b - dce_ast: ba6097eb72f1a9139967b8cc7658300ef6391bd1b9fb05242f40f05737cff82b + flattened_ast: 2539047a2909025a8c23bfdb41159533eb103e2f110c0cbd659877b414f85420 + inlined_ast: 2539047a2909025a8c23bfdb41159533eb103e2f110c0cbd659877b414f85420 + dce_ast: 2539047a2909025a8c23bfdb41159533eb103e2f110c0cbd659877b414f85420 bytecode: 33d8ca1b78918f26980919a4a8b332fb9b375ac476b64636a387fdab715d4ed9 warnings: "" diff --git a/tests/expectations/compiler/finalize/finalize_with_method_calls.out b/tests/expectations/compiler/finalize/finalize_with_method_calls.out index 213935f093..b8cb46fbb9 100644 --- a/tests/expectations/compiler/finalize/finalize_with_method_calls.out +++ b/tests/expectations/compiler/finalize/finalize_with_method_calls.out @@ -8,8 +8,8 @@ outputs: initial_ast: 8f5b589c1e20bc7204b1d7fff58e92c1ae50d30d644713ddca5632d74cd88d79 unrolled_ast: 8f5b589c1e20bc7204b1d7fff58e92c1ae50d30d644713ddca5632d74cd88d79 ssa_ast: 772de7e0df78d62c585b1febf48057c41d0c0920047babdb610bcd5dbc858b73 - flattened_ast: 043562950648fd96145192afebc99f6c937c3d2e12e504388e5ac43932ecaf4a - inlined_ast: 043562950648fd96145192afebc99f6c937c3d2e12e504388e5ac43932ecaf4a - dce_ast: 043562950648fd96145192afebc99f6c937c3d2e12e504388e5ac43932ecaf4a + flattened_ast: 6074c4b3298799f66c770458006429c1fa6e6f8aa6185aec73616deecbd86689 + inlined_ast: 6074c4b3298799f66c770458006429c1fa6e6f8aa6185aec73616deecbd86689 + dce_ast: 6074c4b3298799f66c770458006429c1fa6e6f8aa6185aec73616deecbd86689 bytecode: e9bcea998f0ff492fb57deabfcf08c4ed3f854880b595f17c9aa89181feb3764 warnings: "" diff --git a/tests/expectations/compiler/finalize/increment_via_get_set.out b/tests/expectations/compiler/finalize/increment_via_get_set.out index 1f66527f97..005cad78d4 100644 --- a/tests/expectations/compiler/finalize/increment_via_get_set.out +++ b/tests/expectations/compiler/finalize/increment_via_get_set.out @@ -8,8 +8,8 @@ outputs: initial_ast: 29714656f99da285cc9983018a37cd47f473fcb24a13ca6c5f76cd0aa934e8d1 unrolled_ast: 29714656f99da285cc9983018a37cd47f473fcb24a13ca6c5f76cd0aa934e8d1 ssa_ast: 56c003168b11a191dfecff7befa304b9cb4886afa2722fa66c52cf5af278fa26 - flattened_ast: d09795975e822f338ff3f8e68bfc39455e4b96a8e0a2ade32aee224b68ff0b25 - inlined_ast: d09795975e822f338ff3f8e68bfc39455e4b96a8e0a2ade32aee224b68ff0b25 - dce_ast: d09795975e822f338ff3f8e68bfc39455e4b96a8e0a2ade32aee224b68ff0b25 + flattened_ast: 77608d0001a55918feb78c6ae8954763f8a0a3438445509cab1446a2b7aee5be + inlined_ast: 77608d0001a55918feb78c6ae8954763f8a0a3438445509cab1446a2b7aee5be + dce_ast: 77608d0001a55918feb78c6ae8954763f8a0a3438445509cab1446a2b7aee5be bytecode: 10e754c190939dcffa342c5eef2be0dcb73ef1a9b4391a99e963db6dc61bd38a warnings: "" diff --git a/tests/expectations/compiler/finalize/inline_in_finalize.out b/tests/expectations/compiler/finalize/inline_in_finalize.out index 4327a29d4e..a3d0a5d830 100644 --- a/tests/expectations/compiler/finalize/inline_in_finalize.out +++ b/tests/expectations/compiler/finalize/inline_in_finalize.out @@ -8,8 +8,8 @@ outputs: initial_ast: ff822822a1f599044f4d0ce4f8d7cd9dfc706b5c953a1e3eec7f9a03baf3f43c unrolled_ast: ff822822a1f599044f4d0ce4f8d7cd9dfc706b5c953a1e3eec7f9a03baf3f43c ssa_ast: 00529a7eab6e8154f0356862666570263b9843202cc42310c607153bc80b25b9 - flattened_ast: 94e0020bf97d4e2de4222dac09f02552dcf9f33c4b679f0404be129147ad9c8e - inlined_ast: 1e49000db9da20b5560ce6c87ba6bf8e94e624fe341b829b10a63bfb647e8124 - dce_ast: 1e49000db9da20b5560ce6c87ba6bf8e94e624fe341b829b10a63bfb647e8124 + flattened_ast: 30f9072bf03a9bc5896c99142bb6eb2b990e6b00c0dd7eb5a65d2b3c5d8fce1c + inlined_ast: 8a5719926eb6679339e22b30fdece64052c310865bf92a25283225b7c14b4e5d + dce_ast: 8a5719926eb6679339e22b30fdece64052c310865bf92a25283225b7c14b4e5d bytecode: 643990908e94b8c16515df0d5dcd64918c17b356ad82d652cd9d6504089c49f0 warnings: "" diff --git a/tests/expectations/compiler/finalize/rand.out b/tests/expectations/compiler/finalize/rand.out index 61db170c6f..474dc11ef4 100644 --- a/tests/expectations/compiler/finalize/rand.out +++ b/tests/expectations/compiler/finalize/rand.out @@ -8,8 +8,8 @@ outputs: initial_ast: a13e41d10136d37224ddfb9b54eaf15926a3db8217ecd5ddf8f72bd7a9624c2d unrolled_ast: a13e41d10136d37224ddfb9b54eaf15926a3db8217ecd5ddf8f72bd7a9624c2d ssa_ast: cd75edd82d90a0f69080370969bb97159c5ef5ea366be0d1e8c392274021ab95 - flattened_ast: 888b5240508f78bee53ec724f8ddfd6e597ff195e17124fbd0314feff4495559 - inlined_ast: 888b5240508f78bee53ec724f8ddfd6e597ff195e17124fbd0314feff4495559 - dce_ast: 795c2624ef40b83a85d12ecae86d465ec508f4271824efe7a8ff1052fef946aa + flattened_ast: fffd7c38f8fa3a6d10a09dcf16921114d3fcbe6a9c29537b69ed29e863748fbd + inlined_ast: fffd7c38f8fa3a6d10a09dcf16921114d3fcbe6a9c29537b69ed29e863748fbd + dce_ast: c4f1e570c710539546c718ff2f70078f4f363af79020dedcaaab0f55769e17ef bytecode: c5e80399ab1edccfae4591f3c38695e9a4129b35ad2cc75238859a2e109a245f warnings: "" diff --git a/tests/expectations/compiler/finalize/remove.out b/tests/expectations/compiler/finalize/remove.out index 4518b28bfc..e00f18765f 100644 --- a/tests/expectations/compiler/finalize/remove.out +++ b/tests/expectations/compiler/finalize/remove.out @@ -8,8 +8,8 @@ outputs: initial_ast: ef40e848373640cc46daf2ed7d204e42947061724e43fb9fef09ca4ef4eed69e unrolled_ast: ef40e848373640cc46daf2ed7d204e42947061724e43fb9fef09ca4ef4eed69e ssa_ast: f958903e101b60c097fea8eb35a340d2a66d20456c3a3aac4cf98d2fa6565c24 - flattened_ast: 7e37a21d0c97eee60638cb1e1fa9dec8d15fa8a54da062e4f3f34a997efcd69d - inlined_ast: 7e37a21d0c97eee60638cb1e1fa9dec8d15fa8a54da062e4f3f34a997efcd69d - dce_ast: 7e37a21d0c97eee60638cb1e1fa9dec8d15fa8a54da062e4f3f34a997efcd69d + flattened_ast: c4c68008b271c95ae78e361a3617f8f80cca0729d677aad03f21a5f34fb857df + inlined_ast: c4c68008b271c95ae78e361a3617f8f80cca0729d677aad03f21a5f34fb857df + dce_ast: c4c68008b271c95ae78e361a3617f8f80cca0729d677aad03f21a5f34fb857df bytecode: 7598ca95ba8e589482a0d951cae6f2f8571e7ae33ec8f56dbe83077dac5100d4 warnings: "" diff --git a/tests/expectations/compiler/function/function_call_inline.out b/tests/expectations/compiler/function/function_call_inline.out index d23ca54069..d783b411f0 100644 --- a/tests/expectations/compiler/function/function_call_inline.out +++ b/tests/expectations/compiler/function/function_call_inline.out @@ -8,8 +8,8 @@ outputs: initial_ast: df40eb171f5d73427d4fb3e07a1b8527e7740c1175262383a5fa06afe0641411 unrolled_ast: df40eb171f5d73427d4fb3e07a1b8527e7740c1175262383a5fa06afe0641411 ssa_ast: e4e44ade94500308ede757c4409faa26ed1c33bc4e1abcc81fb5d7a3103dfa4a - flattened_ast: f5aebcf1573fe5172f95508989800d4b0e754cd36ea09ced419c140d49160bdd - inlined_ast: 235c9dc216863e740a98b3a29c9eddc32182aacb647b8e0a1a35e934a3228346 - dce_ast: 235c9dc216863e740a98b3a29c9eddc32182aacb647b8e0a1a35e934a3228346 + flattened_ast: 5873980a8c12b024580f6c0d581bd854eff9ccf12efd07faec56a520473e7a6a + inlined_ast: 4e1be3e70ef12212af6a16c479de1abdbdd98f9005c0fa48dae0d375d2e3407f + dce_ast: 4e1be3e70ef12212af6a16c479de1abdbdd98f9005c0fa48dae0d375d2e3407f bytecode: 44ea5bc8171ad40715c28c40333b673e70474ef9ba2d8f60d6517c0bfc3539e0 warnings: "" diff --git a/tests/expectations/compiler/function/inline_expr_statement.out b/tests/expectations/compiler/function/inline_expr_statement.out index 2295ff3413..542dec549d 100644 --- a/tests/expectations/compiler/function/inline_expr_statement.out +++ b/tests/expectations/compiler/function/inline_expr_statement.out @@ -8,9 +8,9 @@ outputs: initial_ast: 73b2283213866910fe5b658e565262b8cf0f5bdd63a75744540ceca9e664426c unrolled_ast: 73b2283213866910fe5b658e565262b8cf0f5bdd63a75744540ceca9e664426c ssa_ast: b1a433b8926e8eed057df7a36ef16cfe926748b1615a1aa873c0bf33cbf09466 - flattened_ast: 13a67d4931626ce3fa1e8374d4a3b6e15ac2c490545f861af4a3d5a1ddcd1b6c - inlined_ast: c7df09531ad8f90a5aa35004bbad7bc25a38da887bf14e21000e9859e9e616f4 - dce_ast: 373a4480bdfa8a07411b5e56cd3fb0bdf264a24b16dc923194e6be5e2f58b88a + flattened_ast: 96f70367ca9bd009145fefd19e535eb1a82ef58b32f1d0eb0ab4b64af11c318d + inlined_ast: c411e1c3ebcf261591c46bb39e56edc4c7f85ccd28d757ce4ee92fdcf37dcae2 + dce_ast: 1306c4a61a7809227b4c04f91d7c309775654968ae7e0539af4b1c36da7563c3 bytecode: 3c05138e2787f4f82e5e0503d73b7a23b55758efa05449d5fd6f691902e575f3 warnings: "" - initial_symbol_table: efd58a82eec538b09a03f84aeb0c685995e6a9b2f30087929a2ec52c512e01b6 @@ -19,8 +19,8 @@ outputs: initial_ast: 554e5cee7c6eb0c2e05b4ab77f917b2ab671341d27c48daebba5a6d8d49003ad unrolled_ast: 554e5cee7c6eb0c2e05b4ab77f917b2ab671341d27c48daebba5a6d8d49003ad ssa_ast: f7f6d516d3d01bc703ab69bf46ce406b23ed581fe6ac787493875797fd199fcf - flattened_ast: 6ac643e9283a95511c63e0a8bbd173e9b0f0cf3d1c2342a078997b694f921e43 - inlined_ast: 7c1716bb297cfc2d8ff3fb78919cb3095b8491326dd144a841e9261f2c416159 - dce_ast: 7c1716bb297cfc2d8ff3fb78919cb3095b8491326dd144a841e9261f2c416159 + flattened_ast: cf4311dbcd61fa660750f9b64e0638d55546e5fb42d937f7c7642e80dd4d6b77 + inlined_ast: 6d649cc15fdcb5fe82d52e0fa24d3f1b1a5ea66fef091cbd82c760ff74715507 + dce_ast: 6d649cc15fdcb5fe82d52e0fa24d3f1b1a5ea66fef091cbd82c760ff74715507 bytecode: a0b5126f2fda64d2ee08377b08a787af8dcdb825268db2acf45a4a9d94dd8887 warnings: "" diff --git a/tests/expectations/compiler/function/program_function_any_number_of_inputs_and_outputs.out b/tests/expectations/compiler/function/program_function_any_number_of_inputs_and_outputs.out index 6182637cef..b24c49da0e 100644 --- a/tests/expectations/compiler/function/program_function_any_number_of_inputs_and_outputs.out +++ b/tests/expectations/compiler/function/program_function_any_number_of_inputs_and_outputs.out @@ -8,8 +8,8 @@ outputs: initial_ast: 597e2a8548c8eeba743344f950f86f7fba212e067bf2b43b10e8a3a561c0d843 unrolled_ast: 597e2a8548c8eeba743344f950f86f7fba212e067bf2b43b10e8a3a561c0d843 ssa_ast: 018ca08360aaf9afe9af2c6a2fd4cc024f34a3cc4b03951b43a65007db36ea4c - flattened_ast: f60f09089eab491f86e783e81c929df84f5d8b3be8f3018efb23c426f07deb18 - inlined_ast: f60f09089eab491f86e783e81c929df84f5d8b3be8f3018efb23c426f07deb18 - dce_ast: f60f09089eab491f86e783e81c929df84f5d8b3be8f3018efb23c426f07deb18 + flattened_ast: c1095ac245e5643101c8df09829f1e035a8bf12835159a1cf63133307a875ede + inlined_ast: c1095ac245e5643101c8df09829f1e035a8bf12835159a1cf63133307a875ede + dce_ast: c1095ac245e5643101c8df09829f1e035a8bf12835159a1cf63133307a875ede bytecode: eac5d0cfbac44a017f12d12a655088f7aa15d0567afa771b5ff8d83ba7a9eacd warnings: "" diff --git a/tests/expectations/compiler/function/program_function_empty_body.out b/tests/expectations/compiler/function/program_function_empty_body.out index 32d2b89408..0079396421 100644 --- a/tests/expectations/compiler/function/program_function_empty_body.out +++ b/tests/expectations/compiler/function/program_function_empty_body.out @@ -8,8 +8,8 @@ outputs: initial_ast: 6e4112e81bff4d0d22eae2ec8692e2d54c581eca65c69b9ca816a5f2c83a5e16 unrolled_ast: 6e4112e81bff4d0d22eae2ec8692e2d54c581eca65c69b9ca816a5f2c83a5e16 ssa_ast: 6e4112e81bff4d0d22eae2ec8692e2d54c581eca65c69b9ca816a5f2c83a5e16 - flattened_ast: 3369bb6decf2d1b40dcfcc6238e1e5f8c51a74b924f3d48528418752874ab2e4 - inlined_ast: 3369bb6decf2d1b40dcfcc6238e1e5f8c51a74b924f3d48528418752874ab2e4 - dce_ast: 3369bb6decf2d1b40dcfcc6238e1e5f8c51a74b924f3d48528418752874ab2e4 + flattened_ast: defc8970989532f165b51332398e9e5068fd87e6575df5490ba5ec53113d19f4 + inlined_ast: defc8970989532f165b51332398e9e5068fd87e6575df5490ba5ec53113d19f4 + dce_ast: defc8970989532f165b51332398e9e5068fd87e6575df5490ba5ec53113d19f4 bytecode: abc411306856bb13d787153cb890d742f962dfe924477954c427b7a3ab4e279b warnings: "" diff --git a/tests/expectations/compiler/function/program_function_unit_type.out b/tests/expectations/compiler/function/program_function_unit_type.out index a88eaab03e..5ff3079df2 100644 --- a/tests/expectations/compiler/function/program_function_unit_type.out +++ b/tests/expectations/compiler/function/program_function_unit_type.out @@ -8,8 +8,8 @@ outputs: initial_ast: bfd997015c96eb3d92c5f9057b6370ae3938578b492dbed7b97175afdbd471b1 unrolled_ast: bfd997015c96eb3d92c5f9057b6370ae3938578b492dbed7b97175afdbd471b1 ssa_ast: bfd997015c96eb3d92c5f9057b6370ae3938578b492dbed7b97175afdbd471b1 - flattened_ast: f2668a546196da9b76d1d2d951fa6f5538832fe2915c3d009ea00b385c5dc230 - inlined_ast: f2668a546196da9b76d1d2d951fa6f5538832fe2915c3d009ea00b385c5dc230 - dce_ast: f2668a546196da9b76d1d2d951fa6f5538832fe2915c3d009ea00b385c5dc230 + flattened_ast: c8911d3b90a47b2409ef8a009a0b355fe1a0bd015eb771dc95f30743e1294607 + inlined_ast: c8911d3b90a47b2409ef8a009a0b355fe1a0bd015eb771dc95f30743e1294607 + dce_ast: c8911d3b90a47b2409ef8a009a0b355fe1a0bd015eb771dc95f30743e1294607 bytecode: 8ed93150ef7e3de74faaace88f995a65373e73428068d75142100775684d2fe7 warnings: "" diff --git a/tests/expectations/compiler/signature/signature.out b/tests/expectations/compiler/signature/signature.out index 94cb2be7e5..2986d25f9e 100644 --- a/tests/expectations/compiler/signature/signature.out +++ b/tests/expectations/compiler/signature/signature.out @@ -8,8 +8,8 @@ outputs: initial_ast: ab0cb67645b250671bca5968fe522eb4f201775566e3e956309218a1a01eb834 unrolled_ast: ab0cb67645b250671bca5968fe522eb4f201775566e3e956309218a1a01eb834 ssa_ast: 89375f09d78e40217ba576195030f370424468fc2b2aa7d38197a7170cbc023a - flattened_ast: 884d648d416cdd025093fdc0e75270bfaf4c5580c44dd9005372b3773945e316 - inlined_ast: 884d648d416cdd025093fdc0e75270bfaf4c5580c44dd9005372b3773945e316 - dce_ast: 68df439c9525fe3c6b88492eb99cddbaf8a6885273c6405114ab7766d845c9d1 + flattened_ast: d7e4bdd511532274071ea34360a138bbe7b31b3318d2142a5c26430ff10573e1 + inlined_ast: d7e4bdd511532274071ea34360a138bbe7b31b3318d2142a5c26430ff10573e1 + dce_ast: 9e740313ba0d3568fd24cd823fca8482a913cf529aa09d149bb79c779b4da79d bytecode: 9a042a6076c83bb376f10443261e56704956030b03df62da5d5f4742ac10c74d warnings: "" diff --git a/tests/expectations/compiler/statements/expr_statement.out b/tests/expectations/compiler/statements/expr_statement.out index 23fddc9f85..0b9325ae80 100644 --- a/tests/expectations/compiler/statements/expr_statement.out +++ b/tests/expectations/compiler/statements/expr_statement.out @@ -8,8 +8,8 @@ outputs: initial_ast: 390ca0534c956091498dfbd21c69e694b39ff75ac159557a68f5223c71a88f34 unrolled_ast: 390ca0534c956091498dfbd21c69e694b39ff75ac159557a68f5223c71a88f34 ssa_ast: b5bf05bee18d5505dbdb95f834951ea4c157e5518b0e54cfc193a6032d515673 - flattened_ast: d8305cce775e1f49e14c1247d4686ae3e0bf4199237e803f9af5228204ab377a - inlined_ast: d8305cce775e1f49e14c1247d4686ae3e0bf4199237e803f9af5228204ab377a - dce_ast: d8305cce775e1f49e14c1247d4686ae3e0bf4199237e803f9af5228204ab377a + flattened_ast: 734d819ed50d1b4b8b4f46a1b2229ef923dab5e55e5ade9d2d939bad24ebc94d + inlined_ast: 734d819ed50d1b4b8b4f46a1b2229ef923dab5e55e5ade9d2d939bad24ebc94d + dce_ast: 734d819ed50d1b4b8b4f46a1b2229ef923dab5e55e5ade9d2d939bad24ebc94d bytecode: 401bb4388cffbc9e0df078a93024b669f7de284cfe97f564143486a27cb070ab warnings: "" diff --git a/tests/expectations/compiler/tuple/unit.out b/tests/expectations/compiler/tuple/unit.out index f1b9352486..9113b2edf8 100644 --- a/tests/expectations/compiler/tuple/unit.out +++ b/tests/expectations/compiler/tuple/unit.out @@ -8,8 +8,8 @@ outputs: initial_ast: 61976506c1795a42c31fb9b9d30f3dcde699dd531011641608345c889ca94ba0 unrolled_ast: 61976506c1795a42c31fb9b9d30f3dcde699dd531011641608345c889ca94ba0 ssa_ast: 61976506c1795a42c31fb9b9d30f3dcde699dd531011641608345c889ca94ba0 - flattened_ast: a09ec744e070a0931c9af858ed94f83c09c5ddcf5c2b664bcb85c4f7dbe71d59 - inlined_ast: a09ec744e070a0931c9af858ed94f83c09c5ddcf5c2b664bcb85c4f7dbe71d59 - dce_ast: a09ec744e070a0931c9af858ed94f83c09c5ddcf5c2b664bcb85c4f7dbe71d59 + flattened_ast: cdc3a1136330c192fc6d929c49fd3a614bda0fc573b753c50433ac9cc3185260 + inlined_ast: cdc3a1136330c192fc6d929c49fd3a614bda0fc573b753c50433ac9cc3185260 + dce_ast: cdc3a1136330c192fc6d929c49fd3a614bda0fc573b753c50433ac9cc3185260 bytecode: 0b868939da4554de26106307f8749db7e5c629b71ec06c0870b138bc7ffabad4 warnings: "" diff --git a/tests/expectations/execution/counter.out b/tests/expectations/execution/counter.out index 54a9728759..7866b86465 100644 --- a/tests/expectations/execution/counter.out +++ b/tests/expectations/execution/counter.out @@ -8,9 +8,9 @@ outputs: initial_ast: 5e6213c6449862e08e395bf930911f84cf9a4fef38817908de100336191b2f4a unrolled_ast: 46f0aa90dbb7f0e4e8dbb4c1d618eeb2c2fc65f0d95c87ef98421ab5934a8d8c ssa_ast: 645d8ddd30de2f2c176b46e16a9ee79ea9c3e4ba5896e0b9103714baaad44794 - flattened_ast: 5109c9f62312f616bb3f381a85915b53de1f60221ce12aafb0e55f232e7ac72a - inlined_ast: 5109c9f62312f616bb3f381a85915b53de1f60221ce12aafb0e55f232e7ac72a - dce_ast: 5109c9f62312f616bb3f381a85915b53de1f60221ce12aafb0e55f232e7ac72a + flattened_ast: 1b5ef82de138d94ca44cd60c27cdf8d8e035183f41bdfc9a9a7624ea036e186f + inlined_ast: 1b5ef82de138d94ca44cd60c27cdf8d8e035183f41bdfc9a9a7624ea036e186f + dce_ast: 1b5ef82de138d94ca44cd60c27cdf8d8e035183f41bdfc9a9a7624ea036e186f bytecode: 75252a5477a2943c07eaf114bef3dd214acbd7184b3118f14786beb8215bfb94 warnings: "" results: