From 175b9641e03fcbc09b993ec2e51723e7bac35731 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Mon, 20 Jan 2020 08:29:05 -0500 Subject: [PATCH] frontend: Add `entries()` API for Switch (#1358) --- cranelift/frontend/src/switch.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cranelift/frontend/src/switch.rs b/cranelift/frontend/src/switch.rs index 25cba38ac3..e4c147d16b 100644 --- a/cranelift/frontend/src/switch.rs +++ b/cranelift/frontend/src/switch.rs @@ -62,6 +62,11 @@ impl Switch { ); } + /// Get a reference to all existing entries + pub fn entries(&self) -> &HashMap { + &self.cases + } + /// Turn the `cases` `HashMap` into a list of `ContiguousCaseRange`s. /// /// # Postconditions