Skip to content

Commit edc8de5

Browse files
committed
---
yaml --- r: 126047 b: refs/heads/try c: 491bd29 h: refs/heads/master i: 126045: 83c2686 126043: 1b307a7 126039: b2c9fc2 126031: b7afc61 126015: af1ef76 v: v3
1 parent 1785e60 commit edc8de5

File tree

18 files changed

+81
-205
lines changed

18 files changed

+81
-205
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: f2fa55903e378368ed9173560f03a0ef16e371c2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9fc8394d3bce22ab483f98842434c84c396212ae
5-
refs/heads/try: 6f833ee151bcfcd31c13a15daab78f5fb900bf76
5+
refs/heads/try: 491bd29945c26a0ff3f03e1d25e9ba635c40713e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

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

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,8 +1235,7 @@ pub fn new_fn_ctxt<'a>(ccx: &'a CrateContext,
12351235
output_type: ty::t,
12361236
param_substs: &'a param_substs,
12371237
sp: Option<Span>,
1238-
block_arena: &'a TypedArena<Block<'a>>,
1239-
handle_items: HandleItemsFlag)
1238+
block_arena: &'a TypedArena<Block<'a>>)
12401239
-> FunctionContext<'a> {
12411240
param_substs.validate();
12421241

@@ -1269,8 +1268,7 @@ pub fn new_fn_ctxt<'a>(ccx: &'a CrateContext,
12691268
block_arena: block_arena,
12701269
ccx: ccx,
12711270
debug_context: debug_context,
1272-
scopes: RefCell::new(Vec::new()),
1273-
handle_items: handle_items,
1271+
scopes: RefCell::new(Vec::new())
12741272
};
12751273

12761274
if has_env {
@@ -1581,8 +1579,7 @@ pub fn trans_closure(ccx: &CrateContext,
15811579
abi: Abi,
15821580
has_env: bool,
15831581
is_unboxed_closure: IsUnboxedClosureFlag,
1584-
maybe_load_env: <'a> |&'a Block<'a>| -> &'a Block<'a>,
1585-
handle_items: HandleItemsFlag) {
1582+
maybe_load_env: <'a> |&'a Block<'a>| -> &'a Block<'a>) {
15861583
ccx.stats.n_closures.set(ccx.stats.n_closures.get() + 1);
15871584

15881585
let _icx = push_ctxt("trans_closure");
@@ -1599,8 +1596,7 @@ pub fn trans_closure(ccx: &CrateContext,
15991596
output_type,
16001597
param_substs,
16011598
Some(body.span),
1602-
&arena,
1603-
handle_items);
1599+
&arena);
16041600
let mut bcx = init_function(&fcx, false, output_type);
16051601

16061602
// cleanup scope for the incoming arguments
@@ -1702,8 +1698,7 @@ pub fn trans_fn(ccx: &CrateContext,
17021698
llfndecl: ValueRef,
17031699
param_substs: &param_substs,
17041700
id: ast::NodeId,
1705-
attrs: &[ast::Attribute],
1706-
handle_items: HandleItemsFlag) {
1701+
attrs: &[ast::Attribute]) {
17071702
let _s = StatRecorder::new(ccx, ccx.tcx.map.path_to_string(id).to_string());
17081703
debug!("trans_fn(param_substs={})", param_substs.repr(ccx.tcx()));
17091704
let _icx = push_ctxt("trans_fn");
@@ -1723,8 +1718,7 @@ pub fn trans_fn(ccx: &CrateContext,
17231718
abi,
17241719
false,
17251720
NotUnboxedClosure,
1726-
|bcx| bcx,
1727-
handle_items);
1721+
|bcx| bcx);
17281722
}
17291723

17301724
pub fn trans_enum_variant(ccx: &CrateContext,
@@ -1830,7 +1824,7 @@ fn trans_enum_variant_or_tuple_like_struct(ccx: &CrateContext,
18301824

18311825
let arena = TypedArena::new();
18321826
let fcx = new_fn_ctxt(ccx, llfndecl, ctor_id, false, result_ty,
1833-
param_substs, None, &arena, TranslateItems);
1827+
param_substs, None, &arena);
18341828
let bcx = init_function(&fcx, false, result_ty);
18351829

18361830
let arg_tys = ty::ty_fn_args(ctor_ty);
@@ -1931,8 +1925,7 @@ pub fn trans_item(ccx: &CrateContext, item: &ast::Item) {
19311925
llfn,
19321926
&param_substs::empty(),
19331927
item.id,
1934-
item.attrs.as_slice(),
1935-
TranslateItems);
1928+
item.attrs.as_slice());
19361929
} else {
19371930
// Be sure to travel more than just one layer deep to catch nested
19381931
// items in blocks and such.

branches/try/src/librustc/middle/trans/callee.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ pub fn trans_unboxing_shim(bcx: &Block,
339339
return_type,
340340
&empty_param_substs,
341341
None,
342-
&block_arena,
343-
TranslateItems);
342+
&block_arena);
344343
let mut bcx = init_function(&fcx, false, return_type);
345344

346345
// Create the substituted versions of the self type.

branches/try/src/librustc/middle/trans/closure.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,7 @@ pub fn trans_expr_fn<'a>(
394394
ty::ty_fn_abi(fty),
395395
true,
396396
NotUnboxedClosure,
397-
|bcx| load_environment(bcx, cdata_ty, &freevars, store),
398-
bcx.fcx.handle_items);
397+
|bcx| load_environment(bcx, cdata_ty, &freevars, store));
399398
fill_fn_pair(bcx, dest_addr, llfn, llbox);
400399
bcx
401400
}
@@ -487,8 +486,7 @@ pub fn trans_unboxed_closure<'a>(
487486
ty::ty_fn_abi(function_type),
488487
true,
489488
IsUnboxedClosure,
490-
|bcx| load_unboxed_closure_environment(bcx, freevars_ptr),
491-
bcx.fcx.handle_items);
489+
|bcx| load_unboxed_closure_environment(bcx, freevars_ptr));
492490

493491
// Don't hoist this to the top of the function. It's perfectly legitimate
494492
// to have a zero-size unboxed closure (in which case dest will be
@@ -575,7 +573,7 @@ pub fn get_wrapper_for_bare_fn(ccx: &CrateContext,
575573
let arena = TypedArena::new();
576574
let empty_param_substs = param_substs::empty();
577575
let fcx = new_fn_ctxt(ccx, llfn, -1, true, f.sig.output,
578-
&empty_param_substs, None, &arena, TranslateItems);
576+
&empty_param_substs, None, &arena);
579577
let bcx = init_function(&fcx, true, f.sig.output);
580578

581579
let args = create_datums_for_fn_args(&fcx,

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,6 @@ impl<T:Subst+Clone> SubstP for T {
221221
pub type RvalueDatum = datum::Datum<datum::Rvalue>;
222222
pub type LvalueDatum = datum::Datum<datum::Lvalue>;
223223

224-
#[deriving(Clone, Eq, PartialEq)]
225-
pub enum HandleItemsFlag {
226-
IgnoreItems,
227-
TranslateItems,
228-
}
229-
230224
// Function context. Every LLVM function we create will have one of
231225
// these.
232226
pub struct FunctionContext<'a> {
@@ -295,9 +289,6 @@ pub struct FunctionContext<'a> {
295289

296290
// Cleanup scopes.
297291
pub scopes: RefCell<Vec<cleanup::CleanupScope<'a>> >,
298-
299-
// How to handle items encountered during translation of this function.
300-
pub handle_items: HandleItemsFlag,
301292
}
302293

303294
impl<'a> FunctionContext<'a> {

branches/try/src/librustc/middle/trans/controlflow.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,7 @@ pub fn trans_stmt<'a>(cx: &'a Block<'a>,
6868
debuginfo::create_local_var_metadata(bcx, &**local);
6969
}
7070
}
71-
ast::DeclItem(ref i) => {
72-
match fcx.handle_items {
73-
TranslateItems => trans_item(cx.fcx.ccx, &**i),
74-
IgnoreItems => {}
75-
}
76-
}
71+
ast::DeclItem(ref i) => trans_item(cx.fcx.ccx, &**i)
7772
}
7873
}
7974
ast::StmtMac(..) => cx.tcx().sess.bug("unexpanded macro")

branches/try/src/librustc/middle/trans/foreign.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,7 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: &CrateContext,
601601

602602
let llfn = base::decl_internal_rust_fn(ccx, t, ps.as_slice());
603603
base::set_llvm_fn_attrs(attrs, llfn);
604-
base::trans_fn(ccx, decl, body, llfn, &param_substs::empty(), id, [],
605-
TranslateItems);
604+
base::trans_fn(ccx, decl, body, llfn, &param_substs::empty(), id, []);
606605
llfn
607606
}
608607

branches/try/src/librustc/middle/trans/glue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ fn make_generic_glue(ccx: &CrateContext,
468468
let arena = TypedArena::new();
469469
let empty_param_substs = param_substs::empty();
470470
let fcx = new_fn_ctxt(ccx, llfn, -1, false, ty::mk_nil(),
471-
&empty_param_substs, None, &arena, TranslateItems);
471+
&empty_param_substs, None, &arena);
472472

473473
let bcx = init_function(&fcx, false, ty::mk_nil());
474474

branches/try/src/librustc/middle/trans/inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub fn maybe_instantiate_inline(ccx: &CrateContext, fn_id: ast::DefId)
133133
if unparameterized {
134134
let llfn = get_item_val(ccx, mth.id);
135135
trans_fn(ccx, &*mth.pe_fn_decl(), &*mth.pe_body(), llfn,
136-
&param_substs::empty(), mth.id, [], TranslateItems);
136+
&param_substs::empty(), mth.id, []);
137137
}
138138
local_def(mth.id)
139139
}

branches/try/src/librustc/middle/trans/meth.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ pub fn trans_impl(ccx: &CrateContext,
7575
llfn,
7676
&param_substs::empty(),
7777
method.id,
78-
[],
79-
TranslateItems);
78+
[]);
8079
} else {
8180
let mut v = TransItemVisitor{ ccx: ccx };
8281
visit::walk_method_helper(&mut v, &**method, ());

branches/try/src/librustc/middle/trans/monomorphize.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
149149
} => {
150150
let d = mk_lldecl();
151151
set_llvm_fn_attrs(i.attrs.as_slice(), d);
152-
trans_fn(ccx, &**decl, &**body, d, &psubsts, fn_id.node, [],
153-
IgnoreItems);
152+
trans_fn(ccx, &**decl, &**body, d, &psubsts, fn_id.node, []);
154153
d
155154
}
156155
_ => {
@@ -182,8 +181,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
182181
ast_map::NodeMethod(mth) => {
183182
let d = mk_lldecl();
184183
set_llvm_fn_attrs(mth.attrs.as_slice(), d);
185-
trans_fn(ccx, &*mth.pe_fn_decl(), &*mth.pe_body(), d, &psubsts, mth.id, [],
186-
IgnoreItems);
184+
trans_fn(ccx, &*mth.pe_fn_decl(), &*mth.pe_body(), d, &psubsts, mth.id, []);
187185
d
188186
}
189187
ast_map::NodeTraitMethod(method) => {
@@ -192,7 +190,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
192190
let d = mk_lldecl();
193191
set_llvm_fn_attrs(mth.attrs.as_slice(), d);
194192
trans_fn(ccx, &*mth.pe_fn_decl(), &*mth.pe_body(), d,
195-
&psubsts, mth.id, [], IgnoreItems);
193+
&psubsts, mth.id, []);
196194
d
197195
}
198196
_ => {

branches/try/src/librustc/middle/trans/reflect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ impl<'a, 'b> Reflector<'a, 'b> {
312312
let empty_param_substs = param_substs::empty();
313313
let fcx = new_fn_ctxt(ccx, llfdecl, -1, false,
314314
ty::mk_u64(), &empty_param_substs,
315-
None, &arena, TranslateItems);
315+
None, &arena);
316316
let bcx = init_function(&fcx, false, ty::mk_u64());
317317

318318
// we know the return type of llfdecl is an int here, so

0 commit comments

Comments
 (0)