diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index cef1be5cee232..b52224eb5d767 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -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. diff --git a/src/librustc_trans/abi.rs b/src/librustc_trans/abi.rs index 120f201a9c8b7..144b484d7e819 100644 --- a/src/librustc_trans/abi.rs +++ b/src/librustc_trans/abi.rs @@ -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; + fn homogeneous_aggregate<'a>(&self, ccx: &CrateContext<'a, 'tcx>) -> Option; } 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 { + fn homogeneous_aggregate<'a>(&self, ccx: &CrateContext<'a, 'tcx>) -> Option { 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. diff --git a/src/librustc_trans/cabi_aarch64.rs b/src/librustc_trans/cabi_aarch64.rs index c8c5af714d92a..bf842e6358f87 100644 --- a/src/librustc_trans/cabi_aarch64.rs +++ b/src/librustc_trans/cabi_aarch64.rs @@ -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 { - 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; } diff --git a/src/librustc_trans/cabi_asmjs.rs b/src/librustc_trans/cabi_asmjs.rs index f05dda8bce21a..6fcd3ed581d27 100644 --- a/src/librustc_trans/cabi_asmjs.rs +++ b/src/librustc_trans/cabi_asmjs.rs @@ -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 { diff --git a/src/librustc_trans/cabi_powerpc64.rs b/src/librustc_trans/cabi_powerpc64.rs index c4f8d0b4b9637..5c695387236fa 100644 --- a/src/librustc_trans/cabi_powerpc64.rs +++ b/src/librustc_trans/cabi_powerpc64.rs @@ -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 { - 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; } diff --git a/src/librustc_trans/cabi_sparc64.rs b/src/librustc_trans/cabi_sparc64.rs index b75fa97f948ec..8383007550e1e 100644 --- a/src/librustc_trans/cabi_sparc64.rs +++ b/src/librustc_trans/cabi_sparc64.rs @@ -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 { - 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; } diff --git a/src/librustc_trans/cabi_x86.rs b/src/librustc_trans/cabi_x86.rs index 9f5520dabe334..8b024b8c97fa0 100644 --- a/src/librustc_trans/cabi_x86.rs +++ b/src/librustc_trans/cabi_x86.rs @@ -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 {