Skip to content

Commit d368ffd

Browse files
committed
Remove the unneeded final parameter from call_visit_glue
call_visit_glue() is only ever called with None as its last argument, so we can remove it as well.
1 parent 33a4dd8 commit d368ffd

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

src/librustc/middle/trans/glue.rs

+4-21
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
}

src/librustc/middle/trans/intrinsic.rs

+1-1
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)