Skip to content

Commit

Permalink
Correct the spelling of "homogeneous"
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Jul 22, 2017
1 parent 15aa15b commit 5c6ccdc
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/librustc/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 8 additions & 8 deletions src/librustc_trans/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand All @@ -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, .. } |
Expand Down Expand Up @@ -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
}
Expand All @@ -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)) => {
Expand Down Expand Up @@ -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)) => {
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_trans/cabi_aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/cabi_asmjs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_trans/cabi_powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_trans/cabi_sparc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/cabi_x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5c6ccdc

Please sign in to comment.