Skip to content

Commit

Permalink
[HACK(eddyb)] arena-allocate but don't intern FnAbis.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Sep 18, 2021
1 parent c1837ef commit 8c918d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions compiler/rustc_middle/src/ty/context.rs
Expand Up @@ -55,7 +55,6 @@ use rustc_span::def_id::{DefPathHash, StableCrateId};
use rustc_span::source_map::{MultiSpan, SourceMap};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{Span, DUMMY_SP};
use rustc_target::abi::call::FnAbi;
use rustc_target::abi::{Layout, TargetDataLayout, VariantIdx};
use rustc_target::spec::abi;

Expand Down Expand Up @@ -136,7 +135,6 @@ pub struct CtxtInterners<'tcx> {
const_allocation: InternedSet<'tcx, Allocation>,
bound_variable_kinds: InternedSet<'tcx, List<ty::BoundVariableKind>>,
layout: InternedSet<'tcx, Layout>,
fn_abi: InternedSet<'tcx, FnAbi<'tcx, Ty<'tcx>>>,
}

impl<'tcx> CtxtInterners<'tcx> {
Expand All @@ -157,7 +155,6 @@ impl<'tcx> CtxtInterners<'tcx> {
const_allocation: Default::default(),
bound_variable_kinds: Default::default(),
layout: Default::default(),
fn_abi: Default::default(),
}
}

Expand Down Expand Up @@ -1962,7 +1959,6 @@ impl<'tcx> TyCtxt<'tcx> {
self.0.interners.const_allocation.len()
)?;
writeln!(fmt, "Layout interner: #{}", self.0.interners.layout.len())?;
writeln!(fmt, "FnAbi interner: #{}", self.0.interners.fn_abi.len())?;

Ok(())
}
Expand Down Expand Up @@ -2087,7 +2083,6 @@ direct_interners! {
const_: mk_const(Const<'tcx>),
const_allocation: intern_const_alloc(Allocation),
layout: intern_layout(Layout),
fn_abi: intern_fn_abi(FnAbi<'tcx, Ty<'tcx>>),
}

macro_rules! slice_interners {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/layout.rs
Expand Up @@ -3118,7 +3118,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
};
self.fn_abi_adjust_for_abi(&mut fn_abi, sig.abi)?;
debug!("fn_abi_new_uncached = {:?}", fn_abi);
Ok(self.tcx.intern_fn_abi(fn_abi))
Ok(self.tcx.arena.alloc(fn_abi))
}

fn fn_abi_adjust_for_abi(
Expand Down

0 comments on commit 8c918d7

Please sign in to comment.