From 58a9b648e830bef11864db8f657a2eac944ea552 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 28 Sep 2019 17:59:27 +0200 Subject: Update cranelift, faerie and target-lexicon --- src/allocator.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/allocator.rs') diff --git a/src/allocator.rs b/src/allocator.rs index c4222a858ab..29e3ceb3a5a 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -73,8 +73,10 @@ pub fn codegen_inner(sess: &Session, module: &mut Module .unwrap(); let mut ctx = Context::new(); - ctx.func = { - let mut bcx = FunctionBuilder::new(Function::with_name_signature(ExternalName::user(0, 0), sig.clone())); + ctx.func = Function::with_name_signature(ExternalName::user(0, 0), sig.clone()); + { + let mut func_ctx = FunctionBuilderContext::new(); + let mut bcx = FunctionBuilder::new(&mut ctx.func, &mut func_ctx); let ebb = bcx.create_ebb(); bcx.switch_to_block(ebb); @@ -90,9 +92,8 @@ pub fn codegen_inner(sess: &Session, module: &mut Module let results = bcx.inst_results(call_inst).to_vec(); // Clone to prevent borrow error bcx.ins().return_(&results); bcx.seal_all_blocks(); - bcx.finalize() - }; - + bcx.finalize(); + } module.define_function(func_id, &mut ctx).unwrap(); } } -- cgit 1.4.1-3-g733a5