Skip to content

Commit 4099953

Browse files
committed
---
yaml --- r: 81367 b: refs/heads/snap-stage3 c: f504461 h: refs/heads/master i: 81365: 761de97 81363: 53e517f 81359: 3a3f990 v: v3
1 parent 3cdaaa6 commit 4099953

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 249b356fb3dba0998dbaef34980c9dd1c1e42f48
4+
refs/heads/snap-stage3: f504461a40d0f6fd88983be6d744c8d62b430506
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/common.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ pub fn type_is_immediate(ccx: &mut CrateContext, ty: ty::t) -> bool {
6969
if simple {
7070
return true;
7171
}
72-
// FIXME: #9651: C-like enums should also be immediate
73-
if ty::type_is_c_like_enum(ccx.tcx, ty) {
74-
return false;
75-
}
7672
match ty::get(ty).sty {
7773
// FIXME: #9651: small `ty_struct` should also be immediate
7874
ty::ty_struct(def_id, ref substs) => {

branches/snap-stage3/src/librustc/middle/trans/expr.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,9 @@ fn trans_imm_cast(bcx: @mut Block, expr: &ast::Expr,
17271727
(cast_enum, cast_float) => {
17281728
let bcx = bcx;
17291729
let repr = adt::represent_type(ccx, t_in);
1730-
let lldiscrim_a = adt::trans_get_discr(bcx, repr, llexpr);
1730+
let slot = Alloca(bcx, ll_t_in, "");
1731+
Store(bcx, llexpr, slot);
1732+
let lldiscrim_a = adt::trans_get_discr(bcx, repr, slot);
17311733
match k_out {
17321734
cast_integral => int_cast(bcx, ll_t_out,
17331735
val_ty(lldiscrim_a),

branches/snap-stage3/src/librustc/middle/trans/foreign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ pub fn trans_native_call(bcx: @mut Block,
222222
// Ensure that we always have the Rust value indirectly,
223223
// because it makes bitcasting easier.
224224
if !rust_indirect {
225-
let scratch = base::alloca(bcx, arg_tys[i].ty, "__arg");
225+
let scratch = base::alloca(bcx, type_of::type_of(ccx, fn_sig.inputs[i]), "__arg");
226226
Store(bcx, llarg_rust, scratch);
227227
llarg_rust = scratch;
228228
}

branches/snap-stage3/src/librustc/middle/trans/intrinsic.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
use back::{abi};
1414
use lib::llvm::{SequentiallyConsistent, Acquire, Release, Xchg};
15-
use lib::llvm::{ValueRef, Pointer};
15+
use lib::llvm::{ValueRef, Pointer, Array, Struct};
1616
use lib;
1717
use middle::trans::base::*;
1818
use middle::trans::build::*;
@@ -333,8 +333,12 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
333333
(Pointer, other) | (other, Pointer) if other != Pointer => {
334334
let tmp = Alloca(bcx, llouttype, "");
335335
Store(bcx, llsrcval, PointerCast(bcx, tmp, llintype.ptr_to()));
336-
let ll_load = Load(bcx, tmp);
337-
Ret(bcx, ll_load);
336+
Ret(bcx, Load(bcx, tmp));
337+
}
338+
(Array, _) | (_, Array) | (Struct, _) | (_, Struct) => {
339+
let tmp = Alloca(bcx, llouttype, "");
340+
Store(bcx, llsrcval, PointerCast(bcx, tmp, llintype.ptr_to()));
341+
Ret(bcx, Load(bcx, tmp));
338342
}
339343
_ => {
340344
let llbitcast = BitCast(bcx, llsrcval, llouttype);

0 commit comments

Comments
 (0)