diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2019-09-11 11:01:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-11 11:01:04 +0200 |
| commit | 71482b5ca6913a13bd017bb08f3ffb89f4c3ed9c (patch) | |
| tree | b7ece1432d4a40de18151ba0e547e389a09f82b9 /src/allocator.rs | |
| parent | b0e5c78ad2c4e0b7fba996e77972268c5a33a011 (diff) | |
| parent | 3a8dd34831904825ffaba50c1cbbf6343cb2059b (diff) | |
| download | rust-71482b5ca6913a13bd017bb08f3ffb89f4c3ed9c.tar.gz rust-71482b5ca6913a13bd017bb08f3ffb89f4c3ed9c.zip | |
Merge pull request #700 from bjorn3/upstream_cranelift
Use upstream cranelift
Diffstat (limited to 'src/allocator.rs')
| -rw-r--r-- | src/allocator.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/allocator.rs b/src/allocator.rs index b3b2b53444d..d4a1f1a49fa 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -73,10 +73,8 @@ pub fn codegen_inner(module: &mut Module<impl Backend + 'static>, kind: Allocato .unwrap(); let mut ctx = Context::new(); - 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); + ctx.func = { + let mut bcx = FunctionBuilder::new(Function::with_name_signature(ExternalName::user(0, 0), sig.clone())); let ebb = bcx.create_ebb(); bcx.switch_to_block(ebb); @@ -92,8 +90,9 @@ pub fn codegen_inner(module: &mut Module<impl Backend + 'static>, kind: Allocato 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(); } } |
