Skip to content

Commit

Permalink
Rename prefix_chunk to prefix_chunk_size
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Nov 21, 2020
1 parent 39b8b2b commit 6a5f537
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/abi.rs
Expand Up @@ -158,7 +158,7 @@ impl LlvmType for CastTarget {
.prefix
.iter()
.flat_map(|option_kind| {
option_kind.map(|kind| Reg { kind, size: self.prefix_chunk }.llvm_type(cx))
option_kind.map(|kind| Reg { kind, size: self.prefix_chunk_size }.llvm_type(cx))
})
.chain((0..rest_count).map(|_| rest_ll_unit))
.collect();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/abi/call/mips64.rs
Expand Up @@ -137,7 +137,7 @@ where
let rest_size = size - Size::from_bytes(8) * prefix_index as u64;
arg.cast_to(CastTarget {
prefix,
prefix_chunk: Size::from_bytes(8),
prefix_chunk_size: Size::from_bytes(8),
rest: Uniform { unit: Reg::i64(), total: rest_size },
});
}
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_target/src/abi/call/mod.rs
Expand Up @@ -203,7 +203,7 @@ impl Uniform {
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct CastTarget {
pub prefix: [Option<RegKind>; 8],
pub prefix_chunk: Size,
pub prefix_chunk_size: Size,
pub rest: Uniform,
}

Expand All @@ -215,29 +215,29 @@ impl From<Reg> for CastTarget {

impl From<Uniform> for CastTarget {
fn from(uniform: Uniform) -> CastTarget {
CastTarget { prefix: [None; 8], prefix_chunk: Size::ZERO, rest: uniform }
CastTarget { prefix: [None; 8], prefix_chunk_size: Size::ZERO, rest: uniform }
}
}

impl CastTarget {
pub fn pair(a: Reg, b: Reg) -> CastTarget {
CastTarget {
prefix: [Some(a.kind), None, None, None, None, None, None, None],
prefix_chunk: a.size,
prefix_chunk_size: a.size,
rest: Uniform::from(b),
}
}

pub fn size<C: HasDataLayout>(&self, cx: &C) -> Size {
(self.prefix_chunk * self.prefix.iter().filter(|x| x.is_some()).count() as u64)
(self.prefix_chunk_size * self.prefix.iter().filter(|x| x.is_some()).count() as u64)
.align_to(self.rest.align(cx))
+ self.rest.total
}

pub fn align<C: HasDataLayout>(&self, cx: &C) -> Align {
self.prefix
.iter()
.filter_map(|x| x.map(|kind| Reg { kind, size: self.prefix_chunk }.align(cx)))
.filter_map(|x| x.map(|kind| Reg { kind, size: self.prefix_chunk_size }.align(cx)))
.fold(cx.data_layout().aggregate_align.abi.max(self.rest.align(cx)), |acc, align| {
acc.max(align)
})
Expand Down

0 comments on commit 6a5f537

Please sign in to comment.