Skip to content

Commit 30ef79c

Browse files
committed
auto merge of rust-lang#7851 : dotdash/rust/intrinsics, r=pcwalton
2 parents d300a64 + 15ea4a8 commit 30ef79c

File tree

2 files changed

+169
-350
lines changed

2 files changed

+169
-350
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,6 +1612,7 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
16121612
llfndecl: ValueRef,
16131613
id: ast::node_id,
16141614
output_type: ty::t,
1615+
skip_retptr: bool,
16151616
param_substs: Option<@param_substs>,
16161617
sp: Option<span>)
16171618
-> fn_ctxt {
@@ -1655,7 +1656,7 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
16551656
fcx.llenv = unsafe {
16561657
llvm::LLVMGetParam(llfndecl, fcx.env_arg_pos() as c_uint)
16571658
};
1658-
if !ty::type_is_nil(substd_output_type) {
1659+
if !ty::type_is_nil(substd_output_type) && !(is_immediate && skip_retptr) {
16591660
fcx.llretptr = Some(make_return_pointer(fcx, substd_output_type));
16601661
}
16611662
fcx
@@ -1667,7 +1668,7 @@ pub fn new_fn_ctxt(ccx: @mut CrateContext,
16671668
output_type: ty::t,
16681669
sp: Option<span>)
16691670
-> fn_ctxt {
1670-
new_fn_ctxt_w_id(ccx, path, llfndecl, -1, output_type, None, sp)
1671+
new_fn_ctxt_w_id(ccx, path, llfndecl, -1, output_type, false, None, sp)
16711672
}
16721673

16731674
// NB: must keep 4 fns in sync:
@@ -1861,6 +1862,7 @@ pub fn trans_closure(ccx: @mut CrateContext,
18611862
llfndecl,
18621863
id,
18631864
output_type,
1865+
false,
18641866
param_substs,
18651867
Some(body.span));
18661868
let raw_llargs = create_llargs_for_fn_args(fcx, self_arg, decl.inputs);
@@ -2079,6 +2081,7 @@ pub fn trans_enum_variant_or_tuple_like_struct<A:IdAndTy>(
20792081
llfndecl,
20802082
ctor_id,
20812083
result_ty,
2084+
false,
20822085
param_substs,
20832086
None);
20842087

0 commit comments

Comments
 (0)