Lines Matching refs:func
21 func: &Function, in write_block_header()
30 func: &Function, in write_instruction()
37 fn write_preamble(&mut self, w: &mut dyn Write, func: &Function) -> Result<bool, fmt::Error> { in write_preamble()
38 self.super_preamble(w, func) in write_preamble()
42 fn super_preamble(&mut self, w: &mut dyn Write, func: &Function) -> Result<bool, fmt::Error> { in super_preamble()
45 for (ss, slot) in func.dynamic_stack_slots.iter() { in super_preamble()
47 self.write_entity_definition(w, func, ss.into(), slot)?; in super_preamble()
50 for (ss, slot) in func.sized_stack_slots.iter() { in super_preamble()
52 self.write_entity_definition(w, func, ss.into(), slot)?; in super_preamble()
55 for (gv, gv_data) in &func.global_values { in super_preamble()
57 self.write_entity_definition(w, func, gv.into(), gv_data)?; in super_preamble()
62 for (sig, sig_data) in &func.dfg.signatures { in super_preamble()
64 self.write_entity_definition(w, func, sig.into(), &sig_data)?; in super_preamble()
67 for (fnref, ext_func) in &func.dfg.ext_funcs { in super_preamble()
72 func, in super_preamble()
74 &ext_func.display(Some(&func.params)), in super_preamble()
79 for (&cref, cval) in func.dfg.constants.iter() { in super_preamble()
81 self.write_entity_definition(w, func, cref.into(), cval)?; in super_preamble()
84 if let Some(limit) = func.stack_limit { in super_preamble()
86 self.write_entity_definition(w, func, AnyEntity::StackLimit, &limit)?; in super_preamble()
96 func: &Function, in write_entity_definition()
100 self.super_entity_definition(w, func, entity, value) in write_entity_definition()
122 func: &Function, in write_instruction()
127 write_instruction(w, func, aliases, inst, indent) in write_instruction()
133 func: &Function, in write_block_header()
137 write_block_header(w, func, block, indent) in write_block_header()
143 pub fn write_function(w: &mut dyn Write, func: &Function) -> fmt::Result { in write_function()
144 decorate_function(&mut PlainWriter, w, func) in write_function()
148 fn alias_map(func: &Function) -> SecondaryMap<Value, Vec<Value>> { in alias_map()
150 for v in func.dfg.values() { in alias_map()
152 if let Some(k) = func.dfg.value_alias_dest_for_serialization(v) { in alias_map()
165 func: &Function, in decorate_function()
168 write_function_spec(w, func)?; in decorate_function()
170 let aliases = alias_map(func); in decorate_function()
171 let mut any = func_w.write_preamble(w, func)?; in decorate_function()
172 for block in &func.layout { in decorate_function()
176 decorate_block(func_w, w, func, &aliases, block)?; in decorate_function()
187 pub fn write_function_spec(w: &mut dyn Write, func: &Function) -> fmt::Result { in write_function_spec()
188 write!(w, "{}{}", func.name, func.signature) in write_function_spec()
195 fn write_arg(w: &mut dyn Write, func: &Function, arg: Value) -> fmt::Result { in write_arg()
196 let ty = func.dfg.value_type(arg); in write_arg()
208 func: &Function, in write_block_header()
212 let cold = if func.layout.is_cold(block) { in write_block_header()
221 let mut args = func.dfg.block_params(block).iter().cloned(); in write_block_header()
226 write_arg(w, func, arg)?; in write_block_header()
232 write_arg(w, func, arg)?; in write_block_header()
240 func: &Function, in decorate_block()
245 let indent = if func.rel_srclocs().is_empty() && func.debug_tags.is_empty() { in decorate_block()
251 func_w.write_block_header(w, func, block, indent)?; in decorate_block()
252 for a in func.dfg.block_params(block).iter().cloned() { in decorate_block()
256 for inst in func.layout.block_insts(block) { in decorate_block()
257 func_w.write_instruction(w, func, aliases, inst, indent)?; in decorate_block()
272 fn type_suffix(func: &Function, inst: Inst) -> Option<Type> { in type_suffix()
273 let inst_data = &func.dfg.insts[inst]; in type_suffix()
283 let ctrl_var = inst_data.typevar_operand(&func.dfg.value_lists).unwrap(); in type_suffix()
284 let def_block = match func.dfg.value_def(ctrl_var) { in type_suffix()
285 ValueDef::Result(instr, _) => func.layout.inst_block(instr), in type_suffix()
289 if def_block.is_some() && def_block == func.layout.inst_block(inst) { in type_suffix()
294 let rtype = func.dfg.ctrl_typevar(inst); in type_suffix()
322 func: &Function, in write_instruction()
331 let srcloc = func.srcloc(inst); in write_instruction()
337 write_debug_tags(w, &func, inst, &mut indent)?; in write_instruction()
344 for r in func.dfg.inst_results(inst) { in write_instruction()
357 let opcode = func.dfg.insts[inst].opcode(); in write_instruction()
359 match type_suffix(func, inst) { in write_instruction()
364 write_operands(w, &func.dfg, inst)?; in write_instruction()
368 for r in func.dfg.inst_results(inst) { in write_instruction()
565 func: &Function, in write_debug_tags()
569 let tags = func.debug_tags.get(inst); in write_debug_tags()
679 let mut func = Function::new(); in aliases() localVariable
681 let block0 = func.dfg.make_block(); in aliases()
682 let mut pos = FuncCursor::new(&mut func); in aliases()
686 let v0 = pos.func.dfg.append_block_param(block0, types::I32); in aliases()
687 let v1 = pos.func.dfg.append_block_param(block0, types::I32); in aliases()
688 let v2 = pos.func.dfg.append_block_param(block0, types::I32); in aliases()
689 pos.func.dfg.detach_block_params(block0); in aliases()
692 let v3 = pos.func.dfg.append_block_param(block0, types::I32); in aliases()
693 pos.func.dfg.change_to_alias(v0, v3); in aliases()
696 pos.func.dfg.make_value_alias_for_serialization(v0, v2); // v0 <- v2 in aliases()
701 pos.func.dfg.change_to_alias(v1, v4); in aliases()
706 func.to_string(), in aliases()
713 let mut func = Function::new(); in cold_blocks() localVariable
715 let mut pos = FuncCursor::new(&mut func); in cold_blocks()
717 let block0 = pos.func.dfg.make_block(); in cold_blocks()
719 pos.func.layout.set_cold(block0); in cold_blocks()
721 let block1 = pos.func.dfg.make_block(); in cold_blocks()
723 pos.func.dfg.append_block_param(block1, types::I32); in cold_blocks()
724 pos.func.layout.set_cold(block1); in cold_blocks()
728 func.to_string(), in cold_blocks()