diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2022-07-20 13:36:58 +0000 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-07-20 17:12:07 -0400 |
| commit | f8feed7d2713c25a5ef216d185eaa73044cb9318 (patch) | |
| tree | a28199971326a233aeb28d6c886ee964c8e3114b /src | |
| parent | 6c9abfa0f3e4cfb458362d4ece0641542f99b22d (diff) | |
| download | rust-f8feed7d2713c25a5ef216d185eaa73044cb9318.tar.gz rust-f8feed7d2713c25a5ef216d185eaa73044cb9318.zip | |
Implement vtable_size and vtable_align intrinsics for cg_clif
Diffstat (limited to 'src')
| -rw-r--r-- | src/intrinsics/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index 4b2207f3758..d5a79e254a8 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -431,6 +431,16 @@ fn codegen_regular_intrinsic_call<'tcx>( ret.write_cvalue(fx, CValue::by_val(align, usize_layout)); }; + vtable_size, (v vtable) { + let size = crate::vtable::size_of_obj(fx, vtable); + ret.write_cvalue(fx, CValue::by_val(size, usize_layout)); + }; + + vtable_align, (v vtable) { + let align = crate::vtable::min_align_of_obj(fx, vtable); + ret.write_cvalue(fx, CValue::by_val(align, usize_layout)); + }; + unchecked_add | unchecked_sub | unchecked_mul | unchecked_div | exact_div | unchecked_rem | unchecked_shl | unchecked_shr, (c x, c y) { // FIXME trap on overflow |
