diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-03-28 11:43:35 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-03-28 11:43:35 +0000 |
| commit | c5c31447a7f2d8ffc03f058e3d39cff7627d3eb1 (patch) | |
| tree | 2d5c6406bafebf7bb2c34b27e89fe2ecc85a9ae8 /src/vtable.rs | |
| parent | 22e4175bd63eb185b6a2a935386d1a52a6be1724 (diff) | |
Merge commit '09fae60a86b848a2fc0ad219ecc4e438dc1eef86' into sync_cg_clif-2024-03-28
Diffstat (limited to 'src/vtable.rs')
| -rw-r--r-- | src/vtable.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/vtable.rs b/src/vtable.rs index d2254d4c15e..86ebf37d105 100644 --- a/src/vtable.rs +++ b/src/vtable.rs @@ -2,7 +2,7 @@ //! //! See `rustc_codegen_ssa/src/meth.rs` for reference. -use crate::constant::data_id_for_alloc_id; +use crate::constant::data_id_for_vtable; use crate::prelude::*; pub(crate) fn vtable_memflags() -> MemFlags { @@ -92,12 +92,10 @@ pub(crate) fn get_vtable<'tcx>( ty: Ty<'tcx>, trait_ref: Option<ty::PolyExistentialTraitRef<'tcx>>, ) -> Value { - let alloc_id = fx.tcx.vtable_allocation((ty, trait_ref)); - let data_id = - data_id_for_alloc_id(&mut fx.constants_cx, &mut *fx.module, alloc_id, Mutability::Not); + let data_id = data_id_for_vtable(fx.tcx, &mut fx.constants_cx, fx.module, ty, trait_ref); let local_data_id = fx.module.declare_data_in_func(data_id, fx.bcx.func); if fx.clif_comments.enabled() { - fx.add_comment(local_data_id, format!("vtable: {:?}", alloc_id)); + fx.add_comment(local_data_id, "vtable"); } fx.bcx.ins().global_value(fx.pointer_type, local_data_id) } |
