Skip to content

Commit 1053d75

Browse files
committed
---
yaml --- r: 138219 b: refs/heads/auto c: 7210a5a h: refs/heads/master i: 138217: df2b17d 138215: 046632a v: v3
1 parent 3ec15d2 commit 1053d75

File tree

9 files changed

+2
-98
lines changed

9 files changed

+2
-98
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: 7a4122ac6798d1db84c3dc76047a1136cd7da258
16+
refs/heads/auto: 7210a5af8716765f5ed9b71edc6f7e1719f71f18
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libcore/intrinsics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ pub struct TyDesc {
5858
pub drop_glue: GlueFn,
5959

6060
// Called by reflection visitor to visit a value of type `T`
61+
#[cfg(stage0)]
6162
pub visit_glue: GlueFn,
6263

6364
// Name corresponding to the type

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ pub struct tydesc_info {
130130
pub size: ValueRef,
131131
pub align: ValueRef,
132132
pub name: ValueRef,
133-
pub visit_glue: Cell<Option<ValueRef>>,
134133
}
135134

136135
/*

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ pub struct SharedCrateContext<'tcx> {
7272

7373
available_monomorphizations: RefCell<HashSet<String>>,
7474
available_drop_glues: RefCell<HashMap<ty::t, String>>,
75-
available_visit_glues: RefCell<HashMap<ty::t, String>>,
7675
}
7776

7877
/// The local portion of a `CrateContext`. There is one `LocalCrateContext`
@@ -275,7 +274,6 @@ impl<'tcx> SharedCrateContext<'tcx> {
275274
},
276275
available_monomorphizations: RefCell::new(HashSet::new()),
277276
available_drop_glues: RefCell::new(HashMap::new()),
278-
available_visit_glues: RefCell::new(HashMap::new()),
279277
};
280278

281279
for i in range(0, local_count) {
@@ -682,10 +680,6 @@ impl<'b, 'tcx> CrateContext<'b, 'tcx> {
682680
&self.shared.available_drop_glues
683681
}
684682

685-
pub fn available_visit_glues<'a>(&'a self) -> &'a RefCell<HashMap<ty::t, String>> {
686-
&self.shared.available_visit_glues
687-
}
688-
689683
pub fn int_type(&self) -> Type {
690684
self.local.int_type
691685
}

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

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use middle::trans::datum;
3131
use middle::trans::debuginfo;
3232
use middle::trans::expr;
3333
use middle::trans::machine::*;
34-
use middle::trans::reflect;
3534
use middle::trans::tvec;
3635
use middle::trans::type_::Type;
3736
use middle::trans::type_of::{type_of, sizing_type_of, align_of};
@@ -41,7 +40,6 @@ use util::ppaux;
4140

4241
use arena::TypedArena;
4342
use std::c_str::ToCStr;
44-
use std::cell::Cell;
4543
use libc::c_uint;
4644
use syntax::ast;
4745
use syntax::parse::token;
@@ -186,71 +184,6 @@ pub fn get_drop_glue(ccx: &CrateContext, t: ty::t) -> ValueRef {
186184
glue
187185
}
188186

189-
pub fn lazily_emit_visit_glue(ccx: &CrateContext, ti: &tydesc_info) -> ValueRef {
190-
let _icx = push_ctxt("lazily_emit_visit_glue");
191-
192-
let llfnty = Type::glue_fn(ccx, type_of(ccx, ti.ty).ptr_to());
193-
194-
match ti.visit_glue.get() {
195-
Some(visit_glue) => visit_glue,
196-
None => {
197-
debug!("+++ lazily_emit_tydesc_glue VISIT {}", ppaux::ty_to_string(ccx.tcx(), ti.ty));
198-
199-
let (glue_fn, new_sym) = match ccx.available_visit_glues().borrow().find(&ti.ty) {
200-
Some(old_sym) => {
201-
let glue_fn = decl_cdecl_fn(ccx, old_sym.as_slice(), llfnty, ty::mk_nil());
202-
(glue_fn, None)
203-
},
204-
None => {
205-
let (sym, glue_fn) = declare_generic_glue(ccx, ti.ty, llfnty, "visit");
206-
(glue_fn, Some(sym))
207-
},
208-
};
209-
210-
ti.visit_glue.set(Some(glue_fn));
211-
212-
match new_sym {
213-
Some(sym) => {
214-
ccx.available_visit_glues().borrow_mut().insert(ti.ty, sym);
215-
make_generic_glue(ccx, ti.ty, glue_fn, make_visit_glue, "visit");
216-
},
217-
None => {},
218-
}
219-
220-
debug!("--- lazily_emit_tydesc_glue VISIT {}", ppaux::ty_to_string(ccx.tcx(), ti.ty));
221-
glue_fn
222-
}
223-
}
224-
}
225-
226-
// See [Note-arg-mode]
227-
pub fn call_visit_glue(bcx: Block, v: ValueRef, tydesc: ValueRef) {
228-
let _icx = push_ctxt("call_visit_glue");
229-
230-
// Select the glue function to call from the tydesc
231-
let llfn = Load(bcx, GEPi(bcx, tydesc, [0u, abi::tydesc_field_visit_glue]));
232-
let llrawptr = PointerCast(bcx, v, Type::i8p(bcx.ccx()));
233-
234-
Call(bcx, llfn, [llrawptr], None);
235-
}
236-
237-
fn make_visit_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v: ValueRef, t: ty::t)
238-
-> Block<'blk, 'tcx> {
239-
let _icx = push_ctxt("make_visit_glue");
240-
let mut bcx = bcx;
241-
let (visitor_trait, object_ty) = match ty::visitor_object_ty(bcx.tcx(),
242-
ty::ReStatic,
243-
ty::ReStatic) {
244-
Ok(pair) => pair,
245-
Err(s) => {
246-
bcx.tcx().sess.fatal(s.as_slice());
247-
}
248-
};
249-
let v = PointerCast(bcx, v, type_of(bcx.ccx(), object_ty).ptr_to());
250-
bcx = reflect::emit_calls_to_trait_visit_ty(bcx, t, v, visitor_trait.def_id);
251-
bcx
252-
}
253-
254187
fn trans_struct_drop_flag<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
255188
t: ty::t,
256189
v0: ValueRef,
@@ -577,7 +510,6 @@ pub fn declare_tydesc(ccx: &CrateContext, t: ty::t) -> tydesc_info {
577510
size: llsize,
578511
align: llalign,
579512
name: ty_name,
580-
visit_glue: Cell::new(None),
581513
}
582514
}
583515

@@ -643,27 +575,11 @@ pub fn emit_tydescs(ccx: &CrateContext) {
643575
llvm::LLVMConstPointerCast(get_drop_glue(ccx, ti.ty), glue_fn_ty.to_ref())
644576
};
645577
ccx.stats().n_real_glues.set(ccx.stats().n_real_glues.get() + 1);
646-
let visit_glue =
647-
match ti.visit_glue.get() {
648-
None => {
649-
ccx.stats().n_null_glues.set(ccx.stats().n_null_glues.get() +
650-
1u);
651-
C_null(glue_fn_ty)
652-
}
653-
Some(v) => {
654-
unsafe {
655-
ccx.stats().n_real_glues.set(ccx.stats().n_real_glues.get() +
656-
1);
657-
llvm::LLVMConstPointerCast(v, glue_fn_ty.to_ref())
658-
}
659-
}
660-
};
661578

662579
let tydesc = C_named_struct(ccx.tydesc_type(),
663580
[ti.size, // size
664581
ti.align, // align
665582
drop_glue, // drop_glue
666-
visit_glue, // visit_glue
667583
ti.name]); // name
668584

669585
unsafe {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ pub fn trans_intrinsic_call<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, node: ast::N
269269
(_, "get_tydesc") => {
270270
let tp_ty = *substs.types.get(FnSpace, 0);
271271
let static_ti = get_tydesc(ccx, tp_ty);
272-
glue::lazily_emit_visit_glue(ccx, &*static_ti);
273272

274273
// FIXME (#3730): ideally this shouldn't need a cast,
275274
// but there's a circularity between translating rust types to llvm

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use middle::trans::callee::ArgVals;
1717
use middle::trans::callee;
1818
use middle::trans::common::*;
1919
use middle::trans::datum::*;
20-
use middle::trans::glue;
2120
use middle::trans::machine;
2221
use middle::trans::meth;
2322
use middle::trans::type_::Type;
@@ -74,7 +73,6 @@ impl<'a, 'blk, 'tcx> Reflector<'a, 'blk, 'tcx> {
7473
pub fn c_tydesc(&mut self, t: ty::t) -> ValueRef {
7574
let bcx = self.bcx;
7675
let static_ti = get_tydesc(bcx.ccx(), t);
77-
glue::lazily_emit_visit_glue(bcx.ccx(), &*static_ti);
7876
PointerCast(bcx, static_ti.tydesc, self.tydesc_ty.ptr_to())
7977
}
8078

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ impl Type {
197197
let elems = [int_ty, // size
198198
int_ty, // align
199199
glue_fn_ty, // drop
200-
glue_fn_ty, // visit
201200
str_slice_ty]; // name
202201
tydesc.set_struct_body(elems, false);
203202

branches/auto/src/librustc_back/abi.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ pub const box_field_refcnt: uint = 0u;
1414
pub const box_field_drop_glue: uint = 1u;
1515
pub const box_field_body: uint = 4u;
1616

17-
pub const tydesc_field_visit_glue: uint = 3u;
18-
1917
// The two halves of a closure: code and environment.
2018
pub const fn_field_code: uint = 0u;
2119
pub const fn_field_box: uint = 1u;

0 commit comments

Comments
 (0)