From de39e7f4d120563ee5f4f1a9c1b29040ea3ad7c2 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Fri, 12 Feb 2021 23:48:23 -0500 Subject: [PATCH] [spv-in] patch function calls before deriving the global use --- src/front/spv/function.rs | 1 + src/front/spv/mod.rs | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/front/spv/function.rs b/src/front/spv/function.rs index 0ffbbf8e9..c3c2045f1 100644 --- a/src/front/spv/function.rs +++ b/src/front/spv/function.rs @@ -146,6 +146,7 @@ impl> super::Parser { fun.body = flow_graph.to_naga()?; // done + self.patch_function_calls(&mut fun)?; fun.fill_global_use(module.global_variables.len(), &module.functions); let dump_suffix = match self.lookup_entry_point.remove(&fun_id) { diff --git a/src/front/spv/mod.rs b/src/front/spv/mod.rs index f8945c6ea..a57d031a5 100644 --- a/src/front/spv/mod.rs +++ b/src/front/spv/mod.rs @@ -1689,13 +1689,6 @@ impl> Parser { } } - for (_, func) in module.functions.iter_mut() { - self.patch_function_calls(func)?; - } - for (_, ep) in module.entry_points.iter_mut() { - self.patch_function_calls(&mut ep.function)?; - } - if !self.future_decor.is_empty() { log::warn!("Unused item decorations: {:?}", self.future_decor); self.future_decor.clear();