diff options
| author | bors <bors@rust-lang.org> | 2015-06-26 15:07:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-06-26 15:07:27 +0000 |
| commit | 2cb8a31e7cea1ee499630c9c6744dedd0c0b371f (patch) | |
| tree | 563351a2b2d5e5538648d697f1a8a65aa0585e93 | |
| parent | 378a370ff2057afeb1eae86eb6e78c476866a4a6 (diff) | |
| parent | 2051b3e28fc245b44d82336cca31b25bbd637688 (diff) | |
Auto merge of #26595 - dotdash:fca_slice, r=eddyb
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.
| -rw-r--r-- | src/librustc_trans/trans/base.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index 461739a362d..7a37a3e5ee4 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -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)); + } } } |
