Rollup merge of #43401 - cuviper:homogeneous, r=Mark-Simulacrum

Correct the spelling of "homogeneous"

None
This commit is contained in:
Mark Simulacrum 2017-07-24 09:16:36 -06:00 committed by GitHub
commit bf5d6617fd
7 changed files with 23 additions and 23 deletions

View File

@ -1708,7 +1708,7 @@ not apply to structs.
representation of enums isn't strictly defined in Rust, and this attribute
won't work on enums.
`#[repr(simd)]` will give a struct consisting of a homogenous series of machine
`#[repr(simd)]` will give a struct consisting of a homogeneous series of machine
types (i.e. `u8`, `i32`, etc) a representation that permits vectorization via
SIMD. This doesn't make much sense for enums since they don't consist of a
single list of data.

View File

@ -238,7 +238,7 @@ impl Uniform {
pub trait LayoutExt<'tcx> {
fn is_aggregate(&self) -> bool;
fn homogenous_aggregate<'a>(&self, ccx: &CrateContext<'a, 'tcx>) -> Option<Reg>;
fn homogeneous_aggregate<'a>(&self, ccx: &CrateContext<'a, 'tcx>) -> Option<Reg>;
}
impl<'tcx> LayoutExt<'tcx> for TyLayout<'tcx> {
@ -258,7 +258,7 @@ impl<'tcx> LayoutExt<'tcx> for TyLayout<'tcx> {
}
}
fn homogenous_aggregate<'a>(&self, ccx: &CrateContext<'a, 'tcx>) -> Option<Reg> {
fn homogeneous_aggregate<'a>(&self, ccx: &CrateContext<'a, 'tcx>) -> Option<Reg> {
match *self.layout {
// The primitives for this algorithm.
Layout::Scalar { value, .. } |
@ -291,7 +291,7 @@ impl<'tcx> LayoutExt<'tcx> for TyLayout<'tcx> {
Layout::Array { count, .. } => {
if count > 0 {
self.field(ccx, 0).homogenous_aggregate(ccx)
self.field(ccx, 0).homogeneous_aggregate(ccx)
} else {
None
}
@ -307,8 +307,8 @@ impl<'tcx> LayoutExt<'tcx> for TyLayout<'tcx> {
}
let field = self.field(ccx, i);
match (result, field.homogenous_aggregate(ccx)) {
// The field itself must be a homogenous aggregate.
match (result, field.homogeneous_aggregate(ccx)) {
// The field itself must be a homogeneous aggregate.
(_, None) => return None,
// If this is the first field, record the unit.
(None, Some(unit)) => {
@ -344,8 +344,8 @@ impl<'tcx> LayoutExt<'tcx> for TyLayout<'tcx> {
for i in 0..self.field_count() {
let field = self.field(ccx, i);
match (result, field.homogenous_aggregate(ccx)) {
// The field itself must be a homogenous aggregate.
match (result, field.homogeneous_aggregate(ccx)) {
// The field itself must be a homogeneous aggregate.
(_, None) => return None,
// If this is the first field, record the unit.
(None, Some(unit)) => {
@ -830,7 +830,7 @@ impl<'a, 'tcx> FnType<'tcx> {
let size = arg.layout.size(ccx);
if let Some(unit) = arg.layout.homogenous_aggregate(ccx) {
if let Some(unit) = arg.layout.homogeneous_aggregate(ccx) {
// Replace newtypes with their inner-most type.
if unit.size == size {
// Needs a cast as we've unpacked a newtype.

View File

@ -11,9 +11,9 @@
use abi::{FnType, ArgType, LayoutExt, Reg, RegKind, Uniform};
use context::CrateContext;
fn is_homogenous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>)
fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>)
-> Option<Uniform> {
arg.layout.homogenous_aggregate(ccx).and_then(|unit| {
arg.layout.homogeneous_aggregate(ccx).and_then(|unit| {
let size = arg.layout.size(ccx);
// Ensure we have at most four uniquely addressable members.
@ -43,7 +43,7 @@ fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tc
ret.extend_integer_width_to(32);
return;
}
if let Some(uniform) = is_homogenous_aggregate(ccx, ret) {
if let Some(uniform) = is_homogeneous_aggregate(ccx, ret) {
ret.cast_to(ccx, uniform);
return;
}
@ -74,7 +74,7 @@ fn classify_arg_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tc
arg.extend_integer_width_to(32);
return;
}
if let Some(uniform) = is_homogenous_aggregate(ccx, arg) {
if let Some(uniform) = is_homogeneous_aggregate(ccx, arg) {
arg.cast_to(ccx, uniform);
return;
}

View File

@ -18,7 +18,7 @@ use context::CrateContext;
fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tcx>) {
if ret.layout.is_aggregate() {
if let Some(unit) = ret.layout.homogenous_aggregate(ccx) {
if let Some(unit) = ret.layout.homogeneous_aggregate(ccx) {
let size = ret.layout.size(ccx);
if unit.size == size {
ret.cast_to(ccx, Uniform {

View File

@ -15,9 +15,9 @@
use abi::{FnType, ArgType, LayoutExt, Reg, RegKind, Uniform};
use context::CrateContext;
fn is_homogenous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>)
fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>)
-> Option<Uniform> {
arg.layout.homogenous_aggregate(ccx).and_then(|unit| {
arg.layout.homogeneous_aggregate(ccx).and_then(|unit| {
let size = arg.layout.size(ccx);
// Ensure we have at most eight uniquely addressable members.
@ -53,7 +53,7 @@ fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tc
ret.make_indirect(ccx);
}
if let Some(uniform) = is_homogenous_aggregate(ccx, ret) {
if let Some(uniform) = is_homogeneous_aggregate(ccx, ret) {
ret.cast_to(ccx, uniform);
return;
}
@ -86,7 +86,7 @@ fn classify_arg_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tc
return;
}
if let Some(uniform) = is_homogenous_aggregate(ccx, arg) {
if let Some(uniform) = is_homogeneous_aggregate(ccx, arg) {
arg.cast_to(ccx, uniform);
return;
}

View File

@ -13,9 +13,9 @@
use abi::{FnType, ArgType, LayoutExt, Reg, RegKind, Uniform};
use context::CrateContext;
fn is_homogenous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>)
fn is_homogeneous_aggregate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>)
-> Option<Uniform> {
arg.layout.homogenous_aggregate(ccx).and_then(|unit| {
arg.layout.homogeneous_aggregate(ccx).and_then(|unit| {
let size = arg.layout.size(ccx);
// Ensure we have at most eight uniquely addressable members.
@ -46,7 +46,7 @@ fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tc
return;
}
if let Some(uniform) = is_homogenous_aggregate(ccx, ret) {
if let Some(uniform) = is_homogeneous_aggregate(ccx, ret) {
ret.cast_to(ccx, uniform);
return;
}
@ -80,7 +80,7 @@ fn classify_arg_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tc
return;
}
if let Some(uniform) = is_homogenous_aggregate(ccx, arg) {
if let Some(uniform) = is_homogeneous_aggregate(ccx, arg) {
arg.cast_to(ccx, uniform);
return;
}

View File

@ -74,7 +74,7 @@ pub fn compute_abi_info<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
if arg.is_ignore() || arg.is_indirect() { continue; }
// At this point we know this must be a primitive of sorts.
let unit = arg.layout.homogenous_aggregate(ccx).unwrap();
let unit = arg.layout.homogeneous_aggregate(ccx).unwrap();
let size = arg.layout.size(ccx);
assert_eq!(unit.size, size);
if unit.kind == RegKind::Float {