Skip to content

Commit 145822d

Browse files
committed
---
yaml --- r: 82779 b: refs/heads/auto c: 11b7109 h: refs/heads/master i: 82777: 5cd5f32 82775: 89113c2 v: v3
1 parent e20f51a commit 145822d

File tree

18 files changed

+46
-65
lines changed

18 files changed

+46
-65
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 7ddcd2a745ab70b3d32249e35b753117b1312d15
16+
refs/heads/auto: 11b7109b7b3b1ad69d7137d1509fac7a8edda92e
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/tests.mk

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,6 @@ tidy:
261261
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
262262
$(Q)echo $(ALL_HS) \
263263
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
264-
$(Q)find $(S)src -type f -perm +111 \
265-
-not -name '*.rs' -and -not -name '*.py' \
266-
-and -not -name '*.sh' \
267-
| grep '^$(S)src/llvm' -v \
268-
| grep '^$(S)src/libuv' -v \
269-
| grep '^$(S)src/gyp' -v \
270-
| grep '^$(S)src/etc' -v \
271-
| grep '^$(S)src/rt/jemalloc' -v \
272-
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
273264

274265
endif
275266

branches/auto/src/etc/check-binaries.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

branches/auto/src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,13 +1121,13 @@ pub fn do_spill_noroot(cx: @mut Block, v: ValueRef) -> ValueRef {
11211121

11221122
pub fn spill_if_immediate(cx: @mut Block, v: ValueRef, t: ty::t) -> ValueRef {
11231123
let _icx = push_ctxt("spill_if_immediate");
1124-
if ty::type_is_immediate(cx.tcx(), t) { return do_spill(cx, v, t); }
1124+
if type_is_immediate(cx.tcx(), t) { return do_spill(cx, v, t); }
11251125
return v;
11261126
}
11271127

11281128
pub fn load_if_immediate(cx: @mut Block, v: ValueRef, t: ty::t) -> ValueRef {
11291129
let _icx = push_ctxt("load_if_immediate");
1130-
if ty::type_is_immediate(cx.tcx(), t) { return Load(cx, v); }
1130+
if type_is_immediate(cx.tcx(), t) { return Load(cx, v); }
11311131
return v;
11321132
}
11331133

branches/auto/src/librustc/middle/trans/common.rs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use driver::session;
1515
use driver::session::Session;
1616
use lib::llvm::{ValueRef, BasicBlockRef, BuilderRef};
1717
use lib::llvm::{True, False, Bool};
18-
use lib::llvm::{llvm};
18+
use lib::llvm::llvm;
1919
use lib;
2020
use middle::lang_items::LangItem;
2121
use middle::trans::base;
@@ -28,24 +28,43 @@ use middle::ty::substs;
2828
use middle::ty;
2929
use middle::typeck;
3030
use middle::borrowck::root_map_key;
31-
use util::ppaux::{Repr};
31+
use util::ppaux::Repr;
3232

3333
use middle::trans::type_::Type;
3434

3535
use std::c_str::ToCStr;
3636
use std::cast::transmute;
3737
use std::cast;
38-
use std::hashmap::{HashMap};
38+
use std::hashmap::HashMap;
3939
use std::libc::{c_uint, c_longlong, c_ulonglong, c_char};
4040
use std::vec;
41-
use syntax::ast::{Name,Ident};
41+
use syntax::ast::{Name, Ident};
4242
use syntax::ast_map::{path, path_elt, path_pretty_name};
4343
use syntax::codemap::Span;
4444
use syntax::parse::token;
4545
use syntax::{ast, ast_map};
4646

4747
pub use middle::trans::context::CrateContext;
4848

49+
fn type_is_newtype_immediate(cx: ty::ctxt, ty: ty::t) -> bool {
50+
match ty::get(ty).sty {
51+
ty::ty_struct(def_id, ref substs) => {
52+
let fields = ty::struct_fields(cx, def_id, substs);
53+
fields.len() == 1 &&
54+
fields[0].ident.name == token::special_idents::unnamed_field.name &&
55+
type_is_immediate(cx, fields[0].mt.ty)
56+
}
57+
_ => false
58+
}
59+
}
60+
61+
pub fn type_is_immediate(cx: ty::ctxt, ty: ty::t) -> bool {
62+
ty::type_is_scalar(ty) || ty::type_is_boxed(ty) ||
63+
ty::type_is_unique(ty) || ty::type_is_region_ptr(ty) ||
64+
type_is_newtype_immediate(cx, ty) ||
65+
ty::type_is_simd(cx, ty)
66+
}
67+
4968
pub fn gensym_name(name: &str) -> (Ident, path_elt) {
5069
let name = token::gensym(name);
5170
let ident = Ident::new(name);

branches/auto/src/librustc/middle/trans/datum.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ pub fn appropriate_mode(tcx: ty::ctxt, ty: ty::t) -> DatumMode {
197197

198198
if ty::type_is_voidish(ty) {
199199
ByValue
200-
} else if ty::type_is_immediate(tcx, ty) {
200+
} else if type_is_immediate(tcx, ty) {
201201
ByValue
202202
} else {
203203
ByRef(RevokeClean)
@@ -667,7 +667,7 @@ impl Datum {
667667
ByValue => {
668668
// Actually, this case cannot happen right
669669
// now, because enums are never immediate.
670-
assert!(ty::type_is_immediate(bcx.tcx(), ty));
670+
assert!(type_is_immediate(bcx.tcx(), ty));
671671
(Some(Datum {ty: ty, ..*self}), bcx)
672672
}
673673
};
@@ -699,7 +699,7 @@ impl Datum {
699699
)
700700
}
701701
ByValue => {
702-
assert!(ty::type_is_immediate(bcx.tcx(), ty));
702+
assert!(type_is_immediate(bcx.tcx(), ty));
703703
(
704704
Some(Datum {
705705
val: ExtractValue(bcx, self.val, 0),

branches/auto/src/librustc/middle/trans/intrinsic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
278278
"uninit" => {
279279
// Do nothing, this is effectively a no-op
280280
let retty = substs.tys[0];
281-
if ty::type_is_immediate(ccx.tcx, retty) && !ty::type_is_nil(retty) {
281+
if type_is_immediate(ccx.tcx, retty) && !ty::type_is_nil(retty) {
282282
unsafe {
283283
Ret(bcx, lib::llvm::llvm::LLVMGetUndef(type_of(ccx, retty).to_ref()));
284284
}
@@ -316,7 +316,7 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
316316

317317
if !ty::type_is_voidish(out_type) {
318318
let llsrcval = get_param(decl, first_real_arg);
319-
if ty::type_is_immediate(ccx.tcx, in_type) {
319+
if type_is_immediate(ccx.tcx, in_type) {
320320
match fcx.llretptr {
321321
Some(llretptr) => {
322322
Store(bcx, llsrcval, PointerCast(bcx, llretptr, llintype.ptr_to()));
@@ -335,7 +335,7 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
335335
}
336336
}
337337
}
338-
} else if ty::type_is_immediate(ccx.tcx, out_type) {
338+
} else if type_is_immediate(ccx.tcx, out_type) {
339339
let llsrcptr = PointerCast(bcx, llsrcval, llouttype.ptr_to());
340340
let ll_load = Load(bcx, llsrcptr);
341341
Ret(bcx, ll_load);

branches/auto/src/librustc/middle/trans/type_of.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ use syntax::ast;
2121
use syntax::opt_vec;
2222

2323
pub fn arg_is_indirect(ccx: &CrateContext, arg_ty: ty::t) -> bool {
24-
!ty::type_is_immediate(ccx.tcx, arg_ty)
24+
!type_is_immediate(ccx.tcx, arg_ty)
2525
}
2626

2727
pub fn return_uses_outptr(tcx: ty::ctxt, ty: ty::t) -> bool {
28-
!ty::type_is_immediate(tcx, ty)
28+
!type_is_immediate(tcx, ty)
2929
}
3030

3131
pub fn type_of_explicit_arg(ccx: &mut CrateContext, arg_ty: ty::t) -> Type {

branches/auto/src/librustc/middle/ty.rs

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,25 +1752,6 @@ pub fn type_is_scalar(ty: t) -> bool {
17521752
}
17531753
}
17541754

1755-
fn type_is_newtype_immediate(cx: ctxt, ty: t) -> bool {
1756-
match get(ty).sty {
1757-
ty_struct(def_id, ref substs) => {
1758-
let fields = struct_fields(cx, def_id, substs);
1759-
fields.len() == 1 &&
1760-
fields[0].ident.name == token::special_idents::unnamed_field.name &&
1761-
type_is_immediate(cx, fields[0].mt.ty)
1762-
}
1763-
_ => false
1764-
}
1765-
}
1766-
1767-
pub fn type_is_immediate(cx: ctxt, ty: t) -> bool {
1768-
return type_is_scalar(ty) || type_is_boxed(ty) ||
1769-
type_is_unique(ty) || type_is_region_ptr(ty) ||
1770-
type_is_newtype_immediate(cx, ty) ||
1771-
type_is_simd(cx, ty);
1772-
}
1773-
17741755
pub fn type_needs_drop(cx: ctxt, ty: t) -> bool {
17751756
type_contents(cx, ty).needs_drop(cx)
17761757
}
@@ -2538,6 +2519,13 @@ pub fn type_structurally_contains_uniques(cx: ctxt, ty: t) -> bool {
25382519
});
25392520
}
25402521

2522+
pub fn type_is_trait(ty: t) -> bool {
2523+
match get(ty).sty {
2524+
ty_trait(*) => true,
2525+
_ => false
2526+
}
2527+
}
2528+
25412529
pub fn type_is_integral(ty: t) -> bool {
25422530
match get(ty).sty {
25432531
ty_infer(IntVar(_)) | ty_int(_) | ty_uint(_) => true,
@@ -3289,10 +3277,10 @@ pub fn expr_kind(tcx: ctxt,
32893277
ast::ExprCast(*) => {
32903278
match tcx.node_types.find(&(expr.id as uint)) {
32913279
Some(&t) => {
3292-
if ty::type_is_immediate(tcx, t) {
3293-
RvalueDatumExpr
3294-
} else {
3280+
if type_is_trait(t) {
32953281
RvalueDpsExpr
3282+
} else {
3283+
RvalueDatumExpr
32963284
}
32973285
}
32983286
None => {

branches/auto/src/libsyntax/syntax

8.04 MB
Binary file not shown.

branches/auto/src/rt/sundown/html/html.c

100644100755
File mode changed.
14.7 KB
Binary file not shown.
Binary file not shown.
9.54 KB
Binary file not shown.
14.4 KB
Binary file not shown.
9.53 KB
Binary file not shown.
93.8 KB
Binary file not shown.

branches/auto/src/test/run-pass/unit-like-struct-drop-run.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// Make sure the destructor is run for unit-like structs.
12+
// xfail-fast
1213

1314
use std::task;
1415

@@ -20,7 +21,7 @@ impl Drop for Foo {
2021
}
2122
}
2223

23-
pub fn main() {
24+
fn main() {
2425
let x = do task::try {
2526
let _b = Foo;
2627
};

0 commit comments

Comments
 (0)