Skip to content

Commit 0c48679

Browse files
committed
---
yaml --- r: 109171 b: refs/heads/dist-snap c: c04d484 h: refs/heads/master i: 109169: 49ac660 109167: ee3f14e v: v3
1 parent c7f7598 commit 0c48679

File tree

23 files changed

+174
-1312
lines changed

23 files changed

+174
-1312
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 7532d20a17dce417e9040e31623e7fcf01971db7
9+
refs/heads/dist-snap: c04d4846f2a7a49e592f4e98f3e604851d600d4e
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libnum/bigint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl TotalOrd for BigUint {
117117
if s_len < o_len { return Less; }
118118
if s_len > o_len { return Greater; }
119119

120-
for (&self_i, &other_i) in self.data.iter().rev().zip(other.data.iter().rev()) {
120+
for (&self_i, &other_i) in self.data.rev_iter().zip(other.data.rev_iter()) {
121121
if self_i < other_i { return Less; }
122122
if self_i > other_i { return Greater; }
123123
}
@@ -788,7 +788,7 @@ impl BigUint {
788788

789789
let mut borrow = 0;
790790
let mut shifted_rev = Vec::with_capacity(self.data.len());
791-
for elem in self.data.iter().rev() {
791+
for elem in self.data.rev_iter() {
792792
shifted_rev.push((*elem >> n_bits) | borrow);
793793
borrow = *elem << (BigDigit::bits - n_bits);
794794
}

branches/dist-snap/src/librustc/driver/driver.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ pub fn phase_3_run_analysis_passes(sess: Session,
305305
time(time_passes, "resolution", (), |_|
306306
middle::resolve::resolve_crate(&sess, lang_items, krate));
307307

308+
// Discard MTWT tables that aren't required past resolution.
309+
syntax::ext::mtwt::clear_tables();
310+
308311
let named_region_map = time(time_passes, "lifetime resolution", (),
309312
|_| middle::resolve_lifetime::krate(&sess, krate));
310313

@@ -585,6 +588,10 @@ pub fn compile_input(sess: Session, cfg: ast::CrateConfig, input: &Input,
585588
if stop_after_phase_3(&analysis.ty_cx.sess) { return; }
586589
let (tcx, trans) = phase_4_translate_to_llvm(expanded_crate,
587590
analysis, &outputs);
591+
592+
// Discard interned strings as they are no longer required.
593+
token::get_ident_interner().clear();
594+
588595
(outputs, trans, tcx.sess)
589596
};
590597
phase_5_run_llvm_passes(&sess, &trans, &outputs);

branches/dist-snap/src/librustc/middle/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful {
288288
is_useful_specialized(cx, m, v, vec(n), n, left_ty)
289289
}
290290
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
291-
let max_len = m.iter().rev().fold(0, |max_len, r| {
291+
let max_len = m.rev_iter().fold(0, |max_len, r| {
292292
match r.get(0).node {
293293
PatVec(ref before, _, ref after) => {
294294
cmp::max(before.len() + after.len(), max_len)

branches/dist-snap/src/librustc/middle/liveness.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ impl<'a> Liveness<'a> {
879879
fn propagate_through_block(&mut self, blk: &Block, succ: LiveNode)
880880
-> LiveNode {
881881
let succ = self.propagate_through_opt_expr(blk.expr, succ);
882-
blk.stmts.iter().rev().fold(succ, |succ, stmt| {
882+
blk.stmts.rev_iter().fold(succ, |succ, stmt| {
883883
self.propagate_through_stmt(*stmt, succ)
884884
})
885885
}
@@ -980,7 +980,7 @@ impl<'a> Liveness<'a> {
980980
this.ir.tcx.sess.span_bug(expr.span, "no registered caps");
981981
}
982982
};
983-
caps.deref().iter().rev().fold(succ, |succ, cap| {
983+
caps.deref().rev_iter().fold(succ, |succ, cap| {
984984
this.init_from_succ(cap.ln, succ);
985985
let var = this.variable(cap.var_nid, expr.span);
986986
this.acc(cap.ln, var, ACC_READ | ACC_USE);
@@ -1121,7 +1121,7 @@ impl<'a> Liveness<'a> {
11211121

11221122
ExprStruct(_, ref fields, with_expr) => {
11231123
let succ = self.propagate_through_opt_expr(with_expr, succ);
1124-
fields.iter().rev().fold(succ, |succ, field| {
1124+
fields.rev_iter().fold(succ, |succ, field| {
11251125
self.propagate_through_expr(field.expr, succ)
11261126
})
11271127
}
@@ -1173,14 +1173,14 @@ impl<'a> Liveness<'a> {
11731173
}
11741174

11751175
ExprInlineAsm(ref ia) => {
1176-
let succ = ia.outputs.iter().rev().fold(succ, |succ, &(_, expr)| {
1176+
let succ = ia.outputs.rev_iter().fold(succ, |succ, &(_, expr)| {
11771177
// see comment on lvalues in
11781178
// propagate_through_lvalue_components()
11791179
let succ = self.write_lvalue(expr, succ, ACC_WRITE);
11801180
self.propagate_through_lvalue_components(expr, succ)
11811181
});
11821182
// Inputs are executed first. Propagate last because of rev order
1183-
ia.inputs.iter().rev().fold(succ, |succ, &(_, expr)| {
1183+
ia.inputs.rev_iter().fold(succ, |succ, &(_, expr)| {
11841184
self.propagate_through_expr(expr, succ)
11851185
})
11861186
}

branches/dist-snap/src/librustc/middle/resolve.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5520,8 +5520,7 @@ impl<'a> Resolver<'a> {
55205520
if idents.len() == 0 {
55215521
return ~"???";
55225522
}
5523-
return self.idents_to_str(idents.move_iter()
5524-
.rev()
5523+
return self.idents_to_str(idents.move_rev_iter()
55255524
.collect::<Vec<ast::Ident>>()
55265525
.as_slice());
55275526
}

branches/dist-snap/src/librustc/middle/trans/cabi.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ pub enum ArgKind {
2525
/// LLVM type or by coercing to another specified type
2626
Direct,
2727
/// Pass the argument indirectly via a hidden pointer
28-
Indirect,
29-
/// Ignore the argument (useful for empty struct)
30-
Ignore,
28+
Indirect
3129
}
3230

3331
/// Information about how a specific C type
@@ -70,27 +68,13 @@ impl ArgType {
7068
}
7169
}
7270

73-
pub fn ignore(ty: Type) -> ArgType {
74-
ArgType {
75-
kind: Ignore,
76-
ty: ty,
77-
cast: None,
78-
pad: None,
79-
attr: None,
80-
}
81-
}
82-
8371
pub fn is_direct(&self) -> bool {
8472
return self.kind == Direct;
8573
}
8674

8775
pub fn is_indirect(&self) -> bool {
8876
return self.kind == Indirect;
8977
}
90-
91-
pub fn is_ignore(&self) -> bool {
92-
return self.kind == Ignore;
93-
}
9478
}
9579

9680
/// Metadata describing how the arguments to a native function

branches/dist-snap/src/librustc/middle/trans/cabi_x86.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,8 @@ pub fn compute_abi_info(ccx: &CrateContext,
6363
ret_ty = ArgType::direct(rty, None, None, None);
6464
}
6565

66-
for &t in atys.iter() {
67-
let ty = match t.kind() {
68-
Struct => {
69-
let size = llsize_of_alloc(ccx, t);
70-
if size == 0 {
71-
ArgType::ignore(t)
72-
} else {
73-
ArgType::indirect(t, Some(ByValAttribute))
74-
}
75-
}
76-
_ => ArgType::direct(t, None, None, None),
77-
};
78-
arg_tys.push(ty);
66+
for &a in atys.iter() {
67+
arg_tys.push(ArgType::direct(a, None, None, None));
7968
}
8069

8170
return FnType {

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,6 @@ pub fn trans_native_call<'a>(
325325
for (i, &llarg_rust) in llargs_rust.iter().enumerate() {
326326
let mut llarg_rust = llarg_rust;
327327

328-
if arg_tys[i].is_ignore() {
329-
continue;
330-
}
331-
332328
// Does Rust pass this argument by pointer?
333329
let rust_indirect = type_of::arg_is_indirect(ccx,
334330
*passed_arg_tys.get(i));
@@ -905,9 +901,6 @@ fn lltype_for_fn_from_foreign_types(ccx: &CrateContext, tys: &ForeignTypes) -> T
905901
};
906902

907903
for &arg_ty in tys.fn_ty.arg_tys.iter() {
908-
if arg_ty.is_ignore() {
909-
continue;
910-
}
911904
// add padding
912905
match arg_ty.pad {
913906
Some(ty) => llargument_tys.push(ty),
@@ -956,9 +949,6 @@ fn add_argument_attributes(tys: &ForeignTypes,
956949
}
957950

958951
for &arg_ty in tys.fn_ty.arg_tys.iter() {
959-
if arg_ty.is_ignore() {
960-
continue;
961-
}
962952
// skip padding
963953
if arg_ty.pad.is_some() { i += 1; }
964954

branches/dist-snap/src/librustc/middle/typeck/check/vtable.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ fn lookup_vtables(vcx: &VtableContext,
9494
// We do this backwards for reasons discussed above.
9595
assert_eq!(substs.tps.len(), type_param_defs.len());
9696
let mut result: Vec<vtable_param_res> =
97-
substs.tps.iter()
98-
.rev()
97+
substs.tps.rev_iter()
9998
.zip(type_param_defs.rev_iter())
10099
.map(|(ty, def)|
101100
lookup_vtables_for_param(vcx, span, Some(substs),

branches/dist-snap/src/librustdoc/passes.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ impl<'a> fold::DocFolder for Stripper<'a> {
128128
}
129129
}
130130

131-
clean::ViewItemItem(..) |
132-
clean::ModuleItem(..) => {
131+
clean::ViewItemItem(..) => {
133132
if i.visibility != Some(ast::Public) {
134133
return None
135134
}
@@ -141,6 +140,9 @@ impl<'a> fold::DocFolder for Stripper<'a> {
141140
}
142141
}
143142

143+
// handled below
144+
clean::ModuleItem(..) => {}
145+
144146
// trait impls for private items should be stripped
145147
clean::ImplItem(clean::Impl{ for_: clean::ResolvedPath{ id: ref for_id, .. }, .. }) => {
146148
if !self.exported_items.contains(for_id) {

0 commit comments

Comments
 (0)