Update other codegens to use tcx managed vtable allocations.

This commit is contained in:
Charles Lew
2021-06-20 17:43:25 +08:00
parent 654e3345e5
commit d3ff497bec
12 changed files with 144 additions and 250 deletions

View File

@@ -18,6 +18,7 @@ pub use adt::*;
pub use assoc::*;
pub use closure::*;
pub use generics::*;
pub use vtable::*;
use crate::hir::exports::ExportMap;
use crate::ich::StableHashingContext;
@@ -94,6 +95,7 @@ pub mod relate;
pub mod subst;
pub mod trait_def;
pub mod util;
pub mod vtable;
pub mod walk;
mod adt;
@@ -2009,19 +2011,3 @@ impl<'tcx> fmt::Debug for SymbolName<'tcx> {
fmt::Display::fmt(&self.name, fmt)
}
}
#[derive(Clone, Copy, Debug, PartialEq, HashStable)]
pub enum VtblEntry<'tcx> {
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Vacant,
Method(DefId, SubstsRef<'tcx>),
}
pub const COMMON_VTABLE_ENTRIES: &[VtblEntry<'_>] =
&[VtblEntry::MetadataDropInPlace, VtblEntry::MetadataSize, VtblEntry::MetadataAlign];
pub const COMMON_VTABLE_ENTRIES_DROPINPLACE: usize = 0;
pub const COMMON_VTABLE_ENTRIES_SIZE: usize = 1;
pub const COMMON_VTABLE_ENTRIES_ALIGN: usize = 2;