Retrieve a function name from a [FuncRef] within a [Function]. TODO this should be optimized, if possible, as currently it retrieves the function name as a string and performs string matching.
(func_ref: FuncRef, function: &Function)
| 62 | /// Retrieve a function name from a [FuncRef] within a [Function]. TODO this should be optimized, if possible, as |
| 63 | /// currently it retrieves the function name as a string and performs string matching. |
| 64 | fn get_function_name(func_ref: FuncRef, function: &Function) -> String { |
| 65 | function |
| 66 | .stencil |
| 67 | .dfg |
| 68 | .ext_funcs |
| 69 | .get(func_ref) |
| 70 | .expect("function to exist") |
| 71 | .name |
| 72 | .display(Some(&function.params)) |
| 73 | .to_string() |
| 74 | } |
| 75 | |
| 76 | #[cfg(test)] |
| 77 | mod tests { |
no test coverage detected