From 31b85ce39aae674c5b13cc382d2e5c131982cba9 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Sun, 27 Sep 2026 13:36:14 -0700 Subject: [PATCH] Make passes::empty_blocks::run public. This turns out to be useful to consumers of waffle to run directly (not just as part of the full compilation pipeline). --- src/passes/empty_blocks.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/passes/empty_blocks.rs b/src/passes/empty_blocks.rs index c9fb8cd..59e65e7 100644 --- a/src/passes/empty_blocks.rs +++ b/src/passes/empty_blocks.rs @@ -37,7 +37,10 @@ fn rewrite_target( forwardings[target.block.index()].clone() } -pub(crate) fn run(body: &mut FunctionBody) { +/// Run the empty-blocks pass, removing empty blocks (those that consist +/// of only a direct-jump terminator) and threading through their +/// blockparams to their terminator's target. +pub fn run(body: &mut FunctionBody) { log::trace!( "empty_blocks: running on func:\n{}\n", body.display_verbose("| ", None)