about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/vtable.rs
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-03-28 11:43:35 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-03-28 11:43:35 +0000
commit987ed345af4af535f271dea5bdfe8647dcaf44ec (patch)
tree0d63c4050ea389378aadbbb222fdae61213498d6 /compiler/rustc_codegen_cranelift/src/vtable.rs
parentd0e8cbbd99ccc1be12b1aa743521ed89268e59a2 (diff)
parent09fae60a86b848a2fc0ad219ecc4e438dc1eef86 (diff)
downloadrust-987ed345af4af535f271dea5bdfe8647dcaf44ec.tar.gz
rust-987ed345af4af535f271dea5bdfe8647dcaf44ec.zip
Merge commit '09fae60a86b848a2fc0ad219ecc4e438dc1eef86' into sync_cg_clif-2024-03-28
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/vtable.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/vtable.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/vtable.rs b/compiler/rustc_codegen_cranelift/src/vtable.rs
index d2254d4c15e..86ebf37d105 100644
--- a/compiler/rustc_codegen_cranelift/src/vtable.rs
+++ b/compiler/rustc_codegen_cranelift/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)
 }