Update compiler/passes/src/function_inlining/inline_program.rs

Signed-off-by: d0cd <pranavsaig@gmail.com>
This commit is contained in:
d0cd 2023-10-04 00:15:49 -04:00 committed by evan-schott
parent 70e055773d
commit f6a8f46dee

View File

@ -37,8 +37,7 @@ impl ProgramReconstructor for FunctionInliner<'_> {
for function_name in order.into_iter() {
// None: If `function_name` is not in `input.functions`, then it must be an external function.
// TODO: Check that this is indeed an external function. Requires a redesign of the symbol table.
if let Some(function) = function_map.get(&function_name) {
function_set.remove(&function_name);
if let Some(function) = function_map.remove(&function_name) {
// Reconstruct the function.
let reconstructed_function = self.reconstruct_function(function.clone());
// Add the reconstructed function to the mapping.