Skip to content

Commit

Permalink
section_mangler: Add .name() method
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Apr 12, 2024
1 parent 48b88b4 commit 2314f66
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions compiler/section_mangler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 2314f66

Please sign in to comment.