1
Fork 0

Collect VTable stats & add -Zprint-vtable-sizes

This commit is contained in:
Maybe Waffle 2023-05-17 12:28:04 +00:00
parent cb882fa998
commit f2545fb225
8 changed files with 151 additions and 5 deletions

View file

@ -21,7 +21,7 @@ mod structural_match;
mod structural_normalize;
#[cfg_attr(not(bootstrap), allow(hidden_glob_reexports))]
mod util;
mod vtable;
pub mod vtable;
pub mod wf;
use crate::infer::outlives::env::OutlivesEnvironment;

View file

@ -15,13 +15,13 @@ use std::fmt::Debug;
use std::ops::ControlFlow;
#[derive(Clone, Debug)]
pub(super) enum VtblSegment<'tcx> {
pub enum VtblSegment<'tcx> {
MetadataDSA,
TraitOwnEntries { trait_ref: ty::PolyTraitRef<'tcx>, emit_vptr: bool },
}
/// Prepare the segments for a vtable
pub(super) fn prepare_vtable_segments<'tcx, T>(
pub fn prepare_vtable_segments<'tcx, T>(
tcx: TyCtxt<'tcx>,
trait_ref: ty::PolyTraitRef<'tcx>,
mut segment_visitor: impl FnMut(VtblSegment<'tcx>) -> ControlFlow<T>,