diff options
| author | Graydon Hoare <[email protected]> | 2010-11-12 11:48:18 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-11-12 11:48:18 -0800 |
| commit | 2ff0662eaef0af2a7a0173e5da53fe271c217e38 (patch) | |
| tree | 888da5a57fd9665ddbf61ee920b0186022b16e54 | |
| parent | Stop translating a block when a sub-statement terminates the llvm bb. (diff) | |
| download | rust-2ff0662eaef0af2a7a0173e5da53fe271c217e38.tar.xz rust-2ff0662eaef0af2a7a0173e5da53fe271c217e38.zip | |
Load outptr alloca as retval; function call/return now works in rustc.
| -rw-r--r-- | src/comp/middle/trans.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 17d1a141..82098935 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -917,13 +917,17 @@ impure fn trans_expr(@block_ctxt cx, &ast.expr e) -> result { case (ast.item_fn(_, ?ff, _, _)) { outptr = cx.build.Alloca(type_of(cx.fcx.tcx, ff.output)); } + case (_) { + cx.fcx.tcx.sess.unimpl("call to non-item"); + } } auto args_res = trans_exprs(f_res._0.bcx, args); auto llargs = vec(outptr, cx.fcx.lltaskptr); llargs += args_res._1; + auto call_val = args_res._0.build.Call(f_res._0.val, llargs); ret res(args_res._0, - args_res._0.build.Call(f_res._0.val, llargs)); + args_res._0.build.Load(outptr)); } } |