From 2314f66cab9321388ea228df0f88661cb82df41d Mon Sep 17 00:00:00 2001 From: CohenArthur Date: Fri, 29 Mar 2024 17:49:55 +0100 Subject: [PATCH] section_mangler: Add .name() method --- compiler/section_mangler/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/section_mangler/src/lib.rs b/compiler/section_mangler/src/lib.rs index 05ffea5706..6e67855320 100644 --- a/compiler/section_mangler/src/lib.rs +++ b/compiler/section_mangler/src/lib.rs @@ -77,6 +77,13 @@ impl SectionMangler { SectionMangler::Variable(VariableMangler { name: name.into(), ty }) } + pub fn name(&self) -> &str { + match self { + SectionMangler::Function(FunctionMangler { name, .. }) + | SectionMangler::Variable(VariableMangler { name, .. }) => name, + } + } + pub fn with_parameter(self, param: FunctionArgument) -> SectionMangler { match self { SectionMangler::Function(f) => {