MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / function

Function function

crates/hll-to-ir/src/compiler/opt/dce.rs:158–167  ·  view source on GitHub ↗
(instructions: Vec<IrInstruction>, term: IrTerminator)

Source from the content-addressed store, hash-verified

156 }
157
158 fn function(instructions: Vec<IrInstruction>, term: IrTerminator) -> IrFunction {
159 let mut func = IrFunction::new("f", i32_ty());
160 let mut block = IrBlock::new("entry");
161 for inst in instructions {
162 block.push_instruction(inst);
163 }
164 block.set_terminator(term);
165 func.push_block(block);
166 func
167 }
168
169 #[test]
170 fn removes_unused_pure_chain() {

Callers 4

keeps_unused_loadFunction · 0.85

Calls 4

push_blockMethod · 0.80
i32_tyFunction · 0.70
push_instructionMethod · 0.45
set_terminatorMethod · 0.45

Tested by 4

keeps_unused_loadFunction · 0.68