authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2024-07-20 22:28:42+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-07-20 22:28:42+02:00
log6d7bbab740a8c4790fe30c63d026d72fb7556984
tree6c8f34d1ad363fda01f0bfa6e6232f0eb44ab0d8
parentb5f3d121644031cf644271296e1ee5dbf363abeb
parent4c71d3f29e99d5fc4e69d842457933dc55fc7ac5
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #20696 from sobolevn/typos-fix

Fix typos in code comments in `src/`

13 files changed, 20 insertions(+), 20 deletions(-)

src/Air.zig+2-2
......@@ -271,7 +271,7 @@ pub const Inst = struct {
271271 /// Uses the `ty_pl` field with payload `Block`. A block runs its body which always ends
272272 /// with a `noreturn` instruction, so the only way to proceed to the code after the `block`
273273 /// is to encounter a `br` that targets this `block`. If the `block` type is `noreturn`,
274 /// then there do not exist any `br` instructions targetting this `block`.
274 /// then there do not exist any `br` instructions targeting this `block`.
275275 block,
276276 /// A labeled block of code that loops forever. At the end of the body it is implied
277277 /// to repeat; no explicit "repeat" instruction terminates loop bodies.
......@@ -357,7 +357,7 @@ pub const Inst = struct {
357357 /// Base 10 logarithm of a floating point number.
358358 /// Uses the `un_op` field.
359359 log10,
360 /// Aboslute value of an integer, floating point number or vector.
360 /// Absolute value of an integer, floating point number or vector.
361361 /// Result type is always unsigned if the operand is an integer.
362362 /// Uses the `ty_op` field.
363363 abs,
src/Sema.zig+1-1
......@@ -239,7 +239,7 @@ pub const InferredErrorSet = struct {
239239/// Stores the mapping from `Zir.Inst.Index -> Air.Inst.Ref`, which is used by sema to resolve
240240/// instructions during analysis.
241241/// Instead of a hash table approach, InstMap is simply a slice that is indexed into using the
242/// zir instruction index and a start offset. An index is not pressent in the map if the value
242/// zir instruction index and a start offset. An index is not present in the map if the value
243243/// at the index is `Air.Inst.Ref.none`.
244244/// `ensureSpaceForInstructions` can be called to force InstMap to have a mapped range that
245245/// includes all instructions in a slice. After calling this function, `putAssumeCapacity*` can
src/arch/wasm/CodeGen.zig+3-3
......@@ -692,7 +692,7 @@ mir_extra: std.ArrayListUnmanaged(u32) = .{},
692692/// When a function is executing, we store the the current stack pointer's value within this local.
693693/// This value is then used to restore the stack pointer to the original value at the return of the function.
694694initial_stack_value: WValue = .none,
695/// The current stack pointer substracted with the stack size. From this value, we will calculate
695/// The current stack pointer subtracted with the stack size. From this value, we will calculate
696696/// all offsets of the stack values.
697697bottom_stack_value: WValue = .none,
698698/// Arguments of this function declaration
......@@ -1294,7 +1294,7 @@ fn genFunc(func: *CodeGen) InnerError!void {
12941294 try prologue.append(.{ .tag = .i32_const, .data = .{ .imm32 = @intCast(aligned_stack) } });
12951295 // subtract it from the current stack pointer
12961296 try prologue.append(.{ .tag = .i32_sub, .data = .{ .tag = {} } });
1297 // Get negative stack aligment
1297 // Get negative stack alignment
12981298 try prologue.append(.{ .tag = .i32_const, .data = .{ .imm32 = @as(i32, @intCast(func.stack_alignment.toByteUnits().?)) * -1 } });
12991299 // Bitwise-and the value to get the new stack pointer to ensure the pointers are aligned with the abi alignment
13001300 try prologue.append(.{ .tag = .i32_and, .data = .{ .tag = {} } });
......@@ -4921,7 +4921,7 @@ fn memset(func: *CodeGen, elem_ty: Type, ptr: WValue, len: WValue, value: WValue
49214921 try func.startBlock(.block, wasm.block_empty);
49224922 try func.startBlock(.loop, wasm.block_empty);
49234923
4924 // check for codition for loop end
4924 // check for condition for loop end
49254925 try func.emitWValue(new_ptr);
49264926 try func.emitWValue(end_ptr);
49274927 switch (func.arch()) {
src/arch/x86_64/CodeGen.zig+1-1
......@@ -2685,7 +2685,7 @@ pub fn spillInstruction(self: *Self, reg: Register, inst: Air.Inst.Index) !void
26852685 const tracking = self.inst_tracking.getPtr(inst) orelse return;
26862686 for (tracking.getRegs()) |tracked_reg| {
26872687 if (tracked_reg.id() == reg.id()) break;
2688 } else unreachable; // spilled reg not tracked with spilled instruciton
2688 } else unreachable; // spilled reg not tracked with spilled instruction
26892689 try tracking.spill(self, inst);
26902690 try tracking.trackSpill(self, inst);
26912691}
src/codegen/c.zig+1-1
......@@ -1014,7 +1014,7 @@ pub const DeclGen = struct {
10141014 try writer.writeAll(", ");
10151015 empty = false;
10161016 } else {
1017 // isSignalNan is equivalent to isNan currently, and MSVC doens't have nans, so prefer nan
1017 // isSignalNan is equivalent to isNan currently, and MSVC doesn't have nans, so prefer nan
10181018 const operation = if (std.math.isNan(f128_val))
10191019 "nan"
10201020 else if (std.math.isSignalNan(f128_val))
src/codegen/llvm.zig+1-1
......@@ -855,7 +855,7 @@ pub const Object = struct {
855855 /// table for every zig source field of the struct that has a corresponding
856856 /// LLVM struct field. comptime fields are not included. Zero-bit fields are
857857 /// mapped to a field at the correct byte, which may be a padding field, or
858 /// are not mapped, in which case they are sematically at the end of the
858 /// are not mapped, in which case they are semantically at the end of the
859859 /// struct.
860860 /// The value is the LLVM struct field index.
861861 /// This is denormalized data.
src/codegen/spirv.zig+1-1
......@@ -3845,7 +3845,7 @@ const DeclGen = struct {
38453845 const result = try self.normalize(low_bits, info);
38463846
38473847 // Now, we need to check the overflow bits AND the sign
3848 // bit for the expceted overflow bits.
3848 // bit for the expected overflow bits.
38493849 // To do that, shift out everything bit the sign bit and
38503850 // then check what remains.
38513851 const shift = Temporary.init(full_result.ty, try self.constInt(full_result.ty, info.bits - 1, .direct));
src/link/SpirV/lower_invocation_globals.zig+1-1
......@@ -403,7 +403,7 @@ const ModuleBuilder = struct {
403403 .OpTypeFunction => {
404404 // Re-emitted in `emitFunctionTypes()`. We can do this because
405405 // OpTypeFunction's may not currently be used anywhere that is not
406 // directly with an OpFunction. For now we igore Intels function
406 // directly with an OpFunction. For now we ignore Intels function
407407 // pointers extension, that is not a problem with a generalized
408408 // pass anyway.
409409 continue;
src/link/Wasm.zig+3-3
......@@ -1314,7 +1314,7 @@ fn validateFeatures(
13141314/// Creates synthetic linker-symbols, but only if they are being referenced from
13151315/// any object file. For instance, the `__heap_base` symbol will only be created,
13161316/// if one or multiple undefined references exist. When none exist, the symbol will
1317/// not be created, ensuring we don't unneccesarily emit unreferenced symbols.
1317/// not be created, ensuring we don't unnecessarily emit unreferenced symbols.
13181318fn resolveLazySymbols(wasm: *Wasm) !void {
13191319 const comp = wasm.base.comp;
13201320 const gpa = comp.gpa;
......@@ -2340,10 +2340,10 @@ fn setupMemory(wasm: *Wasm) !void {
23402340 try wasm.addErrorWithoutNotes("Maximum memory must be {d}-byte aligned", .{page_size});
23412341 }
23422342 if (memory_ptr > max_memory) {
2343 try wasm.addErrorWithoutNotes("Maxmimum memory too small, must be at least {d} bytes", .{memory_ptr});
2343 try wasm.addErrorWithoutNotes("Maximum memory too small, must be at least {d} bytes", .{memory_ptr});
23442344 }
23452345 if (max_memory > max_memory_allowed) {
2346 try wasm.addErrorWithoutNotes("Maximum memory exceeds maxmium amount {d}", .{max_memory_allowed});
2346 try wasm.addErrorWithoutNotes("Maximum memory exceeds maximum amount {d}", .{max_memory_allowed});
23472347 }
23482348 wasm.memories.limits.max = @as(u32, @intCast(max_memory / page_size));
23492349 wasm.memories.limits.setFlag(.WASM_LIMITS_FLAG_HAS_MAX);
src/link/Wasm/Atom.zig+1-1
......@@ -14,7 +14,7 @@ alignment: Wasm.Alignment = .@"1",
1414/// Offset into the section where the atom lives, this already accounts
1515/// for alignment.
1616offset: u32 = 0,
17/// The original offset within the object file. This value is substracted from
17/// The original offset within the object file. This value is subtracted from
1818/// relocation offsets to determine where in the `data` to rewrite the value
1919original_offset: u32 = 0,
2020/// Previous atom in relation to this atom.
src/link/Wasm/Object.zig+2-2
......@@ -220,7 +220,7 @@ pub fn findImport(object: *const Object, sym: Symbol) types.Import {
220220}
221221
222222/// Checks if the object file is an MVP version.
223/// When that's the case, we check if there's an import table definiton with its name
223/// When that's the case, we check if there's an import table definition with its name
224224/// set to '__indirect_function_table". When that's also the case,
225225/// we initialize a new table symbol that corresponds to that import and return that symbol.
226226///
......@@ -315,7 +315,7 @@ pub const ParseError = error{
315315 Overflow,
316316 /// Found table definitions but no corresponding table symbols
317317 MissingTableSymbols,
318 /// Did not expect a table definiton, but did find one
318 /// Did not expect a table definition, but did find one
319319 UnexpectedTable,
320320 /// Object file contains a feature that is unknown to the linker
321321 UnknownFeature,
src/link/Wasm/Symbol.zig+1-1
......@@ -57,7 +57,7 @@ pub const Tag = enum {
5757pub const Flag = enum(u32) {
5858 /// Indicates a weak symbol.
5959 /// When linking multiple modules defining the same symbol, all weak definitions are discarded
60 /// in favourite of the strong definition. When no strong definition exists, all weak but one definiton is discarded.
60 /// in favourite of the strong definition. When no strong definition exists, all weak but one definition is discarded.
6161 /// If multiple definitions remain, we get an error: symbol collision.
6262 WASM_SYM_BINDING_WEAK = 0x1,
6363 /// Indicates a local, non-exported, non-module-linked symbol.
src/link/Wasm/ZigObject.zig+2-2
......@@ -1053,7 +1053,7 @@ fn setupErrorsLen(zig_object: *ZigObject, wasm_file: *Wasm) !void {
10531053
10541054 const errors_len = 1 + wasm_file.base.comp.module.?.intern_pool.global_error_set.getNamesFromMainThread().len;
10551055 // overwrite existing atom if it already exists (maybe the error set has increased)
1056 // if not, allcoate a new atom.
1056 // if not, allocate a new atom.
10571057 const atom_index = if (wasm_file.symbol_atom.get(.{ .file = zig_object.index, .index = sym_index })) |index| blk: {
10581058 const atom = wasm_file.getAtomPtr(index);
10591059 atom.prev = .null;
......@@ -1179,7 +1179,7 @@ pub fn storeDeclType(zig_object: *ZigObject, gpa: std.mem.Allocator, decl_index:
11791179}
11801180
11811181/// The symbols in ZigObject are already represented by an atom as we need to store its data.
1182/// So rather than creating a new Atom and returning its index, we use this oppertunity to scan
1182/// So rather than creating a new Atom and returning its index, we use this opportunity to scan
11831183/// its relocations and create any GOT symbols or function table indexes it may require.
11841184pub fn parseSymbolIntoAtom(zig_object: *ZigObject, wasm_file: *Wasm, index: Symbol.Index) !Atom.Index {
11851185 const gpa = wasm_file.base.comp.gpa;