Skip to content

Commit 2abdea9

Browse files
committed
Fix spelling mistakes or ignore spell checking some parts of code
1 parent 72d99d0 commit 2abdea9

File tree

11 files changed

+38
-18
lines changed

11 files changed

+38
-18
lines changed

src/asm.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// cSpell:ignoreRegExp [afkspqvwy]reg
2+
13
use std::borrow::Cow;
24

35
use gccjit::{LValue, RValue, ToRValue, Type};
@@ -138,7 +140,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
138140
// `outputs.len() + inputs.len()`.
139141
let mut labels = vec![];
140142

141-
// Clobbers collected from `out("explicit register") _` and `inout("expl_reg") var => _`
143+
// Clobbers collected from `out("explicit register") _` and `inout("explicit_reg") var => _`
142144
let mut clobbers = vec![];
143145

144146
// We're trying to preallocate space for the template
@@ -203,7 +205,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
203205
// is also used as an in register, do not add it to the clobbers list.
204206
// it will be treated as a lateout register with `out_place: None`
205207
if !late {
206-
bug!("input registers can only be used as lateout regisers");
208+
bug!("input registers can only be used as lateout registers");
207209
}
208210
("r", dummy_output_type(self.cx, reg.reg_class()))
209211
} else {

src/back/lto.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
// does not remove it?
1212
//
1313
// TODO(antoyo): for performance, check which optimizations the C++ frontend enables.
14-
//
14+
// cSpell:disable
1515
// Fix these warnings:
1616
// /usr/bin/ld: warning: type of symbol `_RNvNvNvNtCs5JWOrf9uCus_5rayon11thread_pool19WORKER_THREAD_STATE7___getit5___KEY' changed from 1 to 6 in /tmp/ccKeUSiR.ltrans0.ltrans.o
1717
// /usr/bin/ld: warning: type of symbol `_RNvNvNvNvNtNtNtCsAj5i4SGTR7_3std4sync4mpmc5waker17current_thread_id5DUMMY7___getit5___KEY' changed from 1 to 6 in /tmp/ccKeUSiR.ltrans0.ltrans.o
1818
// /usr/bin/ld: warning: incremental linking of LTO and non-LTO objects; using -flinker-output=nolto-rel which will bypass whole program optimization
19+
// cSpell:enable
1920
use std::ffi::{CStr, CString};
2021
use std::fs::{self, File};
2122
use std::path::{Path, PathBuf};

src/back/write.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,15 @@ pub(crate) fn codegen(
186186

187187
if fat_lto {
188188
let lto_path = format!("{}.lto", path);
189+
// cSpell:disable
189190
// FIXME(antoyo): The LTO frontend generates the following warning:
190191
// ../build_sysroot/sysroot_src/library/core/src/num/dec2flt/lemire.rs:150:15: warning: type of ‘_ZN4core3num7dec2flt5table17POWER_OF_FIVE_12817ha449a68fb31379e4E’ does not match original declaration [-Wlto-type-mismatch]
191192
// 150 | let (lo5, hi5) = POWER_OF_FIVE_128[index];
192193
// | ^
193194
// lto1: note: ‘_ZN4core3num7dec2flt5table17POWER_OF_FIVE_12817ha449a68fb31379e4E’ was previously declared here
194195
//
195196
// This option is to mute it to make the UI tests pass with LTO enabled.
197+
// cSpell:enable
196198
context.add_driver_option("-Wno-lto-type-mismatch");
197199
// NOTE: this doesn't actually generate an executable. With the above
198200
// flags, it combines the .o files together in another .o.

src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,13 +1034,13 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
10341034
let b_offset = a.size(self).align_to(b.align(self).abi);
10351035

10361036
let mut load = |i, scalar: &abi::Scalar, align| {
1037-
let llptr = if i == 0 {
1037+
let ptr = if i == 0 {
10381038
place.val.llval
10391039
} else {
10401040
self.inbounds_ptradd(place.val.llval, self.const_usize(b_offset.bytes()))
10411041
};
10421042
let llty = place.layout.scalar_pair_element_gcc_type(self, i);
1043-
let load = self.load(llty, llptr, align);
1043+
let load = self.load(llty, ptr, align);
10441044
scalar_load_metadata(self, load, scalar);
10451045
if scalar.is_bool() { self.trunc(load, self.type_i1()) } else { load }
10461046
};

src/callee.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub fn get_fn<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, instance: Instance<'tcx>)
3434
unreachable!();
3535
/*
3636
// Create a fn pointer with the new signature.
37-
let ptrty = fn_abi.ptr_to_gcc_type(cx);
37+
let ptrtype = fn_abi.ptr_to_gcc_type(cx);
3838
3939
// This is subtle and surprising, but sometimes we have to bitcast
4040
// the resulting fn pointer. The reason has to do with external
@@ -59,7 +59,7 @@ pub fn get_fn<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, instance: Instance<'tcx>)
5959
// This can occur on either a crate-local or crate-external
6060
// reference. It also occurs when testing libcore and in some
6161
// other weird situations. Annoying.
62-
if cx.val_ty(func) != ptrty {
62+
if cx.val_ty(func) != ptrtype {
6363
// TODO(antoyo): cast the pointer.
6464
func
6565
}

src/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
443443
// `rust_eh_personality` function, but rather we wired it up to the
444444
// CRT's custom personality function, which forces LLVM to consider
445445
// landing pads as "landing pads for SEH".
446-
if let Some(llpersonality) = self.eh_personality.get() {
447-
return llpersonality;
446+
if let Some(personality_func) = self.eh_personality.get() {
447+
return personality_func;
448448
}
449449
let tcx = self.tcx;
450450
let func = match tcx.lang_items().eh_personality() {

src/gcc_util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
150150
// To find a list of GCC's names, check https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
151151
pub fn to_gcc_features<'a>(sess: &Session, s: &'a str) -> SmallVec<[&'a str; 2]> {
152152
let arch = if sess.target.arch == "x86_64" { "x86" } else { &*sess.target.arch };
153+
// cSpell:disable
153154
match (arch, s) {
154155
// FIXME: seems like x87 does not exist?
155156
("x86", "x87") => smallvec![],
@@ -188,6 +189,7 @@ pub fn to_gcc_features<'a>(sess: &Session, s: &'a str) -> SmallVec<[&'a str; 2]>
188189
("aarch64", "sve2-bitperm") => smallvec!["sve2-bitperm", "neon"],
189190
(_, s) => smallvec![s],
190191
}
192+
// cSpell:enable
191193
}
192194

193195
fn arch_to_gcc(name: &str) -> &str {

src/int.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//! This module exists because some integer types are not supported on some gcc platforms, e.g.
33
//! 128-bit integers on 32-bit platforms and thus require to be handled manually.
44
5+
// cSpell:words cmpti divti modti mulodi muloti udivti umodti
6+
57
use gccjit::{BinaryOp, ComparisonOp, FunctionType, Location, RValue, ToRValue, Type, UnaryOp};
68
use rustc_abi::{Endian, ExternAbi};
79
use rustc_codegen_ssa::common::{IntPredicate, TypeKind};
@@ -913,9 +915,11 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
913915

914916
debug_assert!(value_type.dyncast_array().is_some());
915917
let name_suffix = match self.type_kind(dest_typ) {
918+
// cSpell:disable
916919
TypeKind::Float => "tisf",
917920
TypeKind::Double => "tidf",
918921
TypeKind::FP128 => "titf",
922+
// cSpell:enable
919923
kind => panic!("cannot cast a non-native integer to type {:?}", kind),
920924
};
921925
let sign = if signed { "" } else { "un" };
@@ -957,8 +961,10 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
957961

958962
debug_assert!(dest_typ.dyncast_array().is_some());
959963
let name_suffix = match self.type_kind(value_type) {
964+
// cSpell:disable
960965
TypeKind::Float => "sfti",
961966
TypeKind::Double => "dfti",
967+
// cSpell:enable
962968
kind => panic!("cannot cast a {:?} to non-native integer", kind),
963969
};
964970
let sign = if signed { "" } else { "uns" };

src/intrinsic/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
643643

644644
fn type_checked_load(
645645
&mut self,
646-
_llvtable: Self::Value,
646+
_vtable: Self::Value,
647647
_vtable_byte_offset: u64,
648648
_typeid: Self::Value,
649649
) -> Self::Value {
@@ -750,23 +750,23 @@ impl<'gcc, 'tcx> ArgAbiExt<'gcc, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
750750
// We instead thus allocate some scratch space...
751751
let scratch_size = cast.size(bx);
752752
let scratch_align = cast.align(bx);
753-
let llscratch = bx.alloca(scratch_size, scratch_align);
754-
bx.lifetime_start(llscratch, scratch_size);
753+
let scratch = bx.alloca(scratch_size, scratch_align);
754+
bx.lifetime_start(scratch, scratch_size);
755755

756756
// ... where we first store the value...
757-
bx.store(val, llscratch, scratch_align);
757+
bx.store(val, scratch, scratch_align);
758758

759759
// ... and then memcpy it to the intended destination.
760760
bx.memcpy(
761761
dst.val.llval,
762762
self.layout.align.abi,
763-
llscratch,
763+
scratch,
764764
scratch_align,
765765
bx.const_usize(self.layout.size.bytes()),
766766
MemFlags::empty(),
767767
);
768768

769-
bx.lifetime_end(llscratch, scratch_size);
769+
bx.lifetime_end(scratch, scratch_size);
770770
}
771771
} else {
772772
OperandValue::Immediate(val).store(bx, dst);

src/intrinsic/simd.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,9 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
10861086
let (_, element_ty1) = arg_tys[1].simd_size_and_type(bx.tcx());
10871087
let (_, element_ty2) = arg_tys[2].simd_size_and_type(bx.tcx());
10881088
let (pointer_count, underlying_ty) = match *element_ty1.kind() {
1089-
ty::RawPtr(p_ty, mutbl) if p_ty == in_elem && mutbl == hir::Mutability::Mut => {
1089+
ty::RawPtr(p_ty, mutability)
1090+
if p_ty == in_elem && mutability == hir::Mutability::Mut =>
1091+
{
10901092
(ptr_count(element_ty1), non_ptr(element_ty1))
10911093
}
10921094
_ => {

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
* TODO(antoyo): support #[inline] attributes.
44
* TODO(antoyo): support LTO (gcc's equivalent to Full LTO is -flto -flto-partition=one — https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html).
55
* For Thin LTO, this might be helpful:
6+
// cspell:disable-next-line
67
* In gcc 4.6 -fwhopr was removed and became default with -flto. The non-whopr path can still be executed via -flto-partition=none.
78
* Or the new incremental LTO (https://www.phoronix.com/news/GCC-Incremental-LTO-Patches)?
89
*
9-
* Maybe some missing optizations enabled by rustc's LTO is in there: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
10+
* Maybe some missing optimizations enabled by rustc's LTO is in there: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
11+
// cspell:disable-next-line
1012
* Like -fipa-icf (should be already enabled) and maybe -fdevirtualize-at-ltrans.
1113
* TODO: disable debug info always being emitted. Perhaps this slows down things?
1214
*
@@ -443,10 +445,11 @@ impl WriteBackendMethods for GccCodegenBackend {
443445
) -> Result<ModuleCodegen<Self::Module>, FatalError> {
444446
back::write::link(cgcx, dcx, modules)
445447
}
448+
446449
fn autodiff(
447450
_cgcx: &CodegenContext<Self>,
448451
_module: &ModuleCodegen<Self::Module>,
449-
_diff_fncs: Vec<AutoDiffItem>,
452+
_diff_functions: Vec<AutoDiffItem>,
450453
_config: &ModuleConfig,
451454
) -> Result<(), FatalError> {
452455
unimplemented!()
@@ -507,12 +510,14 @@ fn target_config(sess: &Session, target_info: &LockedTargetInfo) -> TargetConfig
507510
return false;
508511
}
509512
target_info.cpu_supports(feature)
513+
// cSpell:disable
510514
/*
511515
adx, aes, avx, avx2, avx512bf16, avx512bitalg, avx512bw, avx512cd, avx512dq, avx512er, avx512f, avx512fp16, avx512ifma,
512516
avx512pf, avx512vbmi, avx512vbmi2, avx512vl, avx512vnni, avx512vp2intersect, avx512vpopcntdq,
513517
bmi1, bmi2, cmpxchg16b, ermsb, f16c, fma, fxsr, gfni, lzcnt, movbe, pclmulqdq, popcnt, rdrand, rdseed, rtm,
514518
sha, sse, sse2, sse3, sse4.1, sse4.2, sse4a, ssse3, tbm, vaes, vpclmulqdq, xsave, xsavec, xsaveopt, xsaves
515519
*/
520+
// cSpell:enable
516521
})
517522
.map(Symbol::intern)
518523
.collect()

0 commit comments

Comments
 (0)