Skip to content

Commit

Permalink
Test: Use smallvec directly instead of boxed.
Browse files Browse the repository at this point in the history
  • Loading branch information
hkratz committed Aug 9, 2021
1 parent 1d4972e commit 02295f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub struct TypeLowering<'ll> {

/// If padding is used the slice maps fields from source order
/// to llvm order.
pub field_remapping: Option<Box<SmallVec<[u32; 4]>>>,
pub field_remapping: Option<SmallVec<[u32; 4]>>,
}

fn to_llvm_tls_model(tls_model: TlsModel) -> llvm::ThreadLocalMode {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_llvm/src/type_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn uncached_llvm_type<'a, 'tcx>(
cx: &CodegenCx<'a, 'tcx>,
layout: TyAndLayout<'tcx>,
defer: &mut Option<(&'a Type, TyAndLayout<'tcx>)>,
field_remapping: &mut Option<Box<SmallVec<[u32; 4]>>>,
field_remapping: &mut Option<SmallVec<[u32; 4]>>,
) -> &'a Type {
match layout.abi {
Abi::Scalar(_) => bug!("handled elsewhere"),
Expand Down Expand Up @@ -94,7 +94,7 @@ fn uncached_llvm_type<'a, 'tcx>(
fn struct_llfields<'a, 'tcx>(
cx: &CodegenCx<'a, 'tcx>,
layout: TyAndLayout<'tcx>,
) -> (Vec<&'a Type>, bool, Option<Box<SmallVec<[u32; 4]>>>) {
) -> (Vec<&'a Type>, bool, Option<SmallVec<[u32; 4]>>) {
debug!("struct_llfields: {:#?}", layout);
let field_count = layout.fields.count();

Expand Down Expand Up @@ -150,7 +150,7 @@ fn struct_llfields<'a, 'tcx>(
} else {
debug!("struct_llfields: offset: {:?} stride: {:?}", offset, layout.size);
}
let field_remapping = if padding_used { Some(Box::new(field_remapping)) } else { None };
let field_remapping = if padding_used { Some(field_remapping) } else { None };
(result, packed, field_remapping)
}

Expand Down

0 comments on commit 02295f4

Please sign in to comment.