Skip to content

Commit 94a4e41

Browse files
committed
---
yaml --- r: 95158 b: refs/heads/dist-snap c: f504461 h: refs/heads/master v: v3
1 parent 81820b4 commit 94a4e41

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
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 249b356fb3dba0998dbaef34980c9dd1c1e42f48
9+
refs/heads/dist-snap: f504461a40d0f6fd88983be6d744c8d62b430506
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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)