(
&mut self,
caller: &ir::Function,
_inst: ir::Inst,
_opcode: ir::Opcode,
callee: ir::FuncRef,
_args: &[ir::Value],
)
| 121 | |
| 122 | impl<'a> Inline for Inliner<'a> { |
| 123 | fn inline( |
| 124 | &mut self, |
| 125 | caller: &ir::Function, |
| 126 | _inst: ir::Inst, |
| 127 | _opcode: ir::Opcode, |
| 128 | callee: ir::FuncRef, |
| 129 | _args: &[ir::Value], |
| 130 | ) -> InlineCommand<'_> { |
| 131 | match &caller.dfg.ext_funcs[callee].name { |
| 132 | ir::ExternalName::User(name) => match caller |
| 133 | .params |
| 134 | .user_named_funcs() |
| 135 | .get(*name) |
| 136 | .and_then(|name| self.0.get(&ir::UserFuncName::User(name.clone()))) |
| 137 | { |
| 138 | None => InlineCommand::KeepCall, |
| 139 | Some(f) => InlineCommand::Inline { |
| 140 | callee: Cow::Borrowed(f), |
| 141 | visit_callee: true, |
| 142 | }, |
| 143 | }, |
| 144 | ir::ExternalName::TestCase(name) => { |
| 145 | match self.0.get(&ir::UserFuncName::Testcase(name.clone())) { |
| 146 | None => InlineCommand::KeepCall, |
| 147 | Some(f) => InlineCommand::Inline { |
| 148 | callee: Cow::Borrowed(f), |
| 149 | visit_callee: true, |
| 150 | }, |
| 151 | } |
| 152 | } |
| 153 | ir::ExternalName::LibCall(_) | ir::ExternalName::KnownSymbol(_) => { |
| 154 | InlineCommand::KeepCall |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | } |
no test coverage detected