Save 2 pointers in TerminatorKind
(96 → 80 bytes)
These things don't need to be `Vec`s; boxed slices are enough. The frequent one here is call arguments, but MIR building knows the number of arguments from the THIR, so the collect is always getting the allocation right in the first place, and thus this shouldn't ever add the shrink-in-place overhead.
This commit is contained in:
parent
25c9f2ca06
commit
b28efb11af
16 changed files with 72 additions and 72 deletions
|
@ -1817,11 +1817,11 @@ mod size_asserts {
|
|||
use super::*;
|
||||
use rustc_data_structures::static_assert_size;
|
||||
// tidy-alphabetical-start
|
||||
static_assert_size!(BasicBlockData<'_>, 144);
|
||||
static_assert_size!(BasicBlockData<'_>, 128);
|
||||
static_assert_size!(LocalDecl<'_>, 40);
|
||||
static_assert_size!(SourceScopeData<'_>, 64);
|
||||
static_assert_size!(Statement<'_>, 32);
|
||||
static_assert_size!(Terminator<'_>, 112);
|
||||
static_assert_size!(Terminator<'_>, 96);
|
||||
static_assert_size!(VarDebugInfo<'_>, 88);
|
||||
// tidy-alphabetical-end
|
||||
}
|
||||
|
|
|
@ -730,7 +730,7 @@ pub enum TerminatorKind<'tcx> {
|
|||
/// reused across function calls without duplicating the contents.
|
||||
/// The span for each arg is also included
|
||||
/// (e.g. `a` and `b` in `x.foo(a, b)`).
|
||||
args: Vec<Spanned<Operand<'tcx>>>,
|
||||
args: Box<[Spanned<Operand<'tcx>>]>,
|
||||
/// Where the returned value will be written
|
||||
destination: Place<'tcx>,
|
||||
/// Where to go after this call returns. If none, the call necessarily diverges.
|
||||
|
@ -837,7 +837,7 @@ pub enum TerminatorKind<'tcx> {
|
|||
template: &'tcx [InlineAsmTemplatePiece],
|
||||
|
||||
/// The operands for the inline assembly, as `Operand`s or `Place`s.
|
||||
operands: Vec<InlineAsmOperand<'tcx>>,
|
||||
operands: Box<[InlineAsmOperand<'tcx>]>,
|
||||
|
||||
/// Miscellaneous options for the inline assembly.
|
||||
options: InlineAsmOptions,
|
||||
|
@ -849,7 +849,7 @@ pub enum TerminatorKind<'tcx> {
|
|||
/// Valid targets for the inline assembly.
|
||||
/// The first element is the fallthrough destination, unless
|
||||
/// InlineAsmOptions::NORETURN is set.
|
||||
targets: Vec<BasicBlock>,
|
||||
targets: Box<[BasicBlock]>,
|
||||
|
||||
/// Action to be taken if the inline assembly unwinds. This is present
|
||||
/// if and only if InlineAsmOptions::MAY_UNWIND is set.
|
||||
|
@ -1561,6 +1561,6 @@ mod size_asserts {
|
|||
static_assert_size!(PlaceElem<'_>, 24);
|
||||
static_assert_size!(Rvalue<'_>, 40);
|
||||
static_assert_size!(StatementKind<'_>, 16);
|
||||
static_assert_size!(TerminatorKind<'_>, 96);
|
||||
static_assert_size!(TerminatorKind<'_>, 80);
|
||||
// tidy-alphabetical-end
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue