Build an empty function with a single return.
()
| 122 | |
| 123 | /// Build an empty function with a single return. |
| 124 | fn empty_function() -> Function { |
| 125 | let mut func = Function::new(); |
| 126 | let mut context = FunctionBuilderContext::new(); |
| 127 | let mut builder = FunctionBuilder::new(&mut func, &mut context); |
| 128 | let block = builder.create_block(); |
| 129 | builder.switch_to_block(block); |
| 130 | builder.ins().return_(&[]); |
| 131 | func |
| 132 | } |
| 133 | |
| 134 | #[test] |
| 135 | fn construction() { |