MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / empty_function

Function empty_function

cranelift/interpreter/src/frame.rs:124–132  ·  view source on GitHub ↗

Build an empty function with a single return.

()

Source from the content-addressed store, hash-verified

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() {

Callers 2

constructionFunction · 0.85

Calls 4

create_blockMethod · 0.80
switch_to_blockMethod · 0.80
newFunction · 0.50
insMethod · 0.45

Tested by 1

constructionFunction · 0.68