Skip to content

Commit

Permalink
Auto merge of #26595 - dotdash:fca_slice, r=eddyb
Browse files Browse the repository at this point in the history
Storing them as FCAs is a regression from the recent change that made
fat pointers immediate return values so that they are passed in
registers instead of memory.
  • Loading branch information
bors committed Jun 26, 2015
2 parents 378a370 + 2051b3e commit 2cb8a31
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/librustc_trans/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,9 +832,14 @@ pub fn store_ty<'blk, 'tcx>(cx: Block<'blk, 'tcx>, v: ValueRef, dst: ValueRef, t
return;
}

let store = Store(cx, from_arg_ty(cx, v, t), to_arg_ty_ptr(cx, dst, t));
unsafe {
llvm::LLVMSetAlignment(store, type_of::align_of(cx.ccx(), t));
if common::type_is_fat_ptr(cx.tcx(), t) {
Store(cx, ExtractValue(cx, v, abi::FAT_PTR_ADDR), expr::get_dataptr(cx, dst));
Store(cx, ExtractValue(cx, v, abi::FAT_PTR_EXTRA), expr::get_len(cx, dst));
} else {
let store = Store(cx, from_arg_ty(cx, v, t), to_arg_ty_ptr(cx, dst, t));
unsafe {
llvm::LLVMSetAlignment(store, type_of::align_of(cx.ccx(), t));
}
}
}

Expand Down

0 comments on commit 2cb8a31

Please sign in to comment.