Skip to content

Commit f8feed7

Browse files
bjorn3RalfJung
authored andcommitted
Implement vtable_size and vtable_align intrinsics for cg_clif
1 parent 6c9abfa commit f8feed7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/intrinsics/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,16 @@ fn codegen_regular_intrinsic_call<'tcx>(
431431
ret.write_cvalue(fx, CValue::by_val(align, usize_layout));
432432
};
433433

434+
vtable_size, (v vtable) {
435+
let size = crate::vtable::size_of_obj(fx, vtable);
436+
ret.write_cvalue(fx, CValue::by_val(size, usize_layout));
437+
};
438+
439+
vtable_align, (v vtable) {
440+
let align = crate::vtable::min_align_of_obj(fx, vtable);
441+
ret.write_cvalue(fx, CValue::by_val(align, usize_layout));
442+
};
443+
434444
unchecked_add | unchecked_sub | unchecked_mul | unchecked_div | exact_div | unchecked_rem
435445
| unchecked_shl | unchecked_shr, (c x, c y) {
436446
// FIXME trap on overflow

0 commit comments

Comments
 (0)