Skip to content

Commit 2bcc936

Browse files
committed
Remove all uses of Function::with_name_signature
The current main branch of Cranelift changed it's signature. Removing it's use is the easiest way to deal with this.
1 parent 0966118 commit 2bcc936

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/allocator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn codegen_inner(
7878
let callee_func_id = module.declare_function(&callee_name, Linkage::Import, &sig).unwrap();
7979

8080
let mut ctx = Context::new();
81-
ctx.func = Function::with_name_signature(ExternalName::user(0, 0), sig.clone());
81+
ctx.func.signature = sig.clone();
8282
{
8383
let mut func_ctx = FunctionBuilderContext::new();
8484
let mut bcx = FunctionBuilder::new(&mut ctx.func, &mut func_ctx);
@@ -116,7 +116,7 @@ fn codegen_inner(
116116
let callee_func_id = module.declare_function(callee_name, Linkage::Import, &sig).unwrap();
117117

118118
let mut ctx = Context::new();
119-
ctx.func = Function::with_name_signature(ExternalName::user(0, 0), sig);
119+
ctx.func.signature = sig;
120120
{
121121
let mut func_ctx = FunctionBuilderContext::new();
122122
let mut bcx = FunctionBuilder::new(&mut ctx.func, &mut func_ctx);

src/main_shim.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub(crate) fn maybe_create_entry_wrapper(
7474
let main_func_id = m.declare_function(main_name, Linkage::Import, &main_sig).unwrap();
7575

7676
let mut ctx = Context::new();
77-
ctx.func = Function::with_name_signature(ExternalName::user(0, 0), cmain_sig);
77+
ctx.func.signature = cmain_sig;
7878
{
7979
let mut func_ctx = FunctionBuilderContext::new();
8080
let mut bcx = FunctionBuilder::new(&mut ctx.func, &mut func_ctx);

0 commit comments

Comments
 (0)