diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2019-09-28 17:59:27 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2019-10-03 18:55:01 +0200 |
| commit | 58a9b648e830bef11864db8f657a2eac944ea552 (patch) | |
| tree | 06fe2bb3adc9f12040ef404f05259a688f3b484b /src/allocator.rs | |
| parent | 8cee28db3e3a585022666bc0cec3b6702a448f65 (diff) | |
| download | rust-58a9b648e830bef11864db8f657a2eac944ea552.tar.gz rust-58a9b648e830bef11864db8f657a2eac944ea552.zip | |
Update cranelift, faerie and target-lexicon
Diffstat (limited to 'src/allocator.rs')
| -rw-r--r-- | src/allocator.rs | 11 |
1 files changed, 6 insertions, 5 deletions
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<impl Backend + 'static> .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<impl Backend + 'static> 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(); } } |
