Skip to content

Commit 3b0c4c1

Browse files
committed
---
yaml --- r: 126622 b: refs/heads/snap-stage3 c: d368ffd h: refs/heads/master v: v3
1 parent 742f4e0 commit 3b0c4c1

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 7be8f0af0393dcdb077c2f6b1653836fd3fba235
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 33a4dd824f708d1e7c25ad26d8a4fe801d0b25e8
4+
refs/heads/snap-stage3: d368ffdb26144fd1f451d3d8ba4344b0a8e82f99
55
refs/heads/try: 502e4c045236682e9728539dc0d2b3d0b237f55c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/glue.rs

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -178,29 +178,12 @@ pub fn lazily_emit_visit_glue(ccx: &CrateContext, ti: &tydesc_info) -> ValueRef
178178
}
179179

180180
// See [Note-arg-mode]
181-
pub fn call_visit_glue(bcx: &Block, v: ValueRef, tydesc: ValueRef,
182-
static_ti: Option<&tydesc_info>) {
181+
pub fn call_visit_glue(bcx: &Block, v: ValueRef, tydesc: ValueRef) {
183182
let _icx = push_ctxt("call_visit_glue");
184-
let ccx = bcx.ccx();
185-
let static_glue_fn = static_ti.map(|sti| lazily_emit_visit_glue(ccx, sti));
186-
187-
// When static type info is available, avoid casting to a generic pointer.
188-
let llrawptr = if static_glue_fn.is_none() {
189-
PointerCast(bcx, v, Type::i8p(ccx))
190-
} else {
191-
v
192-
};
193183

194-
let llfn = {
195-
match static_glue_fn {
196-
None => {
197-
// Select out the glue function to call from the tydesc
198-
let llfnptr = GEPi(bcx, tydesc, [0u, abi::tydesc_field_visit_glue]);
199-
Load(bcx, llfnptr)
200-
}
201-
Some(sgf) => sgf
202-
}
203-
};
184+
// Select the glue function to call from the tydesc
185+
let llfn = Load(bcx, GEPi(bcx, tydesc, [0u, abi::tydesc_field_visit_glue]));
186+
let llrawptr = PointerCast(bcx, v, Type::i8p(bcx.ccx()));
204187

205188
Call(bcx, llfn, [llrawptr], []);
206189
}

branches/snap-stage3/src/librustc/middle/trans/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ pub fn trans_intrinsic_call<'a>(mut bcx: &'a Block<'a>, node: ast::NodeId,
290290
let td = *llargs.get(0);
291291
let visitor = *llargs.get(1);
292292
let td = PointerCast(bcx, td, ccx.tydesc_type().ptr_to());
293-
glue::call_visit_glue(bcx, visitor, td, None);
293+
glue::call_visit_glue(bcx, visitor, td);
294294
C_nil(ccx)
295295
}
296296
(_, "offset") => {

0 commit comments

Comments
 (0)